Skip to content

Commit

Permalink
Run portlayer as un-privileged user
Browse files Browse the repository at this point in the history
Start portlayer process with vicadmin user and give capabilities of
mounting disks and binding a port less than 1024.
  • Loading branch information
DanielXiao committed Jan 4, 2019
1 parent 68968ce commit 0dbc953
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion isos/appliance/permissions-setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

# Allow access to VM uuid for self-reflection
chmod 444 /sys/devices/virtual/dmi/id/product_serial
chmod 444 /sys/class/dmi/id/product_serial
chmod 444 /sys/class/dmi/id/product_serial

# Give port-layer capabilities to mount image disks and bind 53 port
setcap cap_net_bind_service,cap_sys_admin=+ep /sbin/port-layer-server
2 changes: 2 additions & 0 deletions lib/install/management/appliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,8 @@ func (d *Dispatcher) createAppliance(conf *config.VirtualContainerHostConfigSpec
)

cfg := &executor.SessionConfig{
User: "vicadmin",
Group: "vicadmin",
Cmd: executor.Cmd{
Path: "/sbin/port-layer-server",
Args: []string{
Expand Down

0 comments on commit 0dbc953

Please sign in to comment.