-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
VAULT-6803: fix listener issue if using proxy_protocol_behavior
with deny_unauthorized
for untrusted upstream connections
#27589
Changes from all commits
bdef3c7
6d959da
71c633d
97dd479
14df1b1
b2e666f
12bc4b9
a3b67c6
8f825e4
8e5f0e2
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
```release-note:bug | ||
core/config: fix issue when using `proxy_protocol_behavior` with `deny_unauthorized`, | ||
which causes the Vault TCP listener to close after receiving an untrusted upstream proxy connection. | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,7 +187,7 @@ require ( | |
github.com/ory/dockertest v3.3.5+incompatible | ||
github.com/ory/dockertest/v3 v3.10.0 | ||
github.com/patrickmn/go-cache v2.1.0+incompatible | ||
github.com/pires/go-proxyproto v0.7.0 | ||
github.com/pires/go-proxyproto v1.0.0 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/posener/complete v1.2.3 | ||
github.com/pquerna/otp v1.2.1-0.20191009055518-468c2dd2b58d | ||
|
@@ -542,3 +542,7 @@ require ( | |
) | ||
|
||
replace github.com/ma314smith/signedxml v1.1.1 => github.com/moov-io/signedxml v1.1.1 | ||
|
||
// Support using the forked repository until https://github.com/pires/go-proxyproto/pull/110 merges | ||
// and is released. | ||
replace github.com/pires/go-proxyproto v1.0.0 => github.com/peteski22/go-proxyproto v1.0.0 | ||
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. Info on forked repo tag.
Bumped to v1.0.0 which doesn't exist as a tag on the maintainer's repo but does on the forked repo. Suspect that if the maintainer accepts the PR and tags it, semver suggests the breaking change to 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. The change here can now be updated and the https://github.com/pires/go-proxyproto/releases/tag/v0.8.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,14 @@ | |
package proxyutil | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"net" | ||
"sync" | ||
"time" | ||
|
||
"github.com/hashicorp/go-secure-stdlib/parseutil" | ||
sockaddr "github.com/hashicorp/go-sockaddr" | ||
proxyproto "github.com/pires/go-proxyproto" | ||
"github.com/hashicorp/go-sockaddr" | ||
"github.com/pires/go-proxyproto" | ||
) | ||
|
||
// ProxyProtoConfig contains configuration for the PROXY protocol | ||
|
@@ -72,7 +71,7 @@ func WrapInProxyProto(listener net.Listener, config *ProxyProtoConfig) (net.List | |
return proxyproto.IGNORE, nil | ||
} | ||
|
||
return proxyproto.REJECT, errors.New(`upstream connection not trusted proxy_protocol_behavior is "deny_unauthorized"`) | ||
return proxyproto.REJECT, proxyproto.ErrInvalidUpstream | ||
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. This is the change that keeps the listener waiting for a valid connection. https://github.com/peteski22/go-proxyproto/blob/v1.0.0/protocol.go#L85-L88 |
||
}, | ||
} | ||
default: | ||
|
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.
Added a timeout to the tests as the forked library now never stops listening until it can return a valid connection.