Skip to content

Commit

Permalink
Merged PR 9059741: [docker-acms] limit privileged flag for acms conta…
Browse files Browse the repository at this point in the history
…iner

[docker-acms] limit privileged flag for acms container

#### Why I did it
HLD implementation: Container Hardening (sonic-net/SONiC#1364)
##### Work item tracking
- Microsoft ADO **(number only)**: 14807420

#### How I did it
Reduce linux capabilities in privileged flag

#### How to verify it
Run acms sonic-mgmt tests
Check container's settings: Privileged is false and container only has default Linux caps, does not have extended caps.
```
admin@vlab-01:~$ docker inspect acms | grep Privilege
            "Privileged": false,
admin@vlab-01:~$ docker exec -it acms bash
root@vlab-01:/# capsh --print
Current: cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_bind_service,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap=ep
```

Signed-off-by: Mai Bui <maibui@microsoft.com>
  • Loading branch information
maipbui committed Nov 13, 2023
1 parent b7cf9e4 commit ccd0cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/docker-acms.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $(DOCKER_ACMS)_VERSION = 2.0.0
$(DOCKER_ACMS)_PACKAGE_NAME = acms

$(DOCKER_ACMS)_CONTAINER_NAME = acms
$(DOCKER_ACMS)_RUN_OPT += --privileged -t
$(DOCKER_ACMS)_RUN_OPT += -t
$(DOCKER_ACMS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ACMS)_RUN_OPT += -v /etc/sonic/credentials:/etc/sonic/credentials:rw
$(DOCKER_ACMS)_RUN_OPT += -v /var/opt/msft:/var/opt/msft:rw
Expand Down

0 comments on commit ccd0cdc

Please sign in to comment.