Skip to content

Rework shadow transitions and access#902

Open
aerusso wants to merge 2 commits intoSELinuxProject:mainfrom
aerusso:mrs/rework-auth-shadow
Open

Rework shadow transitions and access#902
aerusso wants to merge 2 commits intoSELinuxProject:mainfrom
aerusso:mrs/rework-auth-shadow

Conversation

@aerusso
Copy link
Contributor

@aerusso aerusso commented May 10, 2025

shadow access is tightly controlled, with separate types for the shadow files and the locks. This patch distinguishes the two by enumerating the backup filenames and lock file names in their associated file transition rules.

Prior to this, the overbroad file transition rules would cause various shadow-manipulating tools to create lock files with the incorrect shadow_t label.

@aerusso aerusso force-pushed the mrs/rework-auth-shadow branch from 09199c4 to 89766d5 Compare May 10, 2025 13:23
@aerusso
Copy link
Contributor Author

aerusso commented May 10, 2025

I adjusted the rw_files_pattern macro to allow searching /etc (etc_t), and I think that's causing the lint failure. Should I just have it grant the useless dir search permission for shadow_lock_t, and expect that the etc_t search permission is granted by some other rule?

@dsugar100
Copy link
Contributor

With these changes have to tested changing a users' password (twice - due to files created after the first change)? And keep in mind that things behave differently in enforcing vs. permissive.

@aerusso aerusso force-pushed the mrs/rework-auth-shadow branch from 89766d5 to 2333d1c Compare May 19, 2025 03:09
@aerusso
Copy link
Contributor Author

aerusso commented May 19, 2025

I've also included some dpkg-specific changes, but (despite running Debian) have not tested them. This is in the final patch, and is motivated by a a read of the update-passwd.c source file.

Copy link
Member

@pebenito pebenito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see existing open comment.

@aerusso aerusso force-pushed the mrs/rework-auth-shadow branch from 2333d1c to 5ad8ee0 Compare July 19, 2025 03:54
@aerusso
Copy link
Contributor Author

aerusso commented Jul 19, 2025

I think this is in good shape, though there were a few points I was unclear on. Sorry if I'm being dense on those!

@pebenito
Copy link
Member

pebenito commented Jan 7, 2026

@aerusso are you still working on this?

There are no directories labeled shadow_lock_t, and therefore is no
reason to grant dir:search on shadow_lock_t.

Signed-off-by: Antonio Enrico Russo <aerusso@aerusso.net>
shadow access is tightly controlled, with separate types for the shadow
files and the locks.  This patch distinguishes the two by enumerating
the backup filenames and lock file names in their associated file
transition rules.

Prior to this, the overbroad file transition rules would cause various
shadow-manipulating tools to create lock files with the incorrect
shadow_t label.

Signed-off-by: Antonio Enrico Russo <aerusso@aerusso.net>
@aerusso aerusso force-pushed the mrs/rework-auth-shadow branch from 5ad8ee0 to 2e1dc55 Compare January 13, 2026 03:56
Comment on lines -735 to -739
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this block, but add (Deprecated) to the summary, since the interface still responds to the parameter.

Otherwise looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants