-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#66) Configure an ExtAuthzProxy provider for each project stage
This patch configures an istio envoyExtAuthzHttp provider for each stage in each project. An example provider for the dev stage of the holos project is `authproxy-dev-holos`
- Loading branch information
1 parent
ce94776
commit 43c8702
Showing
5 changed files
with
91 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package holos | ||
|
||
// #MeshConfig provides the istio meshconfig in the config key given projects. | ||
#MeshConfig: { | ||
projects: #Projects | ||
// clusterName is the value of the --cluster-name flag, the cluster currently being manged / rendered. | ||
clusterName: string | *#ClusterName | ||
|
||
extensionProviderMap: [Name=_]: { | ||
name: Name | ||
} | ||
|
||
config: { | ||
accessLogEncoding: string | *"JSON" | ||
accessLogFile: string | *"/dev/stdout" | ||
defaultConfig: { | ||
discoveryAddress: string | *"istiod.istio-system.svc:15012" | ||
tracing: zipkin: address: string | *"zipkin.istio-system:9411" | ||
} | ||
defaultProviders: metrics: [...string] | *["prometheus"] | ||
enablePrometheusMerge: false | *true | ||
rootNamespace: string | *"istio-system" | ||
trustDomain: string | *"cluster.local" | ||
extensionProviders: [for x in extensionProviderMap {x}] | ||
} | ||
} | ||
|
||
// #ExtAuthzProxy defines the provider configuration for an istio external authorization auth proxy. | ||
#ExtAuthzProxy: { | ||
name: string | ||
envoyExtAuthzHttp: { | ||
headersToDownstreamOnDeny: [ | ||
"content-type", | ||
"set-cookie", | ||
] | ||
headersToUpstreamOnAllow: [ | ||
"authorization", | ||
"path", | ||
"x-auth-request-user", | ||
"x-auth-request-email", | ||
"x-auth-request-access-token", | ||
] | ||
includeAdditionalHeadersInCheck: "X-Auth-Request-Redirect": "%REQ(x-forwarded-proto)%://%REQ(:authority)%%REQ(:path)%%REQ(:query)%" | ||
includeRequestHeadersInCheck: [ | ||
"authorization", | ||
"cookie", | ||
"x-forwarded-for", | ||
] | ||
port: 4180 | ||
service: string | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package holos | ||
|
||
#MeshConfig: { | ||
projects: _ | ||
clusterName: _ | ||
|
||
extensionProviderMap: { | ||
"cluster-trace": { | ||
zipkin: { | ||
maxTagLength: 56 | ||
port: 9411 | ||
service: "zipkin.istio-system.svc" | ||
} | ||
} | ||
} | ||
|
||
config: { | ||
// For PROXY PROTOCOL at the ingress gateway. | ||
gatewayTopology: { | ||
numTrustedProxies: 2 | ||
} | ||
} | ||
|
||
// Configure an ExtAuthzHttp provider for each stage's authproxy | ||
for Project in projects { | ||
if Project.clusters[clusterName] != _|_ { | ||
for Stage in Project.stages { | ||
let Name = "authproxy-\(Stage.slug)" | ||
extensionProviderMap: (Name): #ExtAuthzProxy & { | ||
envoyExtAuthzHttp: service: "authproxy.\(Stage.namespace).svc.cluster.local" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3 | ||
4 |