caclmgrd interface rules patch 1#197
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
91e84f7 to
38f32c7
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
38f32c7 to
d131a47
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@ZhaohuiS Could you help review? |
scripts/caclmgrd
Outdated
| if (dst_port not in self.ACL_SERVICES["NTP"]["dst_ports"] and | ||
| dst_port not in self.ACL_SERVICES["SNMP"]["dst_ports"] and | ||
| dst_port not in self.ACL_SERVICES["SSH"]["dst_ports"]): | ||
| rule_cmd = self.exclude_mgmt_port(rule_cmd) |
There was a problem hiding this comment.
For EXTERNAL_CLIENT, there is no DST_PORT setting for it, with your change, does it mean it will block restapi or gnmi traffic from eth0?
@qiluo-msft @prsunny could you please review this change? It will prohibit traffic from eth0 except NTP,SNMP and SSH.
"EXTERNAL_CLIENT": {
"ip_protocols": ["tcp"],
"multi_asic_ns_to_host_fwd":True
},
There was a problem hiding this comment.
@ZhaohuiS We can add the protocols in ACL_SERVICES that has to go through eth0, could we have the defined list of protocols?
There was a problem hiding this comment.
As I know, EXTERNAL_CLIENT is designed to be used for restapi and gnmi, and the port is not defined in ACL_SERVICES , we can define flexible ports for them in acl.json.
There was a problem hiding this comment.
agree with @ZhaohuiS , this can break existing scenarios.
There was a problem hiding this comment.
Removed check so EXTERNAL_CLIENT is not affected; Updated tests. Please help review
There was a problem hiding this comment.
@gupurush could you please also update test case, otherwise submodule advance PR test will fail,
https://github.com/sonic-net/sonic-mgmt/blob/master/tests/cacl/test_cacl_application.py
The best solution should be:
- skip test_cacl_application from PR test
- imagebuild PR get merged
- update test case
- add test_cacl_application back for PR test
There was a problem hiding this comment.
@gupurush could you please update test_cacl_application.py to support your change in this PR? And provide the test evidence here, just want to make sure the image code change could be verified and no regression will be introduced. Thanks.
There was a problem hiding this comment.
@gupurush please update the test_cacl_application and enable it for PR test.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Aharon Malkin <amalkin@nvidia.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com> Signed-off-by: Yael Tzur <ytzur@nvidia.com>
Description of PR Summary: Fixes # (issue) sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. Disable test_cacl_application in PR test temporarily for merging submodule PR. > pytest_assert(len(missing_iptables_rules) == 0, "Missing expected iptables rules: {}" .format(repr(missing_iptables_rules))) E Failed: Missing expected iptables rules: {'-A INPUT -p tcp -m tcp --dport 179 -j ACCEPT'} For any changes in caclmgrd, if it will fail test_cacl_application case, need to follow the steps: skip test_cacl_application from PR test imagebuild PR get merged update test case add test_cacl_application back for PR test Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? sonic-net/sonic-host-services#197 added a new change for caclmgrd, PR test for submodule advanced PR of sonic-host-services failed. How did you do it? Disable test_cacl_application in PR test temporarily for merging submodule PR. How did you verify/test it? Retrigger PR test for sonic-host-services submodule advance PR. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Added management port exclusion (!, -i, eth0) for data plane protocols in iptable rules. Data plane protocols like BGP, BFD, and VXLAN are restricted to data interfaces only, while management protocols (NTP, SNMP, SSH) retain management port access. This enforces proper traffic segregation between management and data plane.
What is the motivation for this PR?
To enhance security by properly segregating management and data plane traffic through iptable rules in caclmgrd.
How did you do it?
Added exclude_mgmt_port rule (!, -i, eth0)
Applied exclusion to data plane protocols (BGP, BFD, VXLAN)
Preserved management port access for management services (NTP, SNMP, SSH)
Implemented conditional exclusion for other ACL rules based on service type