-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds two new mutual auth tests. The first one is a test for an L7 policy with mutual auth enabled. The second one is a normal traffic tests but with an egress policy. Signed-off-by: Maartje Eyskens <[email protected]>
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
connectivity/manifests/echo-egress-mutual-authentication.yaml
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,19 @@ | ||
apiVersion: "cilium.io/v2" | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: echo-egress-mutual-authentication | ||
spec: | ||
description: "Allow other client to contact echo after mutual authentication" | ||
endpointSelector: | ||
matchLabels: | ||
kind: client | ||
egress: | ||
- toEndpoints: | ||
- matchLabels: | ||
kind: echo | ||
toPorts: | ||
- ports: | ||
- port: "8080" | ||
protocol: TCP | ||
authentication: | ||
mode: required |
33 changes: 33 additions & 0 deletions
33
connectivity/manifests/echo-ingress-l7-http-mutual-auth.yaml
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,33 @@ | ||
--- | ||
apiVersion: "cilium.io/v2" | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: echo-ingress-l7-http | ||
spec: | ||
description: "Allow other client to GET on echo" | ||
endpointSelector: | ||
matchLabels: | ||
kind: echo | ||
ingress: | ||
# Only allow 'other' client to make a GET /public requests. | ||
# Allow GET /private' only if a particular HTTP header is set. | ||
# Disallow L3 traffic for now, flow matcher doesn't yet support L7 drops. | ||
- fromEndpoints: | ||
- matchLabels: | ||
other: client | ||
toPorts: | ||
- ports: | ||
- port: "8080" | ||
protocol: TCP | ||
rules: | ||
http: | ||
- method: "GET" | ||
path: "/$" | ||
- method: "GET" | ||
path: "/public$" | ||
- method: "GET" | ||
path: "/private$" | ||
headers: | ||
- "X-Very-Secret-Token: 42" | ||
authentication: | ||
mode: required |
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