+++ This bug was initially created as a clone of Bug #820 +++ In 90e-smithAccess40ibays template, i can suggest some adds next to this modification: This will allow easy customization (for security or devellopment purpose) + if($properties{'SSLRequireSSL'}) + { + if($properties{'SSLRequireSSL'} eq 'on') + { + $OUT.=" SSLRequireSSL\n"; + } + } + + if($properties{'display_errors'}) + { + $OUT.=" php_flag display_errors ".$properties{'display_errors'}."\n"; + } + if ($properties{'error_reporting'}) + #error_reporting must be an Int, do not use the constant + { + $OUT.=" php_admin_value error_reporting ".$properties{'error_reporting'}."\n"; + } $OUT .= "</Directory>\n";
Closing as SME Server 9.0 Beta 4 was released
VERIFICATION = ENVIRONMENT: Fully updated SME9 64 bit = ORIGINAL PROBLEM: Create a migrate fragment to set SSLRequireSSL "on" to "enabled" and Denying non SSL protocol = RESOLUTION: %changelog * Thu Jan 2 2014 Ian Wells <esmith@wellsi.com> 2.4.0-6.sme - Provide the ability to restrict ibay access to https, by JPP [SME: 882] - Remove old migrate fragment [SME: 8080] - Whitespace cleanup, mainly tab removal, of 90e-smithAccess40ibays = CURRENT VERSION INSTALLED: # rpm -qa e-smith-ibays e-smith-ibays-2.4.0-3.el6.sme.noarch =TESTING: see the ibay image # db accounts show image image=ibay CgiBin=enabled Gid=5003 Group=famille Name=essai PasswordSet=no PublicAccess=global Uid=5003 UserAccess=wr-group-rd-group see image directory # less /etc/httpd/conf/httpd.conf <Directory /home/e-smith/files/ibays/image/html> Options None Options +Indexes Options +Includes AllowOverride None order deny,allow deny from all allow from all </Directory> The we make the property SSLRequireSSL # db accounts setprop image SSLRequireSSL on # db accounts show image | grep SSL SSLRequireSSL=on = UPDATED VERSION INSTALLED: # yum install --enablerepo=smeupdates-testing e-smith-ibays # signal-event post-upgrade; signal-event reboot # rpm -qa e-smith-ibays e-smith-ibays-2.4.0-6.el6.sme.noarch = PROBLEM FIXED?: see image ibays # db accounts show image | grep SSL SSLRequireSSL=on Then doing the event migrating # /etc/e-smith/events/bootstrap-console-save/S00initialize-default-databases Migrating existing database yum_available Migrating existing database hosts Migrating existing database yum_updates Migrating existing database domains Migrating existing database mailpatterns Migrating existing database yum_repositories Migrating existing database yum_installed Migrating existing database networks Migrating existing database configuration Migrating existing database accounts Migrating existing database backups Migrating existing database spamassassin and see if migrated # db accounts show image | grep SSL SSLRequireSSL=enabled yes :) Now expanding http templates # signal-event console-save see image directory # less /etc/httpd/conf/httpd.conf <Directory /home/e-smith/files/ibays/image/html> SSLRequireSSL Options None Options +Indexes Options +Includes AllowOverride None order deny,allow deny from all allow from all </Directory> yes again :) = VERIFIED OR REOPEN: proposed VERIFIED = DOCUMENTATION IMPACT: The DB command should be documented = SUGGESTED RELEASE NOTES:
(In reply to Ian Wells from comment #26) > (In reply to Stephane de Labrusse from comment #25) > > hi ian i do not understand why you have done one db command more to restrict > > the access to ssl > > See comment 17 and comment 19 > > I am not against opening a new bug to consider merging the different ibay > SSL properties, but that is not this bug. > > > Marking verified based on Comment 25 please ian do i need to develop a migrate fragment to remove 'SSLRequireSSL' or we can consider that nobody is using it since the rpm is not released and we can remove the migrate fragment you added ?
(In reply to Stephane de Labrusse from comment #25) > hi ian i do not understand why you have done one db command more to restrict > the access to ssl See comment 17 and comment 19 I am not against opening a new bug to consider merging the different ibay SSL properties, but that is not this bug. Marking verified based on Comment 25
hi ian i do not understand why you have done one db command more to restrict the access to ssl see # db accounts show plop | grep SSL SSL=enabled SSLRequireSSL=enabled all i have tested is workable but we could take the db command (SSL) of ibay to do this file : /etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays ---snip---snip--- my $sslRequireSSL = $properties{'SSL'} || "disabled"; if ($sslRequireSSL eq 'enabled') { $OUT .=" SSLRequireSSL\n"; } ---snip---snip--- if you can motivate your choice it could be nice ian ?
Resolved Fixed in e-smith-ibays-2.4.0-6.el6.sme.noarch %changelog * Thu Jan 2 2014 Ian Wells <esmith@wellsi.com> 2.4.0-6.sme - Provide the ability to restrict ibay access to https, by JPP [SME: 882] - Remove old migrate fragment [SME: 8080] - Whitespace cleanup, mainly tab removal, of 90e-smithAccess40ibays Partial testing of the patch [root@sme9x64 ~]# db accounts setprop one SSLRequireSSL on [root@sme9x64 ~]# db accounts show one | grep SSL SSLRequireSSL=on [root@sme9x64 ~]# /etc/e-smith/events/bootstrap-console-save/S00initialize-default-databases Migrating existing database yum_repositories Migrating existing database yum_installed Migrating existing database yum_available Migrating existing database hosts Migrating existing database mailpatterns Migrating existing database networks Migrating existing database accounts Migrating existing database spamassassin Migrating existing database backups Migrating existing database configuration Migrating existing database yum_updates Migrating existing database domains [root@sme9x64 ~]# db accounts show one | grep SSL SSLRequireSSL=enabled The code in comment 23 does not work in the template, but a simple OR i.e. || did. $ibay->set_prop ('SSLRequireSSL', 'enabled') if (($ibay->prop ('SSLRequireSSL') || '') eq 'on');
(In reply to Ian Wells from comment #21) > Is there a better way to migrate any existing 'SSLRequireSSL' 'On' to > 'enabled'? I'll try to answer myself. As SME 9 uses Perl 5.10 I can use //= syntax to handle the case where the property is not defined. { foreach my $ibay ($DB->get_all_by_prop(type => 'ibay')) { # SME9 introduced SSLRequireSSL with enabled/disabled. # This replaces local customisation, so migrate 'on' to 'enabled' $ibay->set_prop ('SSLRequireSSL', 'enabled') if (($ibay->prop ('SSLRequireSSL') //= '') eq 'on'); } }
(In reply to Ian Wells from comment #21) > Is there a better way to migrate any existing 'SSLRequireSSL' 'On' to > 'enabled'? I meant 'SSLRequireSSL' 'on' to 'enabled' ?
Is there a better way to migrate any existing 'SSLRequireSSL' 'On' to 'enabled'? The background is that there are some entries in the wiki/forum showing how to do this modification as a custom template and for some reason it used 'on' as the active setting. However I believe 'enabled' is more in line with convention. /etc/e-smith/db/accounts/migrate/20ibay-accounts +{ + foreach my $ibay ($DB->get_all_by_prop(type => 'ibay')) + { + # SME9 introduced SSLRequireSSL with enabled/disabled. + # This replaces local customisation, so migrate 'on' to 'enabled' + my $sslRequireSSL = $ibay->prop ('SSLRequireSSL') || "disabled"; + if ($sslRequireSSL eq 'on') + { + $ibay->set_prop ('SSLRequireSSL', 'enabled'); + } + } +} Comment #20 shows that this may now be of limited use, but I had already implemented it.
so you are meaning to use two apache directives -the redirection http to https -the requiressl if the redirection fails i have used these directives in phpvirtualbox, and effectively the redirection is used first and the requiressl doesn't refuse the access.
http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslrequiressl This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for the current connection. This is very handy inside the SSL-enabled virtual host or directories for defending against configuration errors that expose stuff that should be protected. When this directive is present all requests are denied which are not using SSL.
Created attachment 4348 [details] Require SSL patch A slightly different patch to better match the conventions used in that file. @@ -92,6 +92,7 @@ my $dynamicContent = $properties{'CgiBin'} || "disabled"; my $followSymLinks = $properties{'FollowSymLinks'} || "disabled"; my $indexes = $properties{'Indexes'} || "enabled"; + my $sslRequireSSL = $properties{'SSLRequireSSL'} || "disabled"; $OUT .= "\n"; $OUT .= "#------------------------------------------------------------\n"; $OUT .= "# $key ibay directories ($properties{'Name'})\n"; @@ -99,6 +100,10 @@ $OUT .= "\n"; $OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n"; + if ($sslRequireSSL eq 'enabled') + { + $OUT .=" SSLRequireSSL\n"; + } $OUT .= " Options None\n"; $OUT .= " Options +Indexes\n" if ($indexes eq 'enabled'); $OUT .= " Options +FollowSymLinks\n" if ($followSymLinks eq 'enabled');
(In reply to Stephane de Labrusse from comment #16) > ian, probably i do not understand well, but why do you want to add ssl > option of this bug as it is covered by the bug 3675 ? As you explained in Comment #11 this is different as "forbid all connexions without ssl" although I have not tested that yet.
ian, probably i do not understand well, but why do you want to add ssl option of this bug as it is covered by the bug 3675 ?
PHP error reporting now handled in Bug 8077
(In reply to Stephane de Labrusse from comment #13) > (In reply to Ian Wells from comment #12) > > > Would you be happy to just have the SSL part, and leave the PHP to another > > bug? I would approve just the SSL change - with some more testing. > > I'm not the code provider in this bug, what about of this Jpp ? > > Bug 3675 is entirely independent of this one, and it doesn't share code > > Moreover the patch provided here in bug 882 doesn't refer to a package and > need to be build before to be uploaded to cvs. I can make the patch. I've changed the title to restrict the scope of the bug. The PHP part can be handled on its own as it is not related to the SSL change.
(In reply to Ian Wells from comment #12) > Would you be happy to just have the SSL part, and leave the PHP to another > bug? I would approve just the SSL change - with some more testing. I'm not the code provider in this bug, what about of this Jpp ? Bug 3675 is entirely independent of this one, and it doesn't share code Moreover the patch provided here in bug 882 doesn't refer to a package and need to be build before to be uploaded to cvs.
(In reply to Stephane de Labrusse from comment #11) > (In reply to Ian Wells from comment #10) > > Is the SSL part handled by Bug 3675? > > not completely as here the behaviour is to require ssl and to forbid all > connexions without ssl. For the bug 3675 it is different as it is a > redirection, if you come on http you are redirected to https. > > for the remainder of the diff file, it is done to display php errors. Would you be happy to just have the SSL part, and leave the PHP to another bug? I would approve just the SSL change - with some more testing.
(In reply to Ian Wells from comment #10) > Is the SSL part handled by Bug 3675? not completely as here the behaviour is to require ssl and to forbid all connexions without ssl. For the bug 3675 it is different as it is a redirection, if you come on http you are redirected to https. for the remainder of the diff file, it is done to display php errors.
Is the SSL part handled by Bug 3675?
Moving milestone to future as Beta 1 has been released. It could make Beta 2 if someone actively works at this.
could be great to enhance more options in ibays. This way most php web apps could be integrated easily. and shared folder would not be usefull anymore...
(In reply to comment #6) > Created an attachment (id=811) [details] > patch with SSL and php error display and reporting As a remark to the patch: In the light of this page (http://www.onlamp.com/pub/a/php/2001/01/11/php_admin.html) I think the use of php_flag is illegal in this case as we are not defining custom variables, but we are overriding default values. I also wonder if it is necessary to set a php_admin_value as well as a php_flag. The use of php_admin_value (and maybe php_admin_flag) in this case seems more appropriate to me. I would stick to using php_admin_value.
Created attachment 811 [details] patch with SSL and php error display and reporting
(In reply to comment #2) > However, I would like to stop expanding 90e-smithAccess40ibays and deal with > such fragments in a loop, as done in > /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts Gordon, did you mean doing this is this is a must before adding the patch to 90e-smithAccess40ibays? Unilennium, can you please attach a the patch (done with diff -u) for the latest version, rather than post it as a message. Thanks.
Greg do you suggest to split to two other bugs: one for SSL and one for errors: display_errors + error_reporting How do one handle the methode you describe ? IS it just split the 90e-smithAccess40ibays file into lot of files in a 90e-smithAccess40ibays directory or does it means create some more script to deal with what is inside the folder?
This bug has been automatically set to RESOLVED/REMIND because there have been no comments in 60 days. If this bug is not commented on in the next 30 days, it will be set to RESOLVED/INVALID. Please don't let that happen. - If you are the reporter of this bug, please reopen the bug and provide some more information if it has been requested. - If this bug was reported against an older release of SME Server than the current 7.1, please test again with 7.1 and reopen the bug if the problem still exists. - If you still care about this problem please reopen and continue working towards a solution.
I think this should again be split for tracking purposes (sorry to be painful). All seem like good suggestions, and I would certainly like to see an "SSLRequired" option for ibays. However, I would like to stop expanding 90e-smithAccess40ibays and deal with such fragments in a loop, as done in /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts
Moving to Future, as we do with all New Feature Requests.