-
Notifications
You must be signed in to change notification settings - Fork 286
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
Whitelist failsafe port response traffic in the raw table only #1718
Conversation
This should ensure that failsafe traffic always gets conntracked.
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.
Just a few nits.
fv/donottrack_test.go
Outdated
@@ -0,0 +1,275 @@ | |||
// +build fvtests | |||
|
|||
// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. |
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.
Just 2018, unless you secretly have a TARDIS.
fv/donottrack_test.go
Outdated
fmt.Sprintf("host%d", ii), | ||
"", // No interface name means "run in the host's namespace" | ||
felixes[ii].IP, | ||
"8055,2379,22", // Extra ports are out/in and inbound failsafes. |
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.
I'm not sure what is meant here by "out/in and inbound".
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.
Ah, I see now, but I think better to be more explicit here: "2379 is a failsafe port both inbound and outbound; 22 is a failsafe port for inbound only; 8055 is not a failsafe."
fv/donottrack_test.go
Outdated
host0Pol, err = client.GlobalNetworkPolicies().Update(ctx, host0Pol, options.SetOptions{}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
host1Pol, err = client.GlobalNetworkPolicies().Update(ctx, host1Pol, options.SetOptions{}) |
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.
Does this update do anything?
@@ -492,5 +500,5 @@ func (c *ConnectivityChecker) CheckConnectivityWithTimeout(timeout time.Duration | |||
strings.Join(actualConn, "\n "), | |||
strings.Join(expConnectivity, "\n "), | |||
) | |||
Fail(message, 1) | |||
Fail(message, callerSkip) |
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.
Note: I think default callerSkip
here has changed from 1 to 2 - but I presume that that is what you want (for nicest debugging/reporting).
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.
Yes, exactly, I want it to report the failure on the test case line, not in workload.go
.
(cherry-picked from commit da11a06) Whitelist failsafe port response traffic in the raw table only
This fixes a nasty interaction between do-not-track policy and failsafe ports. Previously, adding do-not-track policy to a host endpoint resulted in failsafe port traffic being blocked because one leg of the connection would get conntracked, but the return leg would hit the do-not-track policy, which would either drop it (thus breaking the failsafe port) or mark it as NOTRACK, which results in future outbound packets failing the --ctstate INVALID test (because conntrack has only seen an outbound SYN, it isn't expecting the outbound to move past the SYN stage of the handshake). This change whitelists the response traffic in the raw table only so that failsafe ports are now forced to be conntracked, bypassing any do-not-track policy in both directions. Since the change is made only in the raw table (and we don't mark failsafe port traffic with the accepted mark), the response traffic still has to pass the --ctstate ESTABLISHED test in the filter table. Merge pull request projectcalico#1718 from fasaxc/failsafe-donottrack (cherry picked from commit da11a06) Whitelist failsafe port response traffic in the raw table only
This fixes a nasty interaction between do-not-track policy and failsafe ports. Previously, adding do-not-track policy to a host endpoint resulted in failsafe port traffic being blocked because one leg of the connection would get conntracked, but the return leg would hit the do-not-track policy, which would either drop it (thus breaking the failsafe port) or mark it as NOTRACK, which results in future outbound packets failing the --ctstate INVALID test (because conntrack has only seen an outbound SYN, it isn't expecting the outbound to move past the SYN stage of the handshake). This change whitelists the response traffic in the raw table only so that failsafe ports are now forced to be conntracked, bypassing any do-not-track policy in both directions. Since the change is made only in the raw table (and we don't mark failsafe port traffic with the accepted mark), the response traffic still has to pass the --ctstate ESTABLISHED test in the filter table. Merge pull request projectcalico#1718 from fasaxc/failsafe-donottrack (cherry picked from commit da11a06) Whitelist failsafe port response traffic in the raw table only
This fixes a nasty interaction between do-not-track policy and failsafe ports. Previously, adding do-not-track policy to a host endpoint resulted in failsafe port traffic being blocked because one leg of the connection would get conntracked, but the return leg would hit the do-not-track policy, which would either drop it (thus breaking the failsafe port) or mark it as NOTRACK, which results in future outbound packets failing the --ctstate INVALID test (because conntrack has only seen an outbound SYN, it isn't expecting the outbound to move past the SYN stage of the handshake). This change whitelists the response traffic in the raw table only so that failsafe ports are now forced to be conntracked, bypassing any do-not-track policy in both directions. Since the change is made only in the raw table (and we don't mark failsafe port traffic with the accepted mark), the response traffic still has to pass the --ctstate ESTABLISHED test in the filter table. Merge pull request projectcalico#1718 from fasaxc/failsafe-donottrack (cherry picked from commit da11a06) Whitelist failsafe port response traffic in the raw table only
Description
This fixes a nasty interaction between do-not-track policy and failsafe ports. Previously, adding do-not-track policy to a host endpoint resulted in failsafe port traffic being blocked because one leg of the connection would get conntracked, but the return leg would hit the do-not-track policy, which would either drop it (thus breaking the failsafe port) or mark it as NOTRACK, which results in future outbound packets failing the
--ctstate INVALID
test (because conntrack has only seen an outbound SYN, it isn't expecting the outbound to move past the SYN stage of the handshake).This change whitelists the response traffic in the raw table only so that failsafe ports are now forced to be conntracked, bypassing any do-not-track policy in both directions. Since the change is made only in the raw table (and we don't mark failsafe port traffic with the accepted mark), the response traffic still has to pass the
--ctstate ESTABLISHED
test in the filter table.Todos
Release Note