Wiki . Forums . Bugs . Translation . Privacy Policy | Search . Simple . Advanced | Reports . Help | Matrix . 10.x . 11.x . 12.x . 13.x . Future . Recent . Contribs

Bug 882 - ibay customisation: SSL option
Summary: ibay customisation: SSL option
Status: CLOSED FIXED
Alias: None
Product: SME Server 9.X
Classification: SME Server
Component: New Feature Request (show other bugs)
Version: 9.0b1
Hardware: --- ---
: P3 normal
Target Milestone: 9.0b4
Assignee: SME Server bug team
QA Contact:
URL: http://httpd.apache.org/docs/2.2/mod/...
Depends on: 820
Blocks: 8150
  Show dependency tree / graph
 
Reported: 2006-02-23 16:01 CET by Jean-Philippe Pialasse
Modified: 2021-03-10 00:36 CET (History)
4 users (show)

See Also:
Package: smeserver-ibays
greg: code_attached+


Attachments
patch with SSL and php error display and reporting (1.36 KB, patch)
2007-01-25 01:20 CET, Jean-Philippe Pialasse
Details | Diff
Require SSL patch (1.33 KB, patch)
2013-12-21 18:15 CET, Ian Wells
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Philippe Pialasse 2006-02-23 16:01:00 CET
+++ 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";
Comment 29 Ian Wells 2014-04-11 23:27:21 CEST
Closing as SME Server 9.0 Beta 4 was released
Comment 28 Stephane de Labrusse 2014-01-20 05:03:43 CET
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:
Comment 27 Stephane de Labrusse 2014-01-19 13:16:26 CET
(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 ?
Comment 26 Ian Wells 2014-01-19 10:28:03 CET
(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
Comment 25 Stephane de Labrusse 2014-01-19 07:50:47 CET
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 ?
Comment 24 Ian Wells 2014-01-02 21:41:58 CET
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');
Comment 23 Ian Wells 2014-01-02 15:27:47 CET
(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');
    }
}
Comment 22 Ian Wells 2013-12-23 20:04:19 CET
(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' ?
Comment 21 Ian Wells 2013-12-23 20:02:25 CET
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.
Comment 20 Stephane de Labrusse 2013-12-22 04:09:49 CET
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.
Comment 19 Ian Wells 2013-12-21 21:46:08 CET
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.
Comment 18 Ian Wells 2013-12-21 18:15:48 CET
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');
Comment 17 Ian Wells 2013-12-21 18:03:56 CET
(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.
Comment 16 Stephane de Labrusse 2013-12-21 17:49:38 CET
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 ?
Comment 15 Ian Wells 2013-12-21 17:47:39 CET
PHP error reporting now handled in Bug 8077
Comment 14 Ian Wells 2013-12-21 17:45:49 CET
(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.
Comment 13 Stephane de Labrusse 2013-12-21 16:34:31 CET
(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.
Comment 12 Ian Wells 2013-12-20 14:34:29 CET
(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.
Comment 11 Stephane de Labrusse 2013-12-01 12:45:43 CET
(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.
Comment 10 Ian Wells 2013-11-30 11:06:07 CET
Is the SSL part handled by Bug 3675?
Comment 9 Ian Wells 2013-10-16 18:17:43 CEST
Moving milestone to future as Beta 1 has been released. It could make Beta 2 if someone actively works at this.
Comment 8 Jean-Philippe Pialasse 2013-10-16 14:33:01 CEST
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...
Comment 7 Jonathan 2007-04-15 13:30:58 CEST
(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.
Comment 6 Jean-Philippe Pialasse 2007-01-25 01:20:25 CET
Created attachment 811 [details]
patch with SSL and php error display and reporting
Comment 5 Greg Swallow 2007-01-25 00:49:06 CET
(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.
Comment 4 Jean-Philippe Pialasse 2007-01-25 00:28:31 CET
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?
Comment 3 Greg Swallow 2007-01-23 16:13:55 CET
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.
Comment 2 Gordon Rowell 2006-02-23 16:25:38 CET
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
Comment 1 Charlie Brady 2006-02-23 16:16:38 CET
Moving to Future, as we do with all New Feature Requests.