Skip to content

Commit 6fde853

Browse files
committed
added openshift-ovn-kubernetes ns
1 parent ae45933 commit 6fde853

File tree

8 files changed

+41
-45
lines changed

8 files changed

+41
-45
lines changed

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ require (
4040
github.com/go-test/deep v1.1.0
4141
github.com/gofrs/uuid v4.4.0+incompatible
4242
github.com/golang-jwt/jwt/v4 v4.5.1
43+
github.com/golang/mock v1.6.0
4344
github.com/google/gnostic v0.5.7-v3refs
4445
github.com/google/go-cmp v0.6.0
4546
github.com/google/uuid v1.6.0

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4=
314314
github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
315315
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
316316
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
317+
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
318+
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
317319
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
318320
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
319321
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=

pkg/operator/controllers/guardrails/policies/gktemplates-src/library/common.rego

+7-9
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,14 @@ is_priv_namespace(ns) = true {
5959
exempted_user = {
6060
"system:kube-controller-manager",
6161
"system:kube-scheduler",
62-
"system:admin" # comment out temporarily for testing in console
62+
"system:admin"
6363
}
6464

6565
exempted_groups = {
6666
# "system:cluster-admins", # dont allow kube:admin
67-
"system:nodes", # eg, "username": "system:node:jeff-test-cluster-pcnp4-master-2"
68-
"system:serviceaccounts", # to allow all system service account?
69-
# "system:serviceaccounts:openshift-monitoring", # monitoring operator
70-
# "system:serviceaccounts:openshift-network-operator", # network operator
71-
# "system:serviceaccounts:openshift-machine-config-operator", # machine-config-operator, however the request provide correct sa name
72-
"system:masters" # system:admin
67+
"system:nodes",
68+
"system:serviceaccounts", # allow all system service accounts
69+
"system:masters"
7370
}
7471
privileged_ns = {
7572
# Kubernetes specific namespaces
@@ -116,7 +113,8 @@ privileged_ns = {
116113
"openshift-multus",
117114
"openshift-network-operator",
118115
"openshift-oauth-apiserver",
116+
"openshift-ovn-kubernetes",
117+
"openshift-sdn",
119118
"openshift-service-ca",
120-
"openshift-service-ca-operator",
121-
"openshift-sdn"
119+
"openshift-service-ca-operator"
122120
}

pkg/operator/controllers/guardrails/policies/gktemplates/aro-deny-delete-pull-secret.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,14 @@ spec:
8787
exempted_user = {
8888
"system:kube-controller-manager",
8989
"system:kube-scheduler",
90-
"system:admin" # comment out temporarily for testing in console
90+
"system:admin"
9191
}
9292
9393
exempted_groups = {
9494
# "system:cluster-admins", # dont allow kube:admin
95-
"system:nodes", # eg, "username": "system:node:jeff-test-cluster-pcnp4-master-2"
96-
"system:serviceaccounts", # to allow all system service account?
97-
# "system:serviceaccounts:openshift-monitoring", # monitoring operator
98-
# "system:serviceaccounts:openshift-network-operator", # network operator
99-
# "system:serviceaccounts:openshift-machine-config-operator", # machine-config-operator, however the request provide correct sa name
100-
"system:masters" # system:admin
95+
"system:nodes",
96+
"system:serviceaccounts", # allow all system service accounts
97+
"system:masters"
10198
}
10299
privileged_ns = {
103100
# Kubernetes specific namespaces
@@ -144,7 +141,8 @@ spec:
144141
"openshift-multus",
145142
"openshift-network-operator",
146143
"openshift-oauth-apiserver",
144+
"openshift-ovn-kubernetes",
145+
"openshift-sdn",
147146
"openshift-service-ca",
148-
"openshift-service-ca-operator",
149-
"openshift-sdn"
147+
"openshift-service-ca-operator"
150148
}

pkg/operator/controllers/guardrails/policies/gktemplates/aro-deny-machine-config.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,14 @@ spec:
9292
exempted_user = {
9393
"system:kube-controller-manager",
9494
"system:kube-scheduler",
95-
"system:admin" # comment out temporarily for testing in console
95+
"system:admin"
9696
}
9797
9898
exempted_groups = {
9999
# "system:cluster-admins", # dont allow kube:admin
100-
"system:nodes", # eg, "username": "system:node:jeff-test-cluster-pcnp4-master-2"
101-
"system:serviceaccounts", # to allow all system service account?
102-
# "system:serviceaccounts:openshift-monitoring", # monitoring operator
103-
# "system:serviceaccounts:openshift-network-operator", # network operator
104-
# "system:serviceaccounts:openshift-machine-config-operator", # machine-config-operator, however the request provide correct sa name
105-
"system:masters" # system:admin
100+
"system:nodes",
101+
"system:serviceaccounts", # allow all system service accounts
102+
"system:masters"
106103
}
107104
privileged_ns = {
108105
# Kubernetes specific namespaces
@@ -149,7 +146,8 @@ spec:
149146
"openshift-multus",
150147
"openshift-network-operator",
151148
"openshift-oauth-apiserver",
149+
"openshift-ovn-kubernetes",
150+
"openshift-sdn",
152151
"openshift-service-ca",
153-
"openshift-service-ca-operator",
154-
"openshift-sdn"
152+
"openshift-service-ca-operator"
155153
}

pkg/operator/controllers/guardrails/policies/gktemplates/aro-deny-master-toleration-taints.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,14 @@ spec:
111111
exempted_user = {
112112
"system:kube-controller-manager",
113113
"system:kube-scheduler",
114-
"system:admin" # comment out temporarily for testing in console
114+
"system:admin"
115115
}
116116
117117
exempted_groups = {
118118
# "system:cluster-admins", # dont allow kube:admin
119-
"system:nodes", # eg, "username": "system:node:jeff-test-cluster-pcnp4-master-2"
120-
"system:serviceaccounts", # to allow all system service account?
121-
# "system:serviceaccounts:openshift-monitoring", # monitoring operator
122-
# "system:serviceaccounts:openshift-network-operator", # network operator
123-
# "system:serviceaccounts:openshift-machine-config-operator", # machine-config-operator, however the request provide correct sa name
124-
"system:masters" # system:admin
119+
"system:nodes",
120+
"system:serviceaccounts", # allow all system service accounts
121+
"system:masters"
125122
}
126123
privileged_ns = {
127124
# Kubernetes specific namespaces
@@ -168,7 +165,8 @@ spec:
168165
"openshift-multus",
169166
"openshift-network-operator",
170167
"openshift-oauth-apiserver",
168+
"openshift-ovn-kubernetes",
169+
"openshift-sdn",
171170
"openshift-service-ca",
172-
"openshift-service-ca-operator",
173-
"openshift-sdn"
171+
"openshift-service-ca-operator"
174172
}

pkg/operator/controllers/guardrails/policies/gktemplates/aro-deny-privileged-namespace.yaml

+7-9
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,14 @@ spec:
109109
exempted_user = {
110110
"system:kube-controller-manager",
111111
"system:kube-scheduler",
112-
"system:admin" # comment out temporarily for testing in console
112+
"system:admin"
113113
}
114114
115115
exempted_groups = {
116116
# "system:cluster-admins", # dont allow kube:admin
117-
"system:nodes", # eg, "username": "system:node:jeff-test-cluster-pcnp4-master-2"
118-
"system:serviceaccounts", # to allow all system service account?
119-
# "system:serviceaccounts:openshift-monitoring", # monitoring operator
120-
# "system:serviceaccounts:openshift-network-operator", # network operator
121-
# "system:serviceaccounts:openshift-machine-config-operator", # machine-config-operator, however the request provide correct sa name
122-
"system:masters" # system:admin
117+
"system:nodes",
118+
"system:serviceaccounts", # allow all system service accounts
119+
"system:masters"
123120
}
124121
privileged_ns = {
125122
# Kubernetes specific namespaces
@@ -166,7 +163,8 @@ spec:
166163
"openshift-multus",
167164
"openshift-network-operator",
168165
"openshift-oauth-apiserver",
166+
"openshift-ovn-kubernetes",
167+
"openshift-sdn",
169168
"openshift-service-ca",
170-
"openshift-service-ca-operator",
171-
"openshift-sdn"
169+
"openshift-service-ca-operator"
172170
}

vendor/modules.txt

+3
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ github.com/golang-jwt/jwt/v5
691691
# github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
692692
## explicit
693693
github.com/golang/groupcache/lru
694+
# github.com/golang/mock v1.6.0
695+
## explicit; go 1.11
696+
github.com/golang/mock/mockgen/model
694697
# github.com/golang/protobuf v1.5.4
695698
## explicit; go 1.17
696699
github.com/golang/protobuf/jsonpb

0 commit comments

Comments
 (0)