From: Dominick Grift <dac.override@gmail.com>
To: selinux@tycho.nsa.gov
Subject: strange pam_selinux behavior
Date: Wed, 23 Mar 2016 18:58:16 +0100 [thread overview]
Message-ID: <56F2D938.8030909@gmail.com> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
With DSSP (the mcs policy model) in Fedora i have to modify
/etc/pam.d/sshd to allow users to login with SSHD
Fedora ships with:
session required pam_selinux.so open env_params
I suspect that this "env_params" option is used to allow users to
specify the role/level to login with (ssh joe/bla.role/s0:c232@localhost
)
However the env_param option confuses pam_selinux with DSSP, and does
not allow the user to login (if i remove "env_params" then users login
just fine):
> ssh kcinimod@localhost Unable to get valid context for kcinimod
> Mar 23 18:52:38 void sshd[19512]: pam_selinux(sshd:session): Open
> Session Mar 23 18:52:38 void sshd[19512]:
> pam_selinux(sshd:session): Username= kcinimod SELinux User=
> wheel.id Level= s0-s0:c0.c1023 Mar 23 18:52:38 void sshd[19512]:
> pam_selinux(sshd:session): Selected Security Context
> wheel.id:wheel.role:wheel.subj:s0-s0:c0.c1023 Mar 23 18:52:38 void
> audit[19512]: USER_ROLE_CHANGE pid=19512 uid=0 auid=1000 ses=14
> subj=sys.id:sys.role:sshd.sshd.subj:s0 msg='pam:
> default-context=wheel.id:wheel.role: wheel.subj:s0-s0:c0.c1023
> selected-context=wheel.id:wheel.role:wheel.subj:s0-s0:c0.c1023
> exe="/usr/sbin/sshd" hostname=::1 addr=::1 terminal=ssh
> res=failed' Mar 23 18:52:38 void sshd[19512]:
> pam_selinux(sshd:session): Failed to translate security class
> context. Invalid argument Mar 23 18:52:38 void sshd[19512]:
> pam_selinux(sshd:session): Security context
> wheel.id:wheel.role:wheel.subj:s0-s0:c0.c1023 is not allowed for
> wheel.id:wheel.role:wheel.s ubj:s0-s0:c0.c1023 Mar 23 18:52:38 void
> sshd[19512]: pam_selinux(sshd:session): Unable to get valid context
> for kcinimod
This seems to be the code:
> /* we have to check that this user is allowed to go into the range
> they have specified ... role is tied to an seuser, so that'll be
> checked at setexeccon time */ if (mls_enabled &&
> !mls_range_allowed(pamh, defaultcon, newcon, debug)) {
> pam_syslog(pamh, LOG_NOTICE, "Security context %s is not allowed
> for %s", defaultcon, newcon);
>
> goto fail_set;
So what is going on here? What breaks "env_params". Without
"env_params" i can login just fine
Also note this line:
> pam_selinux(sshd:session): Security context
> wheel.id:wheel.role:wheel.subj:s0-s0:c0.c1023 is not allowed for
> wheel.id:wheel.role:wheel.s ubj:s0-s0:c0.c1023
That does not make sense to me
- --
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQGcBAEBCAAGBQJW8tk0AAoJECV0jlU3+Udp+wgL/2inFtBIsQ/Wb0cIeID8lo4a
TQPRtfYeLShDbSWn7Bf2dERrk3xRmI0W7ER83OXazduroTIpHi4o5L1ORhSbAc0z
13DVCzxR+8OfuVywmiqftJpthuJ+Gwh9xXmiy0BGwCBngHVeoBRS4UDTKoe2/VkZ
ZiDewHNMAwsw5bR5c5wbUQxW+VGn1JWjxasJPSC8MfXZTXfPZbD1/4/wyyT76u79
KnooJGtiUX0fiAODmV9rHDfuGXPJxqQkwrG3Abxf0utGuJhLxrHCDxKWAFKioVf4
lRnMU3sA5PFbq+MliSbhg693CTIyjMr6Np+8ezHsbkBFMxiSKBb7hDv+E8bTKG6e
hfVkdFSwmy7Gwv/tC6dBb6DIzexESRofORQmws8jrOdKfTI4LNFK6RLMEJJeBzox
0PNoD8eqKayXiPwGQwwWfBSfP7x3Q8giDglBQZeNNg94GyGHVlCDC4WHB6MXGm3/
Zuz7tFktBA8mjKVWi/Wzh+630KL5WERMd9VfJL/ZMw==
=ddJD
-----END PGP SIGNATURE-----
next reply other threads:[~2016-03-23 17:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 17:58 Dominick Grift [this message]
2016-03-23 18:32 ` strange pam_selinux behavior Dominick Grift
2016-03-23 18:37 ` Dominick Grift
2016-03-23 19:08 ` Stephen Smalley
2016-03-23 19:09 ` Dominick Grift
2016-03-23 19:41 ` Dominick Grift
2016-03-24 13:14 ` Miroslav Grepl
2016-03-24 13:24 ` Dominick Grift
2016-03-24 13:30 ` Miroslav Grepl
2016-03-24 14:01 ` Dominick Grift
2016-03-24 14:31 ` Dominick Grift
2016-03-24 20:42 ` Daniel J Walsh
2016-03-24 20:52 ` Dominick Grift
2016-03-25 16:02 ` Dominick Grift
2016-03-25 16:31 ` Stephen Smalley
2016-03-25 16:45 ` Dominick Grift
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56F2D938.8030909@gmail.com \
--to=dac.override@gmail.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.