Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pspieker-stripe committed Feb 15, 2024
1 parent 5530680 commit aa6d697
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/smokescreen/acl/v1/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func New(logger *logrus.Logger, loader Loader, disabledActions []string) (*ACL,
if err != nil {
return nil, err
}

err = acl.DisablePolicies(disabledActions)
if err != nil {
return nil, err
Expand Down
7 changes: 3 additions & 4 deletions pkg/smokescreen/smokescreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,9 @@ func checkACLsForRequest(config *Config, req *http.Request, destination hostport
// a _subsequent_ proxy to use for the CONNECT request. This is used to allow traffic
// flow as in: client -(TLS)-> smokescreen -(TLS)-> external proxy -(TLS)-> destination.
// Without this header, there's no way for the client to specify a subsequent proxy.
var connectProxyHost string
if connectProxyHostSlice := req.Header.Get("X-Upstream-Https-Proxy"); len(connectProxyHostSlice) > 0 {
connectProxyHost = string(connectProxyHostSlice[0])
}
// Also note - Get returns the first value for a given header, or the empty string,
// which is the behavior we want here.
connectProxyHost := req.Header.Get("X-Upstream-Https-Proxy")

ACLDecision, err := config.EgressACL.Decide(role, destination.Host, connectProxyHost)
decision.project = ACLDecision.Project
Expand Down
2 changes: 2 additions & 0 deletions pkg/smokescreen/testdata/acl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ services:
- 127.0.0.1
allowed_external_proxies:
- myproxy.com
- otherproxy.org
- name: test-external-connect-proxy-allowed-srv
project: security
action: enforce
allowed_domains:
- 127.0.0.1
allowed_external_proxies:
- localhost
- thisisaproxy.com

global_deny_list:
- stripe.com

0 comments on commit aa6d697

Please sign in to comment.