From 5b2fd9613198f0791fff9ac57ff9ffbf164efdca Mon Sep 17 00:00:00 2001 From: Jim Bugwadia Date: Sun, 10 Nov 2019 21:34:22 -0800 Subject: [PATCH] update LimitNodePort --- samples/AddDefaultNetworkPolicy.md | 2 +- samples/LimitNodePort.md | 4 ++-- samples/best_practices/disallow_node_port.yaml | 4 ++-- .../scenarios/samples/best_practices/disallow_node_port.yaml | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/AddDefaultNetworkPolicy.md b/samples/AddDefaultNetworkPolicy.md index 66981cd627..2d1e46424c 100644 --- a/samples/AddDefaultNetworkPolicy.md +++ b/samples/AddDefaultNetworkPolicy.md @@ -6,7 +6,7 @@ A default `NetworkPolicy` should be configured for each namespace to default den ## Policy YAML -[require_default_network_policy.yaml](best_practices/require_default_network_policy.yaml) +[add_network_policy.yaml](best_practices/add_network_policy.yaml) ````yaml apiVersion: kyverno.io/v1alpha1 diff --git a/samples/LimitNodePort.md b/samples/LimitNodePort.md index 71ff1adf46..a45ca25438 100644 --- a/samples/LimitNodePort.md +++ b/samples/LimitNodePort.md @@ -15,10 +15,10 @@ Although NodePort services can be useful, their use should be limited to service apiVersion: kyverno.io/v1alpha1 kind: ClusterPolicy metadata: - name: disallow-node-port + name: limit-node-port spec: rules: - - name: disallow-node-port + - name: validate-node-port match: resources: kinds: diff --git a/samples/best_practices/disallow_node_port.yaml b/samples/best_practices/disallow_node_port.yaml index a998e839ac..0435ce6902 100644 --- a/samples/best_practices/disallow_node_port.yaml +++ b/samples/best_practices/disallow_node_port.yaml @@ -1,7 +1,7 @@ apiVersion: kyverno.io/v1alpha1 kind: ClusterPolicy metadata: - name: disallow-node-port + name: limit-nodeport annotations: policies.kyverno.io/category: Security policies.kyverno.io/description: A Kubernetes service of type NodePort uses a @@ -10,7 +10,7 @@ metadata: must be limited to services with additional upstream security checks. spec: rules: - - name: disallow-node-port + - name: validate-nodeport match: resources: kinds: diff --git a/test/scenarios/samples/best_practices/disallow_node_port.yaml b/test/scenarios/samples/best_practices/disallow_node_port.yaml index ce2e0883d0..f2283778a5 100644 --- a/test/scenarios/samples/best_practices/disallow_node_port.yaml +++ b/test/scenarios/samples/best_practices/disallow_node_port.yaml @@ -4,14 +4,13 @@ input: expected: validation: policyresponse: - policy: disallow-node-port + policy: limit-nodeport resource: kind: Service apiVersion: v1 namespace: '' name: "my-service" rules: - - name: disallow-node-port + - name: validate-nodeport type: Validation - message: "Validation error: Disallow service of type NodePort\nValidation rule 'disallow-node-port' failed at path '/spec/type/'." success: false \ No newline at end of file