Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional rules for container_user_t #297

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jan 17, 2024

Fixes: most of #293

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member Author

rhatdan commented Jan 17, 2024

@bachradsusi PTAL

@bachradsusi
Copy link

----
time->Fri Jan 19 06:13:47 2024
type=AVC msg=audit(1705662827.232:594): avc:  denied  { read write } for  pid=2114 comm="sh" path="/dev/pts/0" dev="devpts" ino=3 scontext=container_user_u:container_user_r:container_user_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:container_devpts_t:s0 tclass=chr_file permissive=1
----
time->Fri Jan 19 06:13:47 2024
type=AVC msg=audit(1705662827.233:595): avc:  denied  { ioctl } for  pid=2114 comm="sh" path="/dev/pts/0" dev="devpts" ino=3 ioctlcmd=0x5401 scontext=container_user_u:container_user_r:container_user_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:container_devpts_t:s0 tclass=chr_file permissive=1

@bachradsusi
Copy link

It works with this change:

diff --git a/container.te b/container.te
index 51c55a5..109f81c 100644
--- a/container.te
+++ b/container.te
@@ -703,6 +703,7 @@ optional_policy(`
        gen_require(`
                role unconfined_r;
        ')
+       allow unconfined_r container_user_r;
        role unconfined_r types container_user_domain;
        role unconfined_r types spc_t;
        unconfined_domain(container_runtime_t)
@@ -1560,3 +1561,5 @@ tunable_policy(`deny_ptrace',`',`
        allow container_domain self:process ptrace;
        allow spc_t self:process ptrace;
 ')
+
+allow container_user_t container_devpts_t:chr_file { ioctl read write };

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@bachradsusi
Copy link

👍🏻

@rhatdan rhatdan merged commit eac5792 into containers:main Jan 22, 2024
25 checks passed
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.

None yet

2 participants