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
data/selinux, test/main/selinux-clean: update the test to cover more scenarios #7978
data/selinux, test/main/selinux-clean: update the test to cover more scenarios #7978
Conversation
After investigating a number of SELinux policy bug reports in RHBZ, it's clear that the test does not cover most of the typical usage patterns. Extend the test to cover more scenarios. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Pole holes for: - automatic copy of snapd data done by snapd, where cp is invoked by snapd (as system_u) but acts on user objects (unconfined_u) - layout updates triggered by snapd - mounting on top of bin_t for pulling snapd libexecdir from the host into the snap - acting on snappy_tmp_t, with auto transition from tmp_t and user_tmp_t Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1778180 (and dupes) Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1731498 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1729017 Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonably sane to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for chasing those issues! One small remark.
data/selinux/snappy.te
Outdated
admin_pattern(snappy_mount_t, snappy_tmp_t) | ||
# FIXME: investigate further why transition from user_tmp_t to snappy_tmp_t may | ||
# not happen | ||
# should we still end up with user_tmp_t allow acting on it too allow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/too/to/?
Is this refering a known RHBZ bug? If so, could you link it?
su test -c "test-snapd-desktop.cmd sh -c 'echo hello world'" | ||
su test -c "test-snapd-desktop.cmd sh -c 'mkdir \$HOME/foo && echo foo > \$HOME/foo/bar'" | ||
ausearch -i --checkpoint stamp --start checkpoint -m AVC 2>&1 | MATCH 'no matches' | ||
# another revision triggers copy of snap data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the test!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for chasing this! I'm not sure I get all the subtleties in the policy update though.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
After investigating a number of SELinux policy bug reports in RHBZ, it's clear
that the test does not cover most of the typical usage patterns. Extend the test
to cover more scenarios.
Policy update is WIP and will be pushed to the PR
cc @Conan-Kudo