I have a RHEL 6.0, and I configured pam_exec to run a custom authentication method through a bash script. If SE Linux is disabled everything works as expected, but when I enable SELinux I get a permission denied error when pam_exec tries to execute the script. How can I tell SELinux to allow this script to be executed when a user tries to log in?
/etc/pam.d/password-auth
auth sufficient pam_exec.so expose_authtok seteuid /opt/myscript.sh
audit.log
type=AVC msg=audit(1496962765.610:24707): avc: denied { execute } for pid=7476 comm="gdm-session-wor" name="myscript.sh" dev=dm-0 ino=21416 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:usr_t:s0 tclass=file