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.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > The Community > Everything BSD
Reload this Page how secure is default apache-2.2.8 + FreeBSD7?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

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

Reply
 
Thread Tools Display Modes
Old 04-23-2008   #1 (permalink)
ilnux
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)
wildpossum
Just Joined!
 
wildpossum's Avatar
 
Join Date: Apr 2008
Location: Sydney/Australia
Posts: 74
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!
__________________
Grahame
AMD Phenom(QuadCore), 8GB, 3ware RAID6 1.8TB, HD3850(512MB) ..etc.
wildpossum is offline   Reply With Quote
Old 04-23-2008   #3 (permalink)
ilnux
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)
wildpossum
Just Joined!
 
wildpossum's Avatar
 
Join Date: Apr 2008
Location: Sydney/Australia
Posts: 74
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.
__________________
Grahame
AMD Phenom(QuadCore), 8GB, 3ware RAID6 1.8TB, HD3850(512MB) ..etc.
wildpossum is offline   Reply With Quote
Old 04-25-2008   #5 (permalink)
anomie
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,699
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

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


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

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0