[docker-fpm-frr] limit privileged flag for bgp container#14932
Merged
StormLiangMS merged 1 commit intosonic-net:masterfrom Jul 14, 2023
Merged
[docker-fpm-frr] limit privileged flag for bgp container#14932StormLiangMS merged 1 commit intosonic-net:masterfrom
StormLiangMS merged 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Mai Bui <[email protected]>
Contributor
Author
|
/azpw run Azure.sonic-buildimage |
Collaborator
|
/AzurePipelines run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run Azure.sonic-buildimage |
Collaborator
|
/AzurePipelines run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6 tasks
qiluo-msft
approved these changes
Jun 26, 2023
abdosi
approved these changes
Jun 27, 2023
Yarden-Z
reviewed
Jul 4, 2023
|
|
||
| $(DOCKER_FPM_FRR)_CONTAINER_NAME = bgp | ||
| $(DOCKER_FPM_FRR)_RUN_OPT += --privileged -t | ||
| $(DOCKER_FPM_FRR)_RUN_OPT += -t --cap-add=NET_ADMIN --cap-add=SYS_ADMIN |
Contributor
Author
There was a problem hiding this comment.
zebra will unexpectedly exited due to missing the required capabilities.
May 2 22:36:14.048947 str-s6000-acs-10 INFO bgp#supervisord: zebra privs_init: initial cap_set_proc failed: Operation not permitted
May 2 22:36:14.049851 str-s6000-acs-10 INFO bgp#supervisord: zebra Wanted caps: cap_net_admin,cap_net_raw,cap_sys_admin=p
May 2 22:36:14.050687 str-s6000-acs-10 INFO bgp#supervisord: zebra Have caps: cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_bind_service,cap_net_admin,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap=p
May 2 22:36:14.064956 str-s6000-acs-10 INFO bgp#supervisord 2023-05-02 22:36:14,061 INFO exited: zebra (exit status 1; not expected)
Contributor
Author
|
@StormLiangMS @Yarden-Z could you help review this PR? Thanks. |
maipbui
added a commit
to sonic-net/sonic-mgmt
that referenced
this pull request
Jul 21, 2023
Description of PR HLD implementation: Container Hardening (sonic-net/SONiC#1364) Dependency: sonic-net/sonic-buildimage#14932 #### What is the motivation for this PR? Check bgp container has access to /dev/sda* or /dev/vda* after limiting privileged flag to less Linux capabilities. #### How did you do it? #### How did you verify/test it? ``` container_hardening/test_container_hardening.py::test_bgp_dev PASSED [100%] ``` Signed-off-by: Mai Bui <[email protected]>
sonic-otn
pushed a commit
to sonic-otn/sonic-buildimage
that referenced
this pull request
Sep 20, 2023
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, retain NET_ADMIN and SYS_ADMIN capabilities How to verify it Install new image to DUT, verify bgp container is up Run bgp sonic-mgmt kvmtest
AharonMalkin
pushed a commit
to AharonMalkin/sonic-mgmt
that referenced
this pull request
Jan 25, 2024
Description of PR HLD implementation: Container Hardening (sonic-net/SONiC#1364) Dependency: sonic-net/sonic-buildimage#14932 #### What is the motivation for this PR? Check bgp container has access to /dev/sda* or /dev/vda* after limiting privileged flag to less Linux capabilities. #### How did you do it? #### How did you verify/test it? ``` container_hardening/test_container_hardening.py::test_bgp_dev PASSED [100%] ``` Signed-off-by: Mai Bui <[email protected]>
11 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
HLD implementation: Container Hardening (sonic-net/SONiC#1364)
Work item tracking
How I did it
Reduce linux capabilities in privileged flag, retain NET_ADMIN and SYS_ADMIN capabilities
How to verify it
Install new image to DUT, verify bgp container is up
Run bgp sonic-mgmt kvmtest
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)