Victor Hooi writes:
> [...]
>
> I created a blank PostgreSQL database as myself ("victorhooi").
>
> I ran ./manage.py syncdb, and this seemed to authenticate fine,
> and create all the required tables.
>
> When I try to go to http://site.com/admin though, I get an error:
>
> OperationalError at /admin/
> FATAL: Ident authentication failed for user "victorhooi"
Does the webserver also run as victorhooi? Maybe it runs as
www-data for example.
Tsch�,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten...@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com
in pg_hba.conf change the authorisation from ident to password
--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
Victor Hooi writes:
> [...]
>
> However, I'm still curious as to what changed, as I'm fairly sure
> this setup worked on the old Ubuntu 9.04 server? And I'm
> definitely sure that the database username was set to "victorhooi"
> on that old system - I copied the settings.py file over using
> verbatim (rsync).
Maybe pg_hba.conf has changed.
> Also, is this recommended practice, to use "www-data" as the
> backend database username?
No, not recommended, but not forbidden either. We didn't use
"ident" but "password" in pg_hba.conf. This way, you are not bound
to user accounts of the underlying operating system.
But possibly we switch to "ident" for local connections
(i.e. command line) and "password" for TCP/IP connections. The
reason is that passwords make command line scripting harder.
Tsch�,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten...@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com
should be forbidden - one does not want apache to have direct access to the
database
default always has ident in all distros that I am aware of
Storing a password in plaintext file makes me uneasy, even though it
is locked away through file-system permissions.
Having spent some time recently in the Windows world, I take
integrated auth for granted, and it works fine, making sysadmin much
easier.
You do bring up a interesting point though, and I don't know much
about the architecture of Apache and how holes are exploited when they
exist, but if the trespasser can execute arbitary code as www-data,
wouldn't they have access to settings.py anyway?
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>
and a single point of entry to all systems for a cracker
>
> You do bring up a interesting point though, and I don't know much
> about the architecture of Apache and how holes are exploited when they
> exist, but if the trespasser can execute arbitary code as www-data,
> wouldn't they have access to settings.py anyway?
>
and just to add to your worries, assuming that you have debug on in your
production system, somewhere deep down in the traceback, you may see your
database username and password! As for the apache question there are experts
in this list who can anwer them.
I'm not running them all as admin (aka. root) obviously. Integrated
auth doesn't mean every user account can access every resource. It's
really just delegating an application's authentication system to the
operating system (note authentication, not authorization).
I fail to see how it is a single-point of entry to all systems. Yes,
it means there's one less layer of security, but that extra layer
provided by the DBMS isn't security anyway if as that OS user, you can
access the password to get past that extra layer of security anyway. I
don't believe this is an implementation of defense in depth.
>> You do bring up a interesting point though, and I don't know much
>> about the architecture of Apache and how holes are exploited when they
>> exist, but if the trespasser can execute arbitary code as www-data,
>> wouldn't they have access to settings.py anyway?
>>
>
> and just to add to your worries, assuming that you have debug on in your
> production system, somewhere deep down in the traceback, you may see your
> database username and password! As for the apache question there are experts
> in this list who can anwer them.
Thanks for mocking what was and still is a serious point.
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC
>
I am no expert on windows, so cannot comment.
>
> >> You do bring up a interesting point though, and I don't know much
> >> about the architecture of Apache and how holes are exploited when they
> >> exist, but if the trespasser can execute arbitary code as www-data,
> >> wouldn't they have access to settings.py anyway?
> >
> > and just to add to your worries, assuming that you have debug on in your
> > production system, somewhere deep down in the traceback, you may see your
> > database username and password! As for the apache question there are
> > experts in this list who can anwer them.
>
> Thanks for mocking what was and still is a serious point.
>
I am sorry if you feel I was mocking - it was not my intention. And the point
you were bringing up about Apache is a vast subject and I am not competent to
answer it. As for the debug thing, it is just a warning not to run debug in
production.
Ah I must've interpreted it incorrectly, I apologise. I'm definitely
no expert on *nix and Apache security, so I'd appreciate it if anyone
could clarify as well.
From the PGSQL docs [1],
"On systems supporting SO_PEERCRED requests for Unix-domain sockets
(currently Linux, FreeBSD, NetBSD, OpenBSD, BSD/OS, and Solaris),
ident authentication can also be applied to local connections. In this
case, no security risk is added by using ident authentication; indeed
it is a preferable choice for local connections on such systems."
http://www.postgresql.org/docs/current/static/auth-methods.html
So it seems the postgresql people think it is ok, but I'm not sure
once you add in Apache and things like Django on top of it.
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC
>
I am not too sure whether connection over tcp/ip comes under 'local'