LX0-104 · Question #388
An unprivileged user issued a command which produced the following log message: avc: denied { getattr } for pid=984 exe=/usr/bin/vim path=/etc/shadow dev=03:01 ino=134343 scontext=hugh:user_r:user_t t
The correct answer is A. User hugh was not running in a security context that permitted reading the file.. The SELinux AVC denial message indicates that the user hugh, operating under the user_t domain, was denied permission to perform the getattr operation on the /etc/shadow file, which has the shadow_t type.
Question
Options
- AUser hugh was not running in a security context that permitted reading the file.
- BUser hugh only needs to switch to the object_r role in order to edit /etc/shadow.
- CThe security context for hugh is misconfigured and needs access to read any system file.
- DUser hugh was not running in a security context that permitted writing to the file.
How the community answered
(32 responses)- A66% (21)
- B19% (6)
- C9% (3)
- D6% (2)
Why each option
The SELinux AVC denial message indicates that the user `hugh`, operating under the `user_t` domain, was denied permission to perform the `getattr` operation on the `/etc/shadow` file, which has the `shadow_t` type.
The `getattr` permission in SELinux refers to retrieving file attributes, which includes reading metadata and often implies an attempt to access or read the file itself. The denial shows that the source context (`scontext=hugh:user_r:user_t`) lacked the necessary permissions to perform this operation on the target file (`tcontext=system_u:object_r:shadow_t`), thus preventing access.
`object_r` is a role for objects (files), not a role for users to switch into; user roles are like `user_r`, `sysadm_r`.
While `hugh`'s context prevented access, the message doesn't inherently imply misconfiguration or a need for broad system file access; it's a standard SELinux access control enforcement.
The denied operation is `getattr` (get attributes), not `write`, which would be explicitly listed as `write` or similar operations if write access was denied.
Concept tested: Interpreting SELinux AVC denial messages
Source: https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/selinux/SELinux_Troubleshooting/#Troubleshooting_SELinux_Denials_Troubleshooting_SELinux_Denials
Topics
Community Discussion
No community discussion yet for this question.