-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[docker-pmon] limit privileged flag for pmon container #23457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e4a26a6
Test with most permissions remove
DavidZagury 12239a2
Remove apparmor and systempaths restrictions
DavidZagury 4afc1d5
Fix missing dev/sda and sys/module
DavidZagury 36add0d
Add watchdogs
DavidZagury b2983ed
Fix docker_image_ctl
DavidZagury ce85c25
No need for SYS_MODULE
DavidZagury 8d4c248
Move mlx paths to only be on mlx
DavidZagury 4a69672
Remove comment
DavidZagury acd72c6
Remove sda
DavidZagury File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -684,6 +684,8 @@ start() { | |
| -v /var/log/sai_failure_dump:/var/log/sai_failure_dump:rw \ | ||
| -e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \ | ||
| {%- elif docker_container_name == "pmon" %} | ||
| -v /sys/devices/platform/mlxplat:/sys/devices/platform/mlxplat:rw \ | ||
| -v /sys/module/sx_core:/sys/module/sx_core:rw \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This path may not exist on Mellanox platform. |
||
| -v /var/run/hw-management:/var/run/hw-management:rw \ | ||
| -v mlnx_sdk_socket:/var/run/sx_sdk \ | ||
| -v /tmp/nv-syncd-shared/:/tmp \ | ||
|
|
@@ -705,6 +707,8 @@ start() { | |
| {%- endif %} | ||
| {%- if docker_container_name == "pmon" %} | ||
| -v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \ | ||
| $(if [ -e "/dev/watchdog" ]; then echo "--device=/dev/watchdog:/dev/watchdog"; fi) \ | ||
| $(for watchdog in /sys/class/watchdog/*; do if [ -d "$watchdog" ]; then device_name=$(basename "$watchdog"); dev_file="/dev/$device_name"; if [ -e "$dev_file" ]; then echo "--device=$dev_file:$dev_file"; fi; fi; done) \ | ||
| {%- endif %} | ||
| {%- if docker_container_name == "swss" %} | ||
| -e ASIC_VENDOR={{ sonic_asic_platform }} \ | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like something nVidia/MLX platform specific, while this is a templates for all vendors. I'm afraid this is not the right thing to do, can we move this to a vendor specific template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already inside
sonic_asic_platform == "mellanox"branch. The ask is to verify the critical change of removing--privilegedalso works for broadcom platform @ds952811 Could you help verify?The purpose is to reduce the privileged container usage and improve the security.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy that, thanks for the clarification