Disable Scalix on port 80 (only secure logins)

Discuss installation of Scalix software

Moderators: ScalixSupport, admin

joaster
Posts: 101
Joined: Wed Aug 02, 2006 9:08 am

Disable Scalix on port 80 (only secure logins)

Postby joaster » Tue Aug 08, 2006 5:19 am

Hi,

I like to disable the Scalix logins on port 80, to make sure users will login on port 443.

However, only Scalix should not listen on port 80 since the website should be accessible on port 80.Therefor shutting down port 80 in apache or iptables is not an option.

Anyone who can help me out here?

Joost

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Tue Aug 08, 2006 5:58 pm

I can't give you full instructions right now, but the best basic idea is to change the interaction of Apache with Tomcat through mod_jk.

Currently our installation sets up mod_jk to forward requests to all Scalix URLs (i.e. /webmail, /sac, /res, /caa and /webcal) to tomcat, independent on how they come in.

As SSL port :443 is a separate virtual host from Apache's point of view, the configuration can be moved from a global config to a per-host configuration.

Note that you will need to keep at least /caa and /res open for http, otherwise Scalix Admin Console will stop to function.

Hope this helps for an idea - maybe there is a Apache czar out here that can quickly hack together config file samples; every time I have to configure apache, I really envy it's flexibility but somehow drown in the possibilities..... ;-)

cheers,
Florian.
Florian von Kurnatowski, Die Harder!

dkelly
Scalix
Scalix
Posts: 593
Joined: Thu Mar 18, 2004 2:03 pm

Postby dkelly » Tue Aug 08, 2006 6:29 pm


joaster
Posts: 101
Joined: Wed Aug 02, 2006 9:08 am

Postby joaster » Wed Aug 09, 2006 3:58 am

Thanks for the quick responses,

This morning I added the code supplied by Dave's link and it works like a charm.

Is it an idea to put this solution in the knowlegde base (howto)? This is really a security fix that makes working via the web interface more secure.

Regards,
Joost.

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Wed Aug 09, 2006 4:05 am

sure. believe we already have a knowledgebase article on the wiki on apache in http://www.scalix.com/wiki/index.php?ti ... Tos/Apache.

What about you add this to the article - the wiki is freely editable by all registered users... :-)

Thanks in Advance.
Florian. :D
Florian von Kurnatowski, Die Harder!

joaster
Posts: 101
Joined: Wed Aug 02, 2006 9:08 am

Postby joaster » Mon Aug 28, 2006 11:36 am

Florian,

The howto you refer to is more about apache and tomcat. What about creating a Security Howto with information about hardening your Scalix server.

1. Force to use https
2. Change SMTP greeting => is already a howto on it's own
3. Change POP greeting
4. Change IMAP greeting
5. Change Apache information
6. Overview of ports in use by Scalix and which can be firewalled
etc.

I don't see how i can create the howto, but I can write about the first and 6th point above.

Regards,
Joost.

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Mon Aug 28, 2006 12:00 pm

Hi,

sure - if you want to summarize it that way? An initial security how-to could be created on the Wiki and, if there are other documents around, at least centralize the links. Additional stuff could be added, such as running tomcat as non-root, iptables firewalling, setting up stunnel or the use of SELinux in a controlled way.

Maybe you want to give this a start - just add it to the HowTos-section at www.scalix.com/wiki

However, looking at your list below, unfortunately 3 and 4 cannot be done today - I'll add enhancement requests for that. I don't really understand what you mean by 5.

Cheers,
Florian.
Florian von Kurnatowski, Die Harder!

dkelly
Scalix
Scalix
Posts: 593
Joined: Thu Mar 18, 2004 2:03 pm

Postby dkelly » Mon Aug 28, 2006 12:03 pm

You can change the IMAP server greeting by setting the general.cfg tweak IMAP_GREETING.

There is no equivalent for the POP server.

Cheers

Dave

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Mon Aug 28, 2006 12:09 pm

wow, one never stops learning. :-)

Florian
Florian von Kurnatowski, Die Harder!

jcaudell
Posts: 73
Joined: Tue Jul 18, 2006 9:56 am

Postby jcaudell » Mon Aug 28, 2006 1:34 pm

#5

from the apache faq: http://httpd.apache.org/docs/1.3/misc/F ... rverheader

Couldnt find equivalent info in the 2.0 faq. In short, you could recompile Apache. so probably not worth it.

How can I change the information that Apache returns about itself in the headers?

When a client connects to Apache, part of the information returned in the headers is the name "Apache" Additional information that can be sent is the version number, such as "1.3.26", the operating system, and a list of non-standard modules you have installed.

For example:

Server: Apache/1.3.26 (Unix) mod_perl/1.26

Frequently, people want to remove this information, under the mistaken understanding that this will make the system more secure. This is probably not the case, as the same exploits will likely be attempted regardless of the header information you provide.

There are, however, two answers to this question: the correct answer, and the answer that you are probably looking for.

The correct answer to this question is that you should use the ServerTokens directive to alter the quantity of information which is passed in the headers. Setting this directive to Prod will pass the least possible amount of information:

Server: Apache

The answer you are probably looking for is how to make Apache lie about what what it is, ie send something like:

Server: Bob's Happy HTTPd Server

In order to do this, you will need to modify the Apache source code and rebuild Apache. This is not advised, as it is almost certain not to provide you with the added security you think that you are gaining. The exact method of doing this is left as an exercise for the reader, as we are not keen on helping you do something that is intrinsically a bad idea.
[/code]

joaster
Posts: 101
Joined: Wed Aug 02, 2006 9:08 am

Postby joaster » Mon Aug 28, 2006 6:16 pm

This week I will try to start the Security howto, but I first have to gather some extra information. For example about hardening the IMAP daemon.

Standard IMAP session:

Code: Select all

$ telnet mail 143

Trying 192.168.100.11...
Connected to mail.yourdomain.net (192.168.100.11).
Escape character is '^]'.
* OK Scalix IMAP server 10.0.1.3 ready on mail.yourdomain.net
a1 logout
* BYE Scalix IMAP Server logging out
a1 OK LOGOUT completed
Connection closed by foreign host.


As you can see both the greeting and goodbye line reveal sensative information.
You can change the greeting by setting the IMAP_GREETING tag in general.cfg, e.g. by adding "IMAP_GREETING=IMAPd" to the file.

Question #1: how to restart only the imap daemon after changing the file?

Custom IMAP session:

Code: Select all

$ telnet mail 143

Trying 192.168.100.11...
Connected to mail.yourdomain.net (192.168.100.11).
Escape character is '^]'.
* OK IMAPd
a1 logout
* BYE Scalix IMAP Server logging out
a1 OK LOGOUT completed
Connection closed by foreign host.


Question #2: how to change the goodbye line, this still reveals the Scalix server (happily not the version number)?

Regards,
Joost

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Mon Aug 28, 2006 6:44 pm

To restart just the imap process use:

omoff -d0 -w imap
omon imap.

You can use omoff and omon for most scalix processes. Please see the man pages.

It is not currently possible to configure the exit text. An enhancement request has been entered.

Regards,
Don

joaster
Posts: 101
Joined: Wed Aug 02, 2006 9:08 am

Postby joaster » Tue Aug 29, 2006 8:13 pm

I can proudly announce that today I have started the Scalix Security How-To (see http://www.scalix.com/wiki/index.php?title=HowTos/ScalixSecurity)

When working on the Apache hardening section, I found out that the login screens of Webmail and SAC contain their version numbers.

Any idea how to get rid of those?

Regards,
Joost


Return to “Installation”



Who is online

Users browsing this forum: No registered users and 3 guests