-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two new build options, 'user' and 'group' can be used to configure a non-root user account to run the system yggdrasil service. The value of both of these options default to 'yggdrasil'. This value is used to customize the D-Bus policy, systemd unit User= and Group= directive values, and a systemd-sysuser template. Signed-off-by: Link Dupont <[email protected]>
- Loading branch information
1 parent
0691bf1
commit 16fec57
Showing
19 changed files
with
139 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "https://dbus.freedesktop.org/doc/busconfig.dtd"> | ||
<busconfig> | ||
<policy user="@user@"> | ||
<!-- Only @user@ can own the Yggdrasil1 destination name. --> | ||
<allow own="com.redhat.Yggdrasil1" /> | ||
|
||
<!-- Only @user@ can own the Dispatcher1 destination name. --> | ||
<allow own="com.redhat.Yggdrasil1.Dispatcher1" /> | ||
</policy> | ||
|
||
<policy group="@worker_user@"> | ||
<!-- Only members of the @worker_user@ group can send messages to | ||
Dispatcher1 destination. --> | ||
<allow send_destination="com.redhat.Yggdrasil1.Dispatcher1" /> | ||
</policy> | ||
|
||
<policy context="default"> | ||
<!-- Anyone can send messages to the Yggdrasil1 destination. --> | ||
<allow send_destination="com.redhat.Yggdrasil1" /> | ||
</policy> | ||
</busconfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
subdir('system') | ||
subdir('user') | ||
|
||
systemd_sysusers_dir = systemd.get_variable(pkgconfig: 'sysusersdir') | ||
|
||
configure_file( | ||
configuration: config_data, | ||
input: 'yggdrasil-sysuser.conf.in', | ||
output: 'yggdrasil.conf', | ||
install: true, | ||
install_dir: systemd_sysusers_dir, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#Type Name ID GECOS Home directory Shell | ||
u @user@ - "yggdrasil system user" @sharedstatedir@/yggdrasil - | ||
u @worker_user@ - "yggdrasil worker user" - - | ||
m @user@ @worker_user@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
worker/echo/dbus/com.redhat.Yggdrasil1.Worker1.echo.conf.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "https://dbus.freedesktop.org/doc/busconfig.dtd"> | ||
<busconfig> | ||
<policy user="@worker_user@"> | ||
<!-- Only @worker_user@ can own the Worker1.echo name. --> | ||
<allow own="com.redhat.Yggdrasil1.Worker1.echo" /> | ||
|
||
<!-- Only @worker_user@ can send messages to the Worker1 interface. --> | ||
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" | ||
send_interface="com.redhat.Yggdrasil1.Worker1" /> | ||
|
||
<!-- Only @worker_user@ can send messages to the Properties interface. --> | ||
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" | ||
send_interface="org.freedesktop.DBus.Properties" /> | ||
|
||
<!-- Only @worker_user@ can send messages to the Introspectable interface. --> | ||
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" | ||
send_interface="org.freedesktop.DBus.Introspectable" /> | ||
|
||
<!-- Only @worker_user@ can send messages to the Peer interface. --> | ||
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" | ||
send_interface="org.freedesktop.DBus.Peer" /> | ||
</policy> | ||
</busconfig> |
1 change: 0 additions & 1 deletion
1
...redhat.Yggdrasil1.Worker1.echo.service.in → ...redhat.Yggdrasil1.Worker1.echo.service.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[D-BUS Service] | ||
Name=com.redhat.Yggdrasil1.Worker1.echo | ||
User=root | ||
Exec=@libexecdir@/yggdrasil/echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
configure_file( | ||
configuration: config_data, | ||
input: 'com.redhat.Yggdrasil1.Worker1.echo.service.in', | ||
output: '@BASENAME@', | ||
install: true, | ||
install_dir: dbus.get_variable(pkgconfig: 'system_bus_services_dir') | ||
) | ||
|
||
configure_file( | ||
configuration: config_data, | ||
input: 'com.redhat.Yggdrasil1.Worker1.echo.conf.in', | ||
output: '@BASENAME@', | ||
install: true, | ||
install_dir: join_paths(dbus.get_variable(pkgconfig: 'datadir'), 'dbus-1', 'system.d') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
worker/echo/systemd/com.redhat.Yggdrasil1.Worker1.echo.service.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=yggdrasil echo worker service | ||
Documentation=https://github.com/RedHatInsights/yggdrasil | ||
|
||
[Service] | ||
Type=dbus | ||
User=@worker_user@ | ||
Group=@worker_user@ | ||
ExecStart=@libexecdir@/yggdrasil/echo | ||
BusName=com.redhat.Yggdrasil1.Worker1.echo | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
systemd_system_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir') | ||
|
||
configure_file( | ||
configuration: config_data, | ||
input: 'com.redhat.Yggdrasil1.Worker1.echo.service.in', | ||
output: '@BASENAME@', | ||
install: true, | ||
install_dir: systemd_system_unit_dir, | ||
) |