Skip to content

Commit

Permalink
Block wireserver for containers via calico
Browse files Browse the repository at this point in the history
  • Loading branch information
jsturtevant committed Oct 14, 2021
1 parent eac8312 commit a6c71c2
Show file tree
Hide file tree
Showing 6 changed files with 503 additions and 1,195 deletions.
38 changes: 38 additions & 0 deletions templates/addons/windows/calico/calico.yaml
Expand Up @@ -9,6 +9,37 @@ spec:
---
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-static-rules
namespace: kube-system
labels:
tier: node
app: calico
data:
static-rules.json: |
{
"Provider": "azure",
"Version": "0.1",
"Rules": [
{
"Name": "EndpointPolicy",
"Rule": {
"Id": "wireserver",
"Type": "ACL",
"Protocol": 6,
"Action": "Block",
"Direction": "Out",
"RemoteAddresses": "168.63.129.16/32",
"RemotePorts": "80",
"Priority": 200,
"RuleType": "Switch"
}
}
]
}
---
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config-windows
namespace: kube-system
Expand All @@ -17,6 +48,7 @@ metadata:
app: calico
data:
veth_mtu: "1350"

cni_network_config: |
{
"name": "Calico",
Expand Down Expand Up @@ -207,6 +239,9 @@ spec:
volumeMounts:
- name: calico-config-windows
mountPath: /etc/kube-calico-windows/
- name: calico-static-rules
mountPath: /calico/static-rules.json
subPath: static-rules.json
env:
- name: POD_NAME
valueFrom:
Expand All @@ -226,6 +261,9 @@ spec:
- name: calico-config-windows
configMap:
name: calico-config-windows
- name: calico-static-rules
configMap:
name: calico-static-rules
# Used to install CNI.
- name: cni-bin-dir
hostPath:
Expand Down

0 comments on commit a6c71c2

Please sign in to comment.