openshift/project: define default egress policy to prevent fas db access
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
parent
06307a788a
commit
eac122c543
3 changed files with 29 additions and 0 deletions
|
@ -57,3 +57,10 @@
|
||||||
vars:
|
vars:
|
||||||
objectname: appowners.yml
|
objectname: appowners.yml
|
||||||
template_fullpath: "{{roles_path}}/openshift/project/templates/appowners.yml"
|
template_fullpath: "{{roles_path}}/openshift/project/templates/appowners.yml"
|
||||||
|
|
||||||
|
- name: ergresspolicy.yml
|
||||||
|
include_role:
|
||||||
|
name: openshift/object
|
||||||
|
vars:
|
||||||
|
objectname: egresspolicy.yml
|
||||||
|
template_fullpath: "{{roles_path}}/openshift/project/templates/egresspolicy.yml"
|
||||||
|
|
20
roles/openshift/project/templates/egresspolicy.yml
Normal file
20
roles/openshift/project/templates/egresspolicy.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: EgressNetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: default
|
||||||
|
spec:
|
||||||
|
egress:
|
||||||
|
{% if not allow_fas_db or env != "production" %}
|
||||||
|
- type: Deny
|
||||||
|
to:
|
||||||
|
cidrSelector: "10.5.126.99/32"
|
||||||
|
{% endif %}
|
||||||
|
{% if not allow_fas_db or env != "staging" %}
|
||||||
|
- type: Deny
|
||||||
|
to:
|
||||||
|
cidrSelector: "10.5.128.96/32"
|
||||||
|
{% endif %}
|
||||||
|
- type: Allow
|
||||||
|
to:
|
||||||
|
cidrSelector: "0.0.0.0/0"
|
2
roles/openshift/project/vars/default.yml
Normal file
2
roles/openshift/project/vars/default.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
allow_fas_db: false
|
Loading…
Add table
Add a link
Reference in a new issue