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

data/selinux, test/main/selinux-clean: update the test to cover more scenarios #7978

Merged
merged 3 commits into from Jan 13, 2020

Conversation

bboozzoo
Copy link
Collaborator

@bboozzoo bboozzoo commented Jan 9, 2020

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

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>
Copy link
Contributor

@Conan-Kudo Conan-Kudo left a 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.

Copy link
Contributor

@stolowski stolowski left a 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.

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
Copy link
Contributor

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
Copy link
Contributor

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!

Copy link
Contributor

@mvo5 mvo5 left a 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>
@mvo5 mvo5 merged commit 196f178 into snapcore:master Jan 13, 2020
@bboozzoo bboozzoo added this to the 2.43 milestone Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants