# the catalog and analyzer pods requires egress for:
# - making connections with registries
# - optionally, communicating with an external db
apiVersion:networking.k8s.io/v1
kind:NetworkPolicy
...
...
@@ -43,19 +43,16 @@ spec:
# ONLY Block requests to AWS metadata IP
except:
-169.254.169.254/32
# if an external db is enabled OR anchore enterprise is disabled, the policy engine pods will require egress to communicate with the db OR pull opensource feed data
{{- if or (hasKey .Values.postgresql "enabled") (not .Values.anchoreEnterpriseGlobal.enabled)}}
{{- if or (not .Values.postgresql.enabled) (not .Values.anchoreEnterpriseGlobal.enabled)}}
---
apiVersion:networking.k8s.io/v1
kind:NetworkPolicy
metadata:
name:allow-egress-from-policy-engine
name:allow-egress-from-analyzers
namespace:{{.Release.Namespace}}
spec:
podSelector:
matchLabels:
component:policy
component:analyzer
policyTypes:
-Egress
egress:
...
...
@@ -65,20 +62,19 @@ spec:
# ONLY Block requests to AWS metadata IP
except:
-169.254.169.254/32
{{- end}}
{{- end}}
# if anchore enterprise is enabled, the enterprise feeds pod will require egress to pull enterprise feed data
{{- if .Values.anchoreEnterpriseGlobal.enabled}}
{{- if or (hasKey .Values.postgresql "enabled") (not .Values.anchoreEnterpriseGlobal.enabled)}}
{{- if or (not .Values.postgresql.enabled) (not .Values.anchoreEnterpriseGlobal.enabled)}}
---
# if an external db is enabled OR anchore enterprise is disabled, the policy engine pods will require egress to communicate with the db OR pull opensource feed data
apiVersion:networking.k8s.io/v1
kind:NetworkPolicy
metadata:
name:allow-egress-from-feeds-service
name:allow-egress-from-policy-engine
namespace:{{.Release.Namespace}}
spec:
podSelector:
matchLabels:
component:enterprise-feeds
component:policy
policyTypes:
-Egress
egress:
...
...
@@ -89,10 +85,11 @@ spec:
except:
-169.254.169.254/32
{{- end}}
# if an external db is enabled, the simplequeue and analyzer pods will require egress to communicate with the db
{{- end}}
{{- if hasKey .Values.postgresql "enabled"}}
{{- if (not .Values.postgresql.enabled)}}
---
# if an external db is enabled, the simplequeue pod will require egress to communicate with the db
apiVersion:networking.k8s.io/v1
kind:NetworkPolicy
metadata:
...
...
@@ -111,16 +108,20 @@ spec:
# ONLY Block requests to AWS metadata IP
except:
-169.254.169.254/32
{{- end}}
{{- end}}
{{- if .Values.anchoreEnterpriseGlobal.enabled}}
---
# if anchore enterprise is enabled, the enterprise feeds pod will require egress to pull enterprise feed data
apiVersion:networking.k8s.io/v1
kind:NetworkPolicy
metadata:
name:allow-egress-from-analyzers
name:allow-egress-from-feeds-service
namespace:{{.Release.Namespace}}
spec:
podSelector:
matchLabels:
component:analyzer
component:enterprise-feeds
policyTypes:
-Egress
egress:
...
...
@@ -131,10 +132,10 @@ spec:
except:
-169.254.169.254/32
{{- end}}
{{- end}}
# if external redis is enabled, the ui pod will require egress
{{- if and (hasKey (index .Values "anchore-ui-redis") "enabled")}}
{{- if and (not (index .Values "anchore-ui-redis" "enabled")) .Values.anchoreEnterpriseGlobal.enabled}}
---
# if external redis is enabled, the ui pod will require egress as it depends on redis