Bug 1468095 - SELinux is preventing postgres from 'remove_name' accesses on the directory postmaster.pid.
Summary: SELinux is preventing postgres from 'remove_name' accesses on the directory p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:04cddfb499d6b993e42150a7b1f...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-06 03:20 UTC by Victor Arenas
Modified: 2017-11-01 16:38 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.13.1-225.20.fc25 selinux-policy-3.13.1-225.22.fc25 selinux-policy-3.13.1-225.23.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-01 16:38:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: Dockerfile (643 bytes, text/plain)
2017-07-06 03:20 UTC, Victor Arenas
no flags Details
File: docker-compose.yml (1.00 KB, text/plain)
2017-07-06 03:20 UTC, Victor Arenas
no flags Details
File: requirements.txt (82 bytes, text/plain)
2017-07-06 03:20 UTC, Victor Arenas
no flags Details

Description Victor Arenas 2017-07-06 03:20:37 UTC
Description of problem:
im executing a docker-compose with odoo 8 and postgres 9.4
SELinux is preventing postgres from 'remove_name' accesses on the directory postmaster.pid.

*****  Plugin catchall (100. confidence) suggests   **************************

If cree que de manera predeterminada, postgres debería permitir acceso remove_name sobre postmaster.pid directory.     
Then debería reportar esto como un error.
Puede generar un módulo de política local para permitir este acceso.
Do
allow this access for now by executing:
# ausearch -c 'postgres' --raw | audit2allow -M my-postgres
# semodule -X 300 -i my-postgres.pp

Additional Information:
Source Context                system_u:system_r:container_t:s0:c32,c625
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                postmaster.pid [ dir ]
Source                        postgres
Source Path                   postgres
Port                          <Desconocido>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.18.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.11.8-200.fc25.x86_64 #1 SMP Thu
                              Jun 29 16:13:56 UTC 2017 x86_64 x86_64
Alert Count                   2
First Seen                    2017-07-05 23:08:36 -04
Last Seen                     2017-07-05 23:11:01 -04
Local ID                      9c136dd9-57cc-4b7b-a492-94ac8a7ef13a

Raw Audit Messages
type=AVC msg=audit(1499310661.698:1109): avc:  denied  { remove_name } for  pid=13618 comm="postgres" name="postmaster.pid" dev="sda9" ino=5896 scontext=system_u:system_r:container_t:s0:c32,c625 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=1


Hash: postgres,container_t,user_home_t,dir,remove_name

Version-Release number of selected component:
selinux-policy-3.13.1-225.18.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.11.8-200.fc25.x86_64
type:           libreport

Comment 1 Victor Arenas 2017-07-06 03:20:44 UTC
Created attachment 1294789 [details]
File: Dockerfile

Comment 2 Victor Arenas 2017-07-06 03:20:46 UTC
Created attachment 1294790 [details]
File: docker-compose.yml

Comment 3 Victor Arenas 2017-07-06 03:20:48 UTC
Created attachment 1294791 [details]
File: requirements.txt

Comment 4 Daniel Walsh 2017-07-06 11:14:50 UTC
This looks like you are volume mounting in content from your homedir into the container.

These volume directories need to have the correct SELinux labels applied to them to be used within the containers.
            - ~/Documentos/odoo/test-addons:/mnt/extra-addons/
            - ~/Documentos/odoo/conf:/etc/odoo/
            - /var/log/odoo:/var/log/odoo/


Adding :Z to the end should vix the labels


            - ~/Documentos/odoo/test-addons:/mnt/extra-addons/:Z
            - ~/Documentos/odoo/conf:/etc/odoo/:Z
            - /var/log/odoo:/var/log/odoo/:Z


http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/

Comment 5 Fedora Update System 2017-08-14 15:20:44 UTC
selinux-policy-3.13.1-225.20.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-837f04c39a

Comment 6 Fedora Update System 2017-08-15 03:50:23 UTC
selinux-policy-3.13.1-225.20.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-837f04c39a

Comment 7 Fedora Update System 2017-08-27 06:21:23 UTC
selinux-policy-3.13.1-225.20.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2017-09-01 09:34:00 UTC
selinux-policy-3.13.1-225.22.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-5d4f3635ee

Comment 9 Fedora Update System 2017-09-03 06:24:17 UTC
selinux-policy-3.13.1-225.22.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5d4f3635ee

Comment 10 Fedora Update System 2017-09-07 23:19:39 UTC
selinux-policy-3.13.1-225.22.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2017-10-10 11:59:33 UTC
selinux-policy-3.13.1-225.23.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4d00e4db6a

Comment 12 Fedora Update System 2017-10-11 04:21:33 UTC
selinux-policy-3.13.1-225.23.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4d00e4db6a

Comment 13 Fedora Update System 2017-11-01 16:38:39 UTC
selinux-policy-3.13.1-225.23.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.