Welcome! Log In Create A New Profile

Advanced

Re: Nginx securiy problem

Steve
December 05, 2009 09:12PM
-------- Original-Nachricht --------
> Datum: Sat, 5 Dec 2009 19:30:27 -0500
> Von: "egerci" <nginx-forum@nginx.us>
> An: nginx@sysoev.ru
> Betreff: Re: Nginx securiy problem

> mike Wrote:
> -------------------------------------------------------
>
> > Actually, SoftLayer is quite security-focused. I
> > am a customer and
> > have been quite happy with them.
> >
> > They are doing the standard "fix your servers or
> > we'll cut you off" -
> > they're not saying security is a "tool" - they're
> > telling him that he
> > needs to hire someone they trust to fix his
> > servers up as he does not
> > seem to be equipped to, or they will shut him off.
> > It's not worth the
> > overhead they have to take on to have people who
> > don't know how to
> > manage their own servers.
>
> Yes It happened as you said. They ask me to hire that they trust.
>
> And then third party company make a report about my server : it is clean.
>
> And in their report ; they hardenned and optimized my apache and mysql
> server???
> In that server no apache and no my sql server.
> I had already used tools like rootkit tools, csf firewall etc.
> They re-install this tools and attach these tools' result to their report.
> ( I have used last version but they didn't)
>
> I had already done and make these steps.
>
> I have used Softlayer for years and I am also happy with them.
>
> The problem is giving trust/certificate to company that behave or take
> action like me!
> This show SL's understanding of Security.
>
> But it is not the topic...
>
> As you see that I am still working with softlayer.But not with SMC.
>
> > FYI: I run 0.8.x. I run the latest possible
> > version Igor puts out
> > whenever I have time to update.
>
> > As someone once told me, "Igor's betas are more
> > stable than most
> > people's stable versions" and I would have to
> > agree.
>
> Thanks for your comment. Up to now, I have used last beta versions. I
> heard something like that sentence before .
> But this time I decide to use stable version. Maybe later I will upgrade..
>
Since your attack vector does not seem to be the HTTPD I would suggest that you first start to harden your PHP installation. You said that an external company has hardened your PHP installation. Could you post your PHP configuration here? Or post a link to it?

The basic hardening stuff from PHP is not that hard. A small guide scratching the most important things can be found here:
http://www.madirish.net/?article=229

A well configured PHP and additionally something like Suhosin (http://www.hardened-php.net/suhosin/) could be a good starting point. Have a look at the configuration options -> http://www.hardened-php.net/suhosin/configuration.html <- and install it if you can. Enable for some days the simulation mode "suhosin.simulation=On" and look closely at the logs to identify potential problems and solve them before activating Suhoshin. Activate at least the basic stuff (your distro should already distribute a pre made configuration that you should use):
suhosin.simulation=On
suhosin.session.encrypt=Off
suhosin.log.syslog=511
suhosin.executor.include.max_traversal=4
suhosin.executor.disable_eval=On
suhosin.executor.disable_emodifier=On
suhosin.mail.protect=2
suhosin.sql.bailout_on_error=On

For PHP you should disable some dangerous functions. Please look up the documentation about each of them before disabling them. In your case I would at least close down the following ones:
disable_functions = "exec, passthru, pclose, popen, readfile, shell_exec, show_source, system, virtual"

If you are ultra paranoid then consider adding more of those functions that are well known to be used in malicious ways (beside the one mentioned already above)(and again here: please read in the documentation what they do before you disable them):
apache_child_terminate
apache_setenv
define_syslog_variables
escapeshellarg
escapeshellcmd
eval
fp
fput
ftp_connect
ftp_exec
ftp_get
ftp_login
ftp_nb_fput
ftp_put
ftp_raw
ftp_rawlist
highlight_file
ini_alter
ini_restore
inject_code
mysql_pconnect
openlog
phpAds_XmlRpc
phpAds_remoteInfo
phpAds_xmlrpcDecode
phpAds_xmlrpcEncode
posix_getpwuid
posix_kill
posix_mkfifo
posix_setpgid
posix_setsid
posix_setuid
posix_uname
proc_close
proc_get_status
proc_nice
proc_open
proc_terminate
syslog
xmlrpc_entity_decode

If you don't need to include/read external files then close down that functionality in PHP:
allow_url_fopen = Off
allow_url_include = Off

If you don't need upload functions then disable it:
file_uploads = Off

If you need upload functions then at least put the temporary directory for the upload into a partition that you have mounted with "nodev,nosuid,noexec":
upload_tmp_dir = /path/to/php/upload

I would as well limit the include path to be inside your web root:
open_basedir = /path/to/web/root

You probably use something like FCGI to run your PHP. Try chrooting your PHP and/or try to run it with limited uid/gid.

Implementing at least a bunch of those options should already make it much harder to exploit your setup. Read again: Harder! Not impossible!


> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
>
> Jim Ohlstein Wrote:
> -------------------------------------------------------
> > I would agree. Softlayer is an excellent host
> > which I have used on and
> > off over the years for different needs. I think
> > this is their reaction
> > to a customer for whom they cannot provide hand
> > holding services.
>
> Yes, You are right. SL is excellent host. Because of this I am still
> custommer of SL.
> But when I ask to them about my attack. They just replied me that it is
> not their job please hire third party management company.
>
> As I said above it is not the topic
>
> Thank you all
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,27636,28300#msg-28300
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx securiy problem

egerci December 03, 2009 04:22AM

Re: Nginx securiy problem

Sergej Kandyla December 03, 2009 05:46AM

Re: Nginx securiy problem

egerci December 03, 2009 07:41AM

Re: Nginx securiy problem

Piotr Sikora December 03, 2009 09:08AM

Re: Nginx securiy problem

egerci December 03, 2009 12:31PM

Re: Nginx securiy problem

Cliff Wells December 03, 2009 01:02PM

Re: Nginx securiy problem

egerci December 03, 2009 01:22PM

Re: Nginx securiy problem

Cliff Wells December 03, 2009 02:04PM

Re: Nginx securiy problem

George December 03, 2009 02:06PM

Re: Nginx securiy problem

egerci December 03, 2009 02:55PM

Re: Nginx securiy problem

mike December 03, 2009 03:42PM

Re: Nginx securiy problem

Igor Sysoev December 03, 2009 04:16PM

Re: Nginx securiy problem

mike December 03, 2009 05:06PM

Re: Nginx securiy problem

mike December 04, 2009 01:00AM

Re: Nginx securiy problem

Igor Sysoev December 04, 2009 01:00AM

Re: Nginx securiy problem

Jean-Baptiste Quenot December 05, 2009 05:02AM

Re: Nginx securiy problem

mike December 05, 2009 05:24AM

Re: Nginx securiy problem

Steve December 05, 2009 06:26AM

Re: Nginx securiy problem

mike December 05, 2009 01:32PM

Re: Nginx securiy problem

Igor Sysoev December 05, 2009 02:00PM

Re: Nginx securiy problem

Steve December 05, 2009 04:36PM

Re: Nginx securiy problem

mike December 05, 2009 05:32PM

Re: Nginx securiy problem

Steve December 05, 2009 06:46PM

Re: Nginx securiy problem

Jérôme Loyet December 05, 2009 07:12AM

Re: Nginx securiy problem

Steve December 03, 2009 06:08PM

Re: Nginx securiy problem

mike December 03, 2009 07:26PM

Re: Nginx securiy problem

Steve December 03, 2009 07:42PM

Re: Nginx securiy problem

Steve December 03, 2009 07:14PM

Re: Nginx securiy problem

egerci December 05, 2009 02:01PM

Re: Nginx securiy problem

Steve December 05, 2009 05:04PM

Re: Nginx securiy problem

mike December 05, 2009 05:16PM

Re: Nginx securiy problem

Jim Ohlstein December 05, 2009 05:34PM

Re: Nginx securiy problem

egerci December 05, 2009 07:30PM

Re: Nginx securiy problem

Steve December 05, 2009 09:12PM

Re: Nginx securiy problem

mike December 05, 2009 09:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 159
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready