This file contains hidden or 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
apiVersion: security.istio.io/v1beta1 | |
kind: AuthorizationPolicy | |
metadata: | |
name: httpbin-deny | |
namespace: foo | |
spec: | |
selector: | |
matchLabels: | |
app: httpbin | |
version: v1 |
This file contains hidden or 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
apiVersion: security.istio.io/v1beta1 | |
kind: AuthorizationPolicy | |
metadata: | |
name: allow-read | |
namespace: default | |
spec: | |
selector: | |
matchLabels: | |
app: products | |
action: ALLOW |
This file contains hidden or 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
apiVersion: security.istio.io/v1beta1 | |
kind: AuthorizationPolicy | |
metadata: | |
name: tester | |
namespace: default | |
spec: | |
selector: | |
matchLabels: | |
app: products | |
action: ALLOW |
This file contains hidden or 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
$ for from in "foo" "bar" "legacy"; do for to in "foo" "bar" "legacy"; do kubectl exec $(kubectl get pod -l app=sleep -n ${from} -o jsonpath={.items..metadata.name}) -c sleep -n ${from} -- curl "http://httpbin.${to}:8000/ip" -s -o /dev/null -w "sleep.${from} to httpbin.${to}: %{http_code}\n"; done; done | |
sleep.foo to httpbin.foo: 200 | |
sleep.foo to httpbin.bar: 200 | |
sleep.foo to httpbin.legacy: 200 | |
sleep.bar to httpbin.foo: 200 | |
sleep.bar to httpbin.bar: 200 | |
sleep.bar to httpbin.legacy: 200 | |
sleep.legacy to httpbin.foo: 200 | |
sleep.legacy to httpbin.bar: 200 | |
sleep.legacy to httpbin.legacy: 200 |
This file contains hidden or 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
$ kubectl apply -f - <<EOF | |
apiVersion: "security.istio.io/v1beta1" | |
kind: "PeerAuthentication" | |
metadata: | |
name: "default" | |
namespace: "istio-system" | |
spec: | |
mtls: | |
mode: STRICT | |
EOF |
This file contains hidden or 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
$ for from in "foo" "bar" "legacy"; do for to in "foo" "bar" "legacy"; do kubectl exec $(kubectl get pod -l app=sleep -n ${from} -o jsonpath={.items..metadata.name}) -c sleep -n ${from} -- curl "http://httpbin.${to}:8000/ip" -s -o /dev/null -w "sleep.${from} to httpbin.${to}: %{http_code}\n"; done; done | |
sleep.foo to httpbin.foo: 200 | |
sleep.foo to httpbin.bar: 200 | |
sleep.foo to httpbin.legacy: 200 | |
sleep.bar to httpbin.foo: 200 | |
sleep.bar to httpbin.bar: 200 | |
sleep.bar to httpbin.legacy: 200 | |
sleep.legacy to httpbin.foo: 000 | |
command terminated with exit code 56 | |
sleep.legacy to httpbin.bar: 000 |
This file contains hidden or 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
$ kubectl apply -f - <<EOF | |
apiVersion: "security.istio.io/v1beta1" | |
kind: "PeerAuthentication" | |
metadata: | |
name: "default" | |
namespace: "foo" | |
spec: | |
mtls: | |
mode: STRICT | |
EOF |
This file contains hidden or 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
$ for from in "foo" "bar" "legacy"; do for to in "foo" "bar" "legacy"; do kubectl exec $(kubectl get pod -l app=sleep -n ${from} -o jsonpath={.items..metadata.name}) -c sleep -n ${from} -- curl "http://httpbin.${to}:8000/ip" -s -o /dev/null -w "sleep.${from} to httpbin.${to}: %{http_code}\n"; done; done | |
sleep.foo to httpbin.foo: 200 | |
sleep.foo to httpbin.bar: 200 | |
sleep.foo to httpbin.legacy: 200 | |
sleep.bar to httpbin.foo: 200 | |
sleep.bar to httpbin.bar: 200 | |
sleep.bar to httpbin.legacy: 200 | |
sleep.legacy to httpbin.foo: 000 | |
command terminated with exit code 56 | |
sleep.legacy to httpbin.bar: 200 |
This file contains hidden or 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
$ cat <<EOF | kubectl apply -n bar -f - | |
apiVersion: "security.istio.io/v1beta1" | |
kind: "PeerAuthentication" | |
metadata: | |
name: "httpbin" | |
namespace: "bar" | |
spec: | |
selector: | |
matchLabels: | |
app: httpbin |
This file contains hidden or 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
$ for from in "foo" "bar" "legacy"; do for to in "foo" "bar" "legacy"; do kubectl exec $(kubectl get pod -l app=sleep -n ${from} -o jsonpath={.items..metadata.name}) -c sleep -n ${from} -- curl "http://httpbin.${to}:8000/ip" -s -o /dev/null -w "sleep.${from} to httpbin.${to}: %{http_code}\n"; done; done | |
sleep.foo to httpbin.foo: 200 | |
sleep.foo to httpbin.bar: 200 | |
sleep.foo to httpbin.legacy: 200 | |
sleep.bar to httpbin.foo: 200 | |
sleep.bar to httpbin.bar: 200 | |
sleep.bar to httpbin.legacy: 200 | |
sleep.legacy to httpbin.foo: 200 | |
sleep.legacy to httpbin.bar: 000 | |
command terminated with exit code 56 |