Skip to content

Commit 9bf3062

Browse files
committed
adds the DNS port
1 parent e68a5fc commit 9bf3062

File tree

9 files changed

+83
-2
lines changed

9 files changed

+83
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: NetworkPolicy
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: external-secrets
6+
app.kubernetes.io/instance: external-secrets
7+
app.kubernetes.io/version: "v0.19.0"
8+
app.kubernetes.io/managed-by: external-secrets-operator
9+
name: allow-to-dns
10+
spec:
11+
podSelector:
12+
matchLabels:
13+
app.kubernetes.io/name: external-secrets
14+
egress:
15+
- to:
16+
- namespaceSelector:
17+
matchLabels:
18+
kubernetes.io/metadata.name: openshift-dns
19+
podSelector:
20+
matchLabels:
21+
dns.operator.openshift.io/daemonset-dns: default
22+
ports:
23+
- protocol: TCP
24+
port: 5353
25+
- protocol: UDP
26+
port: 5353
27+
policyTypes:
28+
- Egress

pkg/controller/external_secrets/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const (
101101
allowWebhookTrafficAssetName = "external-secrets/networkpolicy_allow-api-server-and-webhook-traffic.yaml"
102102
allowCertControllerTrafficAssetName = "external-secrets/networkpolicy_allow-api-server-egress-for-cert-controller-traffic.yaml"
103103
allowBitwardenServerTrafficAssetName = "external-secrets/networkpolicy_allow-api-server-egress-for-bitwarden-sever.yaml"
104+
allowDnsTrafficAsserName = "external-secrets/networkpolicy_allow-dns.yaml"
104105
)
105106

106107
var (

pkg/controller/external_secrets/networkpolicy.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func (r *Reconciler) createOrApplyStaticNetworkPolicies(esc *operatorv1alpha1.Ex
5656
assetName: allowBitwardenServerTrafficAssetName,
5757
condition: isBitwardenConfigEnabled(esc), // Only if bitwarden is enabled
5858
},
59+
{
60+
assetName: allowDnsTrafficAsserName,
61+
condition: true,
62+
},
5963
}
6064

6165
// Apply static network policies based on conditions

pkg/operator/assets/bindata.go

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/testdata/clusterrolebinding.yaml

Whitespace-only changes.

test/e2e/testdata/config.yaml

Whitespace-only changes.

test/e2e/testdata/external_secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ spec:
1919
- protocol: TCP
2020
port: 443 # HTTPS (AWS Secrets Manager)
2121
- protocol: TCP
22-
port: 53 # DNS
22+
port: 5353 # DNS
2323
- protocol: UDP
24-
port: 53 # DNS
24+
port: 5353 # DNS

test/e2e/testdata/secret.yaml

Whitespace-only changes.

test/e2e/testdata/servicemonitoring.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)