Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit f6b483c

Browse files
author
Mathieu Benoit
committed
Add default deny AuthzPol in istio-system
1 parent f28d1e9 commit f6b483c

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

content/service-mesh/set-up-asm-configs.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,29 @@ spec:
7979
EOF
8080
```
8181
{{% notice tip %}}
82-
A [`Sidecar`](https://istio.io/latest/docs/reference/config/networking/sidecar/) configuration in the `MeshConfig` root namespace will be applied by default to all namespaces without a `Sidecar` configuration.
82+
A [`Sidecar`](https://istio.io/latest/docs/reference/config/networking/sidecar/) configuration in the `MeshConfig` root namespace will be applied by default to all namespaces.
8383
{{% /notice %}}
8484

85+
## Define default deny AuthorizationPolicy Mesh-wide
86+
87+
Define `deny` `AuthorizationPolicy` resource:
88+
```Bash
89+
cat <<EOF > ~/$GKE_CONFIGS_DIR_NAME/config-sync/istio-config/authorizationpolicy_denyall.yaml
90+
apiVersion: security.istio.io/v1beta1
91+
kind: AuthorizationPolicy
92+
metadata:
93+
name: deny-all
94+
namespace: istio-system
95+
spec: {}
96+
EOF
97+
```
98+
8599
## Deploy Kubernetes manifests
86100

87101
```Bash
88102
cd ~/$GKE_CONFIGS_DIR_NAME/
89103
git add .
90-
git commit -m "ASM configs (mTLS, Sidecar, etc.) in GKE cluster"
104+
git commit -m "ASM Mesh configs in GKE cluster"
91105
git push origin main
92106
```
93107

@@ -98,7 +112,7 @@ Here is what you should have at this stage:
98112
List the GitHub runs for the **GKE cluster configs** repository `cd ~/$GKE_CONFIGS_DIR_NAME && gh run list`:
99113
```Plaintext
100114
STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE
101-
✓ ASM configs (mTLS, Sidecar, etc.) in GKE cluster ci main push 1972234050 56s 2m
115+
✓ ASM Mesh configs in GKE cluster ci main push 1972234050 56s 2m
102116
✓ ASM MCP for GKE cluster ci main push 1972222841 56s 7m
103117
✓ Enforce Container Registries Policies in GKE cluster ci main push 1972138349 55s 49m
104118
✓ Policies for NetworkPolicy resources ci main push 1971716019 1m14s 3h
@@ -129,6 +143,7 @@ getting 1 RepoSync and RootSync from gke-hub-membership
129143
│ templates.gatekeeper.sh │ ConstraintTemplate │ k8sallowedrepos │ │
130144
│ templates.gatekeeper.sh │ ConstraintTemplate │ k8srequiredlabels │ │
131145
│ │ ServiceAccount │ default │ config-management-monitoring │
146+
│ security.istio.io │ AuthorizationPolicy │ deny-all │ istio-system │
132147
│ │ ConfigMap │ istio-asm-managed-rapid │ istio-system │
133148
│ mesh.cloud.google.com │ ControlPlaneRevision │ asm-managed-rapid │ istio-system │
134149
│ security.istio.io │ PeerAuthentication │ default │ istio-system │

content/whereami/set-up-authorization-policies.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,10 @@ Initialize variables:
1010
source ~/acm-workshop-variables.sh
1111
```
1212

13-
## Define AuthorizationPolicy resources
13+
## Define AuthorizationPolicy resource
1414

15-
Define fine granular `AuthorizationPolicy` resources:
15+
Define fine granular `AuthorizationPolicy` resource:
1616
```Bash
17-
cat <<EOF > ~/$WHERE_AMI_DIR_NAME/base/authorizationpolicy_denyall.yaml
18-
apiVersion: security.istio.io/v1beta1
19-
kind: AuthorizationPolicy
20-
metadata:
21-
name: deny-all
22-
spec: {}
23-
EOF
2417
cat <<EOF > ~/$WHERE_AMI_DIR_NAME/base/authorizationpolicy_whereami.yaml
2518
apiVersion: security.istio.io/v1beta1
2619
kind: AuthorizationPolicy
@@ -47,7 +40,6 @@ EOF
4740
Update the Kustomize base overlay:
4841
```Bash
4942
cd ~/$WHERE_AMI_DIR_NAME/base
50-
kustomize edit add resource authorizationpolicy_denyall.yaml
5143
kustomize edit add resource authorizationpolicy_whereami.yaml
5244
```
5345

@@ -56,7 +48,7 @@ kustomize edit add resource authorizationpolicy_whereami.yaml
5648
```Bash
5749
cd ~/$WHERE_AMI_DIR_NAME/
5850
git add .
59-
git commit -m "Whereami Authorization Policies"
51+
git commit -m "Whereami Authorization Policy"
6052
git push origin main
6153
```
6254

@@ -65,7 +57,7 @@ git push origin main
6557
List the GitHub runs for the **Whereami app** repository `cd ~/$WHERE_AMI_DIR_NAME && gh run list`:
6658
```Plaintext
6759
STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE
68-
✓ Whereami Authorization Policies ci main push 1976612253 1m9s 2m
60+
✓ Whereami Authorization Policy ci main push 1976612253 1m9s 2m
6961
✓ Whereami Sidecar ci main push 1976601129 1m3s 5m
7062
✓ Whereami Network Policies ci main push 1976593659 1m1s 1m
7163
✓ Whereami app ci main push 1976257627 1m1s 2h
@@ -94,6 +86,5 @@ getting 1 RepoSync and RootSync from gke-hub-membership
9486
│ networking.k8s.io │ NetworkPolicy │ denyall │ whereami │
9587
│ networking.k8s.io │ NetworkPolicy │ whereami │ whereami │
9688
│ security.istio.io │ AuthorizationPolicy │ whereami │ whereami │
97-
│ security.istio.io │ AuthorizationPolicy │ deny-all │ whereami │
9889
└─────────────────────┴─────────────────────┴────────────────────┴───────────┘
9990
```

0 commit comments

Comments
 (0)