Skip to content

Commit

Permalink
Deny additional mountpoint paths symlinked to /run
Browse files Browse the repository at this point in the history
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
  • Loading branch information
thozza committed Oct 25, 2023
1 parent de6a61b commit 151d5a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/pathpolicy/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ var MountpointPolicies = NewPathPolicies(map[string]PathPolicy{
"/boot/efi": {Deny: true},
// used by systemd / ostree
"/sysroot": {Deny: true},
// symlink to ../run which is on tmpfs
"/var/run": {Deny: true},
// symlink to ../run/lock which is on tmpfs
"/var/lock": {Deny: true},
})

// CustomDirectoriesPolicies is a set of default policies for custom directories
Expand Down
3 changes: 3 additions & 0 deletions internal/pathpolicy/policies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func TestMountpointPolicies(t *testing.T) {
{"/var", true},
{"/var/lib", true},
{"/var/log", true},
{"/var/tmp", true},
{"/var/run", false},
{"/var/lock", false},

{"/opt", true},
{"/opt/fancyapp", true},
Expand Down

0 comments on commit 151d5a9

Please sign in to comment.