Fedora Linux Support Community & Resources Center

Sections ›› Home | Forums | Guidelines | Forum Help | Fedora FAQ | Fedora News 

Go Back   FedoraForum.org > Fedora Support > Archived > gmane.linux.redhat.fedora.general

gmane.linux.redhat.fedora.general gmane.linux.redhat.fedora.general newsgroup archive.

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2006-07-03, 03:40 PM CDT
Clodoaldo Pinto
Guest
 
Posts: n/a
FC5 SELinux prevents php from connecting to postgresql

FC5 SELinux prevents php from connecting to postgresql.

I had a hard time trying to figure out why I could not connect from
php to postgres locally in a new and patched FC5 box, although I could
connect to that same postgres server and with the same user from
another box (FC3).

>From /var/log/messages:


kernel: audit(1151945653.900:39): avc: denied { name_connect } for
pid=17167 comm="httpd" dest=5432 scontext=user_u:system_r:httpd_t:s0
tcontext=system_u:object_rostgresql_port_t:s0 tclass=tcp_socket

Regards, Clodoaldo Pinto

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

  #2  
Old 2006-07-04, 12:50 AM CDT
Paul Howarth
Guest
 
Posts: n/a
Re: FC5 SELinux prevents php from connecting to postgresql

On Mon, 2006-07-03 at 18:35 -0300, Clodoaldo Pinto wrote:
> FC5 SELinux prevents php from connecting to postgresql.
>
> I had a hard time trying to figure out why I could not connect from
> php to postgres locally in a new and patched FC5 box, although I could
> connect to that same postgres server and with the same user from
> another box (FC3).
>
> >From /var/log/messages:

>
> kernel: audit(1151945653.900:39): avc: denied { name_connect } for
> pid=17167 comm="httpd" dest=5432 scontext=user_u:system_r:httpd_t:s0
> tcontext=system_u:object_rostgresql_port_t:s0 tclass=tcp_socket


Try:
# setsebool -P httpd_can_network_connect_db 1

Paul.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

  #3  
Old 2006-07-04, 05:40 AM CDT
Clodoaldo Pinto
Guest
 
Posts: n/a
Re: FC5 SELinux prevents php from connecting to postgresql

2006/7/4, Paul Howarth <paul@city-fan.org>:
> On Mon, 2006-07-03 at 18:35 -0300, Clodoaldo Pinto wrote:
> > FC5 SELinux prevents php from connecting to postgresql.
> >
> > I had a hard time trying to figure out why I could not connect from
> > php to postgres locally in a new and patched FC5 box, although I could
> > connect to that same postgres server and with the same user from
> > another box (FC3).
> >
> > >From /var/log/messages:

> >
> > kernel: audit(1151945653.900:39): avc: denied { name_connect } for
> > pid=17167 comm="httpd" dest=5432 scontext=user_u:system_r:httpd_t:s0
> > tcontext=system_u:object_rostgresql_port_t:s0 tclass=tcp_socket

>
> Try:
> # setsebool -P httpd_can_network_connect_db 1


Thank you Paul. I had already solved it when I posted using the
instructions here:
http://fedora.redhat.com/docs/selinu...fc5/#id2961385

Your suggestion seems much simpler. Is it permanent? Where can a
SEBolls list be found?

I just posted this to alert others who could fall in the same problem.
BTW, why is httpd prevented to connect to postgres (the only db I
tested until now) as default? Is it a bug?

Regards, Clodoaldo Pinto

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

  #4  
Old 2006-07-04, 05:50 AM CDT
Paul Howarth
Guest
 
Posts: n/a
Re: FC5 SELinux prevents php from connecting to postgresql

Clodoaldo Pinto wrote:
> 2006/7/4, Paul Howarth <paul@city-fan.org>:
>> On Mon, 2006-07-03 at 18:35 -0300, Clodoaldo Pinto wrote:
>> > FC5 SELinux prevents php from connecting to postgresql.
>> >
>> > I had a hard time trying to figure out why I could not connect from
>> > php to postgres locally in a new and patched FC5 box, although I could
>> > connect to that same postgres server and with the same user from
>> > another box (FC3).
>> >
>> > >From /var/log/messages:
>> >
>> > kernel: audit(1151945653.900:39): avc: denied { name_connect } for
>> > pid=17167 comm="httpd" dest=5432 scontext=user_u:system_r:httpd_t:s0
>> > tcontext=system_u:object_rostgresql_port_t:s0 tclass=tcp_socket

>>
>> Try:
>> # setsebool -P httpd_can_network_connect_db 1

>
> Thank you Paul. I had already solved it when I posted using the
> instructions here:
> http://fedora.redhat.com/docs/selinu...fc5/#id2961385


That's a general technique applicable to just about all SELinux issues.
Some of the more common ones, such as connecting to databases over the
network, can be addressed by setting booleans as it's already catered
for in the policy.

> Your suggestion seems much simpler. Is it permanent?


Yes, the "-P" option is for a permanent change.

> Where can a SEBolls list be found?


Some are documented in the manpage "httpd_selinux". You can get a full
list using:

# getsebool -a

> I just posted this to alert others who could fall in the same problem.
> BTW, why is httpd prevented to connect to postgres (the only db I
> tested until now) as default? Is it a bug?


No, it's not a bug. The default SELinux policy locks down the web server
to allow just basic operation, with additional features (such as
scripting, making outgoing network connections, connecting to databases
etc.) being enabled by setting booleans. This is just good security
practice.

Paul.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

  #5  
Old 2006-07-04, 06:10 AM CDT
Rahul Sundaram
Guest
 
Posts: n/a
Re: FC5 SELinux prevents php from connecting to postgresql

Paul Howarth wrote:

> Clodoaldo Pinto wrote:
>
>> 2006/7/4, Paul Howarth <paul@city-fan.org>:
>>
>>> On Mon, 2006-07-03 at 18:35 -0300, Clodoaldo Pinto wrote:
>>> > FC5 SELinux prevents php from connecting to postgresql.
>>> >
>>> > I had a hard time trying to figure out why I could not connect from
>>> > php to postgres locally in a new and patched FC5 box, although I
>>> could
>>> > connect to that same postgres server and with the same user from
>>> > another box (FC3).
>>> >
>>> > >From /var/log/messages:
>>> >
>>> > kernel: audit(1151945653.900:39): avc: denied { name_connect } for
>>> > pid=17167 comm="httpd" dest=5432 scontext=user_u:system_r:httpd_t:s0
>>> > tcontext=system_u:object_rostgresql_port_t:s0 tclass=tcp_socket
>>>
>>> Try:
>>> # setsebool -P httpd_can_network_connect_db 1

>>
>>
>> Thank you Paul. I had already solved it when I posted using the
>> instructions here:
>> http://fedora.redhat.com/docs/selinu...fc5/#id2961385

>
>
> That's a general technique applicable to just about all SELinux
> issues. Some of the more common ones, such as connecting to databases
> over the network, can be addressed by setting booleans as it's already
> catered for in the policy.


Yes. Booleans should have been referred to in that FAQ as the first
thing to look at. I filed a report.

https://bugzilla.redhat.com/bugzilla....cgi?id=197587

Rahul

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

  #6  
Old 2006-07-04, 08:00 PM CDT
Florin Andrei
Guest
 
Posts: n/a
Re: FC5 SELinux prevents php from connecting to postgresql

On Tue, 2006-07-04 at 08:33 -0300, Clodoaldo Pinto wrote:
> 2006/7/4, Paul Howarth <paul@city-fan.org>:
> > Try:
> > # setsebool -P httpd_can_network_connect_db 1

>
> Thank you Paul. I had already solved it when I posted using the
> instructions here:
> http://fedora.redhat.com/docs/selinu...fc5/#id2961385


Why do all that stuff when the boolean is already there and it does
precisely the job required?

For a list of all booleans:

getsebool -a

--
Florin Andrei

http://florin.myip.org/

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selinux prevents wireless connection relayer Networking 0 2009-01-24 01:18 PM CST
SELinux prevents login after FC9 upgrade jak56 Security 2 2008-06-19 05:04 PM CDT
SELinux prevents logwatch email cwebster Security 4 2008-06-03 12:44 PM CDT
SELinux prevents Squirrelmail from sending termdex Security 1 2006-08-02 05:21 AM CDT
Selinux prevents external usb drive from mounting in FC5 fire-fly Installation Help 1 2006-04-25 07:36 AM CDT

Automatic Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Yiddish

All times are GMT -7. The time now is 11:11 AM CST.

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo



All trademarks, and forum posts in this site are property of their respective owner(s).

FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact | Founding Members
Designed By Ewdison Then | Powered by vBulletin ©2000-2009, Jelsoft Enterprises Ltd.
FedoraForum is Powered by Open Source Projects and Products
Translations delivered by vBET 2.3.8