Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > The Community > Everything BSD > how secure is default apache-2.2.8 + FreeBSD7?

Forgot Password?
 Everything BSD   For all discussions regarding Free/NetBSD and OpenBSD.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 04-23-2008   #1 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 7
how secure is default apache-2.2.8 + FreeBSD7?

HI,

I am running apache on my laptop at home and on my router I have forwarded ports 80 and 22. I have not yet installed php and mysql but do have some other services running, including ntp and ddclient.

How secure would my site be if I made it 'live' now, with a standard install of FreeBsd 7.0 and apache-2.2.8 ( with security updates)?

What should be my next step towards better security?

Thanks
ilnux is offline  


Reply With Quote
Old 04-23-2008   #2 (permalink)
Just Joined!
 
wildpossum's Avatar
 
Join Date: Apr 2008
Location: Sydney/Australia
Posts: 85
Send a message via Skype™ to wildpossum
1> Setup /etc/hosts.allow & /etc/hosts.deny correctly: see "man hosts -k".

2> Set up your firewall correctly. Read your documentation.

By correctly, I mean to ONLY let those domains your willing to serve have access.

3> Setup sshd.conf to disallow Type 1 connections.
sshd safety is only as good as your users passwords are set. I demand password greater than 10 char long, of mixed upper and lower case including numbers, best is, some phase that is easy for you to remember like "!!2008isMY##??__day"

Best still, is only allow a combined host & user certification/authorisation via ssh-keys.
Configure ssd.conf so that root access/authentation is disallowed. (remembering to restart the sshd to ensure the new config settings take hold).

4> Run apache as nobody, or as a user name that hasn't got a home directory. NEVER, run apache as root.

5> Ensure that NO file has global r/w access || is suid capable.

6> Make sure your root password is complex preferrably a phase with mixed upper and lower case with numeric embedded characters. As pointed out in <3>.

7> Make sure you review your syslog messages daily at a minimum.

That's a start!
wildpossum is offline   Reply With Quote
Old 04-23-2008   #3 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 7
Wow, thankyou for your detailed response! Two questions if I may,

Quote:
2> Set up your firewall correctly. Read your documentation.

By correctly, I mean to ONLY let those domains your willing to serve have access.
At the moment I have forwarded the ports to a single machine on the network, and I am using a single domain. Is that what you meant?

Quote:
4> Run apache as nobody, or as a user name that hasn't got a home directory. NEVER, run apache as root.
Does this mean instead of running apache as a daemon on startup, I should create a user without a home directory, login as that user and then start apache from the shell?
ilnux is offline   Reply With Quote
Old 04-23-2008   #4 (permalink)
Just Joined!
 
wildpossum's Avatar
 
Join Date: Apr 2008
Location: Sydney/Australia
Posts: 85
Send a message via Skype™ to wildpossum
Quote #1: I meant that you can via /etc/hosts.allow and or iptables allow only certain domains i.e.: IP addresses to access your site via SSH. or example if your running your site for everyone at 203.20.1.122 then set up /etc/hosts.allow to "sshd: 203.20.1.0/255.255.255.0 : ALLOW".

AND, check your firewall has disabled all other services other than sshd, and http/https.

Quote #2: I mean check that apache is running as "nobody" or some other username that doesn't have an account. You can see what apache is running as by looking at the apache.conf or httpd.conf file. Some older distro and some source installs would run as "apache" but some others as "root" which is a big NOno.

Hope that helps U.
See your apache documentation and "man hosts -k" for more information.
wildpossum is offline   Reply With Quote
Old 04-25-2008   #5 (permalink)
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,697
Quote:
Originally Posted by ilnux
What should be my next step towards better security?
There's really a lot you could do to lock this down further. On a very basic level I'd say you will want to allow only pubkey authentication (and disable all others) for sshd. And you may want to run apache22 in a FBSD jail. Hardening apache itself, based on your needs, is another story.

Quote:
Originally Posted by wildpossum
Setup sshd.conf to disallow Type 1 connections.
This is already done by default on a FBSD installation (only protocol 2 is allowed).

Quote:
Originally Posted by wildpossum
Run apache as nobody, or as a user name that hasn't got a home directory. NEVER, run apache as root.
If OP installed apache22 from ports, it runs as the www user.

You have three packet filtering firewall choices. They're all explained in the handbook: Chapter 28 Firewalls.
__________________
FreeBSD Handbook & FAQ // CentOS wiki
anomie is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 03:17 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2