-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic_nsp_workspace.yaml
48 lines (48 loc) · 1.41 KB
/
basic_nsp_workspace.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
apiVersion: template.openshift.io/v1
kind: Template
parameters:
- name: NAMESPACE
- name: NAME
objects:
- apiVersion: security.devops.gov.bc.ca/v1alpha1
kind: NetworkSecurityPolicy
metadata:
name: egress-internet
spec:
description: "allow ${NAMESPACE} namespace to talk to the internet."
source:
- - $namespace=${NAMESPACE}
destination:
- - ext:network=any
- apiVersion: security.devops.gov.bc.ca/v1alpha1
kind: NetworkSecurityPolicy
metadata:
name: intra-namespace-comms
spec:
description: "allow ${NAMESPACE} namespace to talk to itself"
source:
- - $namespace=${NAMESPACE}
destination:
- - $namespace=${NAMESPACE}
- apiVersion: security.devops.gov.bc.ca/v1alpha1
kind: NetworkSecurityPolicy
metadata:
name: int-cluster-k8s-api-comms
spec:
description: "allow ${NAMESPACE} pods to talk to the k8s api"
destination:
- - int:network=internal-cluster-api-endpoint
- - $namespace=${NAMESPACE}
source:
- - $namespace=${NAMESPACE}
- - int:network=internal-cluster-api-endpoint
- apiVersion: security.devops.gov.bc.ca/v1alpha1
kind: NetworkSecurityPolicy
metadata:
name: tools-namespace-comms
spec:
description: "allow ${NAMESPACE} namespace to get images from the tools workspace"
source:
- - $namespace=${NAME}-tools
destination:
- - $namespace=${NAMESPACE}