Added CACL entry for Redfish#380
Open
shreyansh-nexthop wants to merge 1 commit into
Open
Conversation
Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
The Redfish docker on the BMC binds host port
0.0.0.0:443:18080(as per the docker-sonic-redfish rules in sonic-buildimage), so any IP that can reach the BMC's management interface on TCP/443 can hit the Redfish API.caclmgrdonly emits iptables rules for services that are registered in itsACL_SERVICESdict. Without an entry for REDFISH, any operator-defined ACL_TABLE referencing it is silently dropped with a syslog warning ("unrecognized service") i.e. the framework has no way to translate the operator's intent into iptables rules. This patch adds that registration.How I did it
Added a single entry to ACL_SERVICES in scripts/caclmgrd, mirroring the existing SSH/SNMP/NTP entries:
How to verify it
Confirm the entry shipped:
sudo grep -A4 '"REDFISH"' /usr/local/bin/caclmgrdConfigure a CTRLPLANE ACL via CONFIG_DB
Confirm caclmgrd translated them into iptables:
Confirm enforcement:
From the allowed source
curl -k -u bmcweb:bmcweb https://<bmc-ip>/redfish/v1# → 200From a non-allowed source
curl -k --max-time 5 -u bmcweb:bmcweb https://<bmc-ip>/redfish/v1# → connection refused / timeoutRemove rules if not needed: