-
Notifications
You must be signed in to change notification settings - Fork 469
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
nflog the packet that will be dropped by network policy enforcement #889
Conversation
that can be further by read by ulogd Fixes #505
@@ -817,6 +817,14 @@ func (npc *NetworkPolicyController) syncPodFirewallChains(version string) (map[s | |||
} | |||
} | |||
|
|||
// add rule to log the packets that will be droopped due to network policy enforcement | |||
comment = "rule to log dropped traffic POD name:" + pod.name + " namespace: " + pod.namespace |
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.
comment = "rule to log dropped traffic POD name:" + pod.name + " namespace: " + pod.namespace | |
comment = "rule to log dropped traffic to POD name:" + pod.name + " namespace: " + pod.namespace |
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.
@mrueg thanks for the review. I started with same but actually a only a single IPtable rule gets created so unfortunaltye can not add to/from. Resolved other comment
@@ -933,6 +941,14 @@ func (npc *NetworkPolicyController) syncPodFirewallChains(version string) (map[s | |||
} | |||
} | |||
|
|||
// add rule to log the packets that will be droopped due to network policy enforcement | |||
comment = "rule to log dropped traffic POD name:" + pod.name + " namespace: " + pod.namespace |
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.
comment = "rule to log dropped traffic POD name:" + pod.name + " namespace: " + pod.namespace | |
comment = "rule to log dropped traffic from POD name:" + pod.name + " namespace: " + pod.namespace |
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.
Overall good direction. Do you have any thoughts on how users can best run ulogd? Maybe a ulogd container (I'm assuming it can be run from within a container) with example config snippet?
@aauren Thank for the review. I will add an e.g in usage guide on how to enable loggiging. For more convenience we can log in kube-router logs as well by doing like this |
…loudnativelabs#889) * nflog the packet that will be dropped by network policy enforcement that can be further by read by ulogd Fixes cloudnativelabs#505 * addressing review comments
…loudnativelabs#889) * nflog the packet that will be dropped by network policy enforcement that can be further by read by ulogd Fixes cloudnativelabs#505 * addressing review comments
logged packets can be further by read by ulogd
Fix only works with kernel > 4.11 please see #505 (comment)
Fixes #505