-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds tests to validate that the auth handling in policy is working. It uses the always-fail type to test the fail case. If mTLS-SPIFFE is enabled in the cluster it will also perfom a successful test run with mTLS enabled. Signed-off-by: Maartje Eyskens <[email protected]>
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 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
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,21 @@ | ||
|
||
apiVersion: "cilium.io/v2" | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: auth-ingress-fail | ||
namespace: cilium-test | ||
spec: | ||
description: "Allow other client to contact echo but fail on auth" | ||
endpointSelector: | ||
matchLabels: | ||
kind: echo | ||
ingress: | ||
- fromEndpoints: | ||
- matchLabels: | ||
kind: client | ||
toPorts: | ||
- ports: | ||
- port: "8080" | ||
protocol: TCP | ||
auth: | ||
type: always-fail |
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,21 @@ | ||
|
||
apiVersion: "cilium.io/v2" | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: auth-ingress | ||
namespace: cilium-test | ||
spec: | ||
description: "Allow other client to contact echo after mTLS" | ||
endpointSelector: | ||
matchLabels: | ||
kind: echo | ||
ingress: | ||
- fromEndpoints: | ||
- matchLabels: | ||
kind: client | ||
toPorts: | ||
- ports: | ||
- port: "8080" | ||
protocol: TCP | ||
auth: | ||
type: mtls-spiffe |
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