Review derived network policy rules for a container
This document (000020891) is provided subject to the disclaimer at the end of this document.
Situation
When a deployed network policy is not working as expected, reviewing the derived network rules for the specific container can reveal the fully implemented rules. The output includes the policy id, from, to, port, application, action, ingress and domain.
Resolution
Derived Rule Column Definitions:
policy_id | Policy id as reported in the Console |
from | source IP |
to | destination IP |
port | protocol and port, any equates to any combination of protocol/port |
application | layer 7 application name |
action |
check_app=action against application learn=learned rule allow=permit traffic violate=permit traffic but alert on it deny=block traffic |
ingress |
True=traffic to False=traffic from |
domain |
fqdn (IE: group with address=mail.yahoo.com will result in domain=mail.yahoo.com) |
Obtain Derived Network Rule List
Login to the CLI
# kubectl -n neuvector exec -it neuvector-manager-pod-name -- cli # #neuvector-svc-controller.neuvector> login
Obtain a list of containers and get network rules for container
# admin#neuvector-svc-controller.neuvector> show container -c <container_name_substring> # admin#neuvector-svc-controller.neuvector> show policy derived -c <container_id>
Exit CLI
# admin#neuvector-svc-controller.neuvector> logout # #neuvector-svc-controller.neuvector> exit
Example Group Policies (not real world example)
ID | From | To | Application | Ports | Action | Type |
---|---|---|---|---|---|---|
2 | nv.nginx.xnginx | yahoomail | any | tcp/997 | Allow | User created |
1 | yahoomail | nv.nginx.xnginx | NTP,SSH | tcp/2022 | Allow | User created |
10023 | Workload:ingress | nv.nginx.xnginx | HTTP | any | Allow | Learned |
Example of a derived rule list for a container with the above policies under Discover mode:
policy_id | from | to | port | application | action | ingress | domain |
2 | 192.168.243.229 | 69.147.88.7 | tcp/997 | allow | False | mail.yahoo.com | |
2 | 192.168.243.229 | 69.147.88.8 | tcp/997 | allow | False | mail.yahoo.com | |
1 | 69.147.88.7 | 192.168.243.229 | tcp/2022 | check_app | True | mail.yahoo.com | |
1 | 69.147.88.7 | 192.168.243.229 | tcp/2022 | NTP,SSH | allow | True | mail.yahoo.com |
1 | 69.147.88.8 | 192.168.243.229 | tcp/2022 | check_app | True | mail.yahoo.com | |
1 | 69.147.88.8 | 192.168.243.229 | tcp/2022 | NTP,SSH | allow | True | mail.yahoo.com |
10023 | 192.168.49.128 | 192.168.243.229 |
any | check_app | True | ||
10023 | 192.168.49.128 | 192.168.243.229 | any | HTTP | learn | True | |
10023 | 192.168.1.192 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.1.192 | 192.168.243.229 | any | HTTP | learn | True | |
10023 | 192.168.243.192 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.243.192 | 192.168.243.229 | any | HTTP | learn | True | |
10023 | 192.168.162.128 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.162.128 | 192.168.243.229 | any | HTTP | learn | True |
Example of a derived rule list for a container with the above policies under Monitor mode:
policy_id | from | to | port | application | action | ingress | domain |
2 | 192.168.243.229 | 69.147.88.7 | tcp/997 | allow | False | mail.yahoo.com | |
2 | 192.168.243.229 | 69.147.88.8 | tcp/997 | allow | False | mail.yahoo.com | |
1 | 69.147.88.7 | 192.168.243.229 | tcp/2022 | check_app | True | mail.yahoo.com | |
1 | 69.147.88.7 | 192.168.243.229 | tcp/2022 | NTP,SSH | allow | True | mail.yahoo.com |
1 | 69.147.88.8 | 192.168.243.229 | tcp/2022 | check_app | True | mail.yahoo.com | |
1 | 69.147.88.8 | 192.168.243.229 | tcp/2022 | NTP,SSH | allow | True | mail.yahoo.com |
10023 | 192.168.49.128 | 192.168.243.229 |
any | check_app | True | ||
10023 | 192.168.49.128 | 192.168.243.229 | any | HTTP | allow | True | |
10023 | 192.168.1.192 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.1.192 | 192.168.243.229 | any | HTTP | allow | True | |
10023 | 192.168.243.192 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.243.192 | 192.168.243.229 | any | HTTP | allow | True | |
10023 | 192.168.162.128 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.162.128 | 192.168.243.229 | any | HTTP | allow | True | |
0 | x.x.x.x | 192.168.243.229 | any | learn | True | ||
... | ... | ... | ... | ... | ... | ... | ... |
0 | 192.168.243.229 | 192.168.243.229 | any | violate | True |
Example of a derived rule list for a container with the above policies under Protect mode:
policy_id | from | to | port | application | action | ingress | domain |
2 | 192.168.243.229 | 69.147.88.7 | tcp/997 | allow | False | mail.yahoo.com | |
2 | 192.168.243.229 | 69.147.88.8 | tcp/997 | allow | False | mail.yahoo.com | |
1 | 69.147.88.7 | 192.168.243.229 | tcp/2022 | check_app | True | mail.yahoo.com | |
1 | 69.147.88.7 | 192.168.243.229 | tcp/2022 | NTP,SSH | allow | True | mail.yahoo.com |
1 | 69.147.88.8 | 192.168.243.229 | tcp/2022 | check_app | True | mail.yahoo.com | |
1 | 69.147.88.8 | 192.168.243.229 | tcp/2022 | NTP,SSH | allow | True | mail.yahoo.com |
10023 | 192.168.49.128 | 192.168.243.229 |
any | check_app | True | ||
10023 | 192.168.49.128 | 192.168.243.229 | any | HTTP | allow | True | |
10023 | 192.168.1.192 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.1.192 | 192.168.243.229 | any | HTTP | allow | True | |
10023 | 192.168.243.192 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.243.192 | 192.168.243.229 | any | HTTP | allow | True | |
10023 | 192.168.162.128 | 192.168.243.229 | any | check_app | True | ||
10023 | 192.168.162.128 | 192.168.243.229 | any | HTTP | allow | True | |
0 | x.x.x.x | 192.168.243.229 | any | learn | True | ||
... | ... | ... | ... | ... | ... | ... | ... |
0 | 192.168.243.229 | 192.168.243.229 | any | deny | True |
Additional Information
NOTE: Policy ID 0 is for implied rules. Under Monitor and Protect mode, the last imply rule will either violate (alert but permit traffic) or deny (block traffic).
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020891
- Creation Date: 14-Dec-2022
- Modified Date:26-Sep-2023
-
- SUSE NeuVector
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com