-
Notifications
You must be signed in to change notification settings - Fork 44
API docs: clarify ICMP related. #364
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,11 +188,11 @@ type ClusterNetworkPolicyIngressRule struct { | |
| Name string `json:"name,omitempty"` | ||
|
|
||
| // Action specifies the effect this rule will have on matching | ||
| // traffic. Currently the following actions are supported: | ||
| // traffic. Currently, the following actions are supported: | ||
| // | ||
| // - Accept: Accepts the selected traffic, allowing it into | ||
| // the destination. No further ClusterNetworkPolicy or | ||
| // NetworkPolicy rules will be processed. | ||
| // - Accept: Accepts the selected traffic, including replies to that | ||
| // traffic and related ICMP traffic. No further ingress | ||
| // ClusterNetworkPolicy or NetworkPolicy rules will be processed. | ||
| // | ||
| // Note: while Accept ensures traffic is accepted by | ||
| // Kubernetes network policy, it is still possible that the | ||
|
|
@@ -245,15 +245,15 @@ type ClusterNetworkPolicyEgressRule struct { | |
| Name string `json:"name,omitempty"` | ||
|
|
||
| // Action specifies the effect this rule will have on matching | ||
| // traffic. Currently the following actions are supported: | ||
| // traffic. Currently, the following actions are supported: | ||
| // | ||
| // - Accept: Accepts the selected traffic, allowing it to | ||
| // egress. No further ClusterNetworkPolicy or NetworkPolicy | ||
| // rules will be processed. | ||
| // - Accept: Accepts the selected traffic, including replies to that | ||
| // traffic and related ICMP traffic. No further egress | ||
| // ClusterNetworkPolicy or NetworkPolicy rules will be processed | ||
| // but any ingress rules at the destination do apply. | ||
| // | ||
| // - Deny: Drops the selected traffic. No further | ||
| // ClusterNetworkPolicy or NetworkPolicy rules will be | ||
| // processed. | ||
| // - Deny: Drops the selected traffic. No further ClusterNetworkPolicy or | ||
|
Contributor
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. I recently learnt that networkpolicies when created mid way do expect to effect existing connections? so for both DENY and PASS it actually does include ICMP related as well for that connection?
Contributor
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. For |
||
| // NetworkPolicy rules will be processed. | ||
| // | ||
| // - Pass: Skips all further ClusterNetworkPolicy rules in the | ||
| // current tier for the selected traffic, and passes | ||
|
|
@@ -288,20 +288,16 @@ type ClusterNetworkPolicyEgressRule struct { | |
| type ClusterNetworkPolicyRuleAction string | ||
|
|
||
| const ( | ||
| // ClusterNetworkPolicyRuleActionAccept indicates that | ||
| // matching traffic will be accepted and no further policy | ||
| // evaluation will be done. This is a final decision. | ||
| // ClusterNetworkPolicyRuleActionAccept stops further rule processing of | ||
|
Contributor
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. hmm interesting..I am trying to find the nuance/motivation behind the change here and for the other actions..
Contributor
Author
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. Traffic from pod A to pod B goes through pod A's egress rules and pod B's ingress rules. The change was intended to hint that pod A's "egress accept" may still get blocked by pod B's ingress rules. TBH I started just trying to make the language more direct. "stops and accepts" instead of "indicates that ..." |
||
| // this policy direction (Ingress/Egress) and accepts the traffic. | ||
| ClusterNetworkPolicyRuleActionAccept ClusterNetworkPolicyRuleAction = "Accept" | ||
| // ClusterNetworkPolicyRuleActionDeny indicates that matching traffic | ||
| // will be denied and no further policy evaluation will be done. | ||
| // This is a final decision. | ||
| // ClusterNetworkPolicyRuleActionDeny stops further rule processing and | ||
| // drops the traffic. | ||
| ClusterNetworkPolicyRuleActionDeny ClusterNetworkPolicyRuleAction = "Deny" | ||
| // ClusterNetworkPolicyRuleActionPass indicates that matching traffic | ||
| // will jump to the next tier evaluation. That means that all the rules | ||
| // with lower precedence at the same tier will be ignored, | ||
| // but evaluation will continue at the next tier. | ||
| // For example, if an Admin tier CNP uses Pass action, | ||
| // NetworkPolicy evaluation will happen next. | ||
| // ClusterNetworkPolicyRuleActionPass skips rules with lower precedence in | ||
| // the current tier and continues processing in the next tier. For example, | ||
| // if an Admin tier CNP uses Pass action, NetworkPolicy evaluation will | ||
| // happen next. | ||
| ClusterNetworkPolicyRuleActionPass ClusterNetworkPolicyRuleAction = "Pass" | ||
| ) | ||
|
|
||
|
|
@@ -380,6 +376,11 @@ type ClusterNetworkPolicyEgressPeer struct { | |
| // or deny all IPv4 pod-to-pod traffic as well. If you don't want that, | ||
| // add a rule that Passes all pod traffic before the Networks rule. | ||
| // | ||
| // Networks matches both regular IP traffic and ICMP traffic to/from | ||
| // the specified CIDRs. For example, a Networks entry of "0.0.0.0/0" | ||
| // will match both IPv4 and ICMP traffic, while "::/0" will match | ||
| // both IPv6 and ICMPv6 traffic. | ||
| // | ||
| // Each item in Networks should be provided in the CIDR format and should be | ||
| // IPv4 or IPv6, for example "10.0.0.0/8" or "fd00::/8". | ||
| // | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
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.
We spoke a bit about this during AMS KubeCon,
but a note for future that since we have made this explicit we do need to consider this while designing the ICMP protocol match whether ICMP protocol match will also allow related or if its purely restricted to specific independent types and codes.
just highlighting it for history (no action required from this comment)
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.
There's some trickiness here, but I would hope that conntrack deals with it all for us.
If you allow ICMP pings, you would also have implicitly be allowing the replies to that ping, just like in the IP case.