Skip to content

Commit

Permalink
Merge pull request #4216 from jdstrand/add-explicit-deny-rule-for-tim…
Browse files Browse the repository at this point in the history
…edatctl

interfaces/time*_control: explicitly deny noisy read on /proc/1/environ
  • Loading branch information
zyga committed Nov 15, 2017
2 parents ae8660c + c386a69 commit 1e6e9ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions interfaces/builtin/time_control.go
Expand Up @@ -74,6 +74,13 @@ dbus (receive)
# set-local-rtc commands.
/usr/bin/timedatectl{,.real} ixr,
# Silence this noisy denial. systemd utilities look at /proc/1/environ to see
# if running in a container, but they will fallback gracefully. No other
# interfaces allow this denial, so no problems with silencing it for now. Note
# that allowing this triggers a 'ptrace trace peer=unconfined' denial, which we
# want to avoid.
deny @{PROC}/1/environ r,
# Allow write access to system real-time clock
# See 'man 4 rtc' for details.
Expand Down
7 changes: 7 additions & 0 deletions interfaces/builtin/timeserver_control.go
Expand Up @@ -78,6 +78,13 @@ dbus (receive)
# D-Bus method for controlling network time synchronization via
# timedatectl's set-ntp command.
/usr/bin/timedatectl{,.real} ixr,
# Silence this noisy denial. systemd utilities look at /proc/1/environ to see
# if running in a container, but they will fallback gracefully. No other
# interfaces allow this denial, so no problems with silencing it for now. Note
# that allowing this triggers a 'ptrace trace peer=unconfined' denial, which we
# want to avoid.
deny @{PROC}/1/environ r,
`

func init() {
Expand Down
7 changes: 7 additions & 0 deletions interfaces/builtin/timezone_control.go
Expand Up @@ -80,6 +80,13 @@ dbus (receive)
# D-Bus method for setting the timezone via timedatectl's set-timezone
# command.
/usr/bin/timedatectl{,.real} ixr,
# Silence this noisy denial. systemd utilities look at /proc/1/environ to see
# if running in a container, but they will fallback gracefully. No other
# interfaces allow this denial, so no problems with silencing it for now. Note
# that allowing this triggers a 'ptrace trace peer=unconfined' denial, which we
# want to avoid.
deny @{PROC}/1/environ r,
`

func init() {
Expand Down

0 comments on commit 1e6e9ee

Please sign in to comment.