[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PostgreSQL Question



>>a-w-h-i-l-e (assuming an intelligently configured filesystem).  If your swap is
>>on a SCSI controller or IDE controller connected via an ISA bus it is even
>>more fun:  All a DOS attacker has to do is churn up enough memory that a
>>contiguous block isn't available below 16M (ISA can't DMA to physical addresses 
>>above 16M) and then your swap requests just queue-up inside the kernel until it 
>>goes crunch.
>OUCH! That wouldn't be pretty!
> According to the docs at (
>http://www.postgresql.org/devel-corner/docs/admin/runtime-config.html )
>within the postgresql.conf file (which I seem to be missing) you can specify
>the following:
>*-*-*-*-*-*-*
>MAX_CONNECTIONS (integer)
>Determines how many concurrent connections the database server will allow.
>The default is 32. There is also a compiled-in hard upper limit on this
>value, which is typically 1024 (both numbers can be altered when compiling
>the server). This parameter can only be set at server start.
>*-*-*-*-*-*-*

Very cool.  Still potentially bad for machines that need to accept alot of connections.  I was thinking more of a "connection rate" limit like sendmail and xinetd have,  it's been talked about but isn't in yet.  But I suppose a RDBMS exposed to the Internet is generall a bad idea anyway.

>Theroretically in a DOS attack, this should limit the amount of traffic
>thrown at it. I'd assume Postgresql  would simply reject further connections
>attempts and hold it to the max set value. That in itself should hold some
>sort of a line on memory useage, shouldn't it?

Depends on how it's coded.  If the select procedure in the postmaster process checks to see if the limit has been exceeded before spawning a child to handle the connection then yes this basically fixes it.  If it spawns a child and then the child checks to see if the count is exceeded it doesn't do anything to solve the problem of DOS.  I'd wager it is coded the first way because the PostgreSQL guys are very smart,  but I don't know that for a fact (and at the moment don't have the source lying about to check)

>>Don't know of hand how to make pgSQL stop listening on an interface....
>   Hmmm.. If anyone knew I figured you would... Guess it's time for me to
>hunt down the PostgreSQL newsgroup  / email support list and post the
>question there.... I'll post the answer when I run across it.

Please do,  I'd like to know.

>   Any ideas on why I don't have a postgresql.conf file? I used the .rpm
>installs. I supose I could create one in /var/lib/pgsql/data and throw
>somwthing wild into it to see if PostgreSQL see it... <G>

I've never seen a postgresql.conf file.