Skip to content

Commit 25b3070

Browse files
committed
Responded to review comments
First round of updates in response to review comments, and some other clean-up.
1 parent c185b85 commit 25b3070

File tree

1 file changed

+65
-50
lines changed

1 file changed

+65
-50
lines changed

enhancements/network/core-network-policies.md

+65-50
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ compromised pod can not be used as a springboard for other attacks.
4646

4747
- As an administrator, I need to be able to override specific
4848
OpenShift policies to be more restrictive so that I can satisfy my
49-
security department
49+
security requirements. For instance there may be cases where a core
50+
component may be able to call webhooks, but I do not want to use
51+
them on the cluster, or have a specific list of endpoints. I may
52+
want to override our permissive list to make it more restrictive.
5053

5154
- As an OpenShift release manager, I want to know that all cluster
5255
namespaces have policies applied so that I can determine if we are
@@ -69,19 +72,26 @@ compromised pod can not be used as a springboard for other attacks.
6972

7073
- Audit the policies for compliance
7174

72-
- Ensure all OpenShift namespaces have a default deny-all policy
73-
defined, and identify those that do not (including “openshift-”
74-
namespaces managed by a non Red Hat operator)
75+
- Ensure all OpenShift namespaces have a default deny-all policy for
76+
both egress and ingress defined, and identify those that do not
77+
(including `openshift-` namespaces managed by a non Red Hat
78+
operator)
7579

7680

7781
### Non-Goals
7882

7983
- We are not considering requiring the definition of Admin Network
80-
Policy for components (yet). But the documentation of the network
84+
Policy for components. But the documentation of the network
8185
connections that a namespace uses should make future development of
82-
Admin Network Policy easier. We will be using Admin Network Policy
83-
to allow cluster admins to override our namespace Network Policies
84-
if needed.
86+
Admin Network Policy easier should we desire it. We will be using
87+
Admin Network Policy to allow cluster admins to override our
88+
namespace Network Policies if needed. One of the reasons for not
89+
requiring core components to have Admin Network Policy is that then
90+
the operational complexity of managing them across upgrades would
91+
need to move to a third-party operator. Similarly, it is better to
92+
have the network policies near the code that uses them so that the
93+
team responsible for the objects develops and maintains the network
94+
policies.
8595

8696
- Adding policies for operators not created by Red Hat
8797

@@ -90,7 +100,7 @@ compromised pod can not be used as a springboard for other attacks.
90100

91101
1. Change the namespace admission controller so all namespaces with an
92102
openshift- prefix (since those are special anyway) are labeled with
93-
the openshift-namespace label so **that network policy can address
103+
the `security.openshift.io/openshift-namespace` label so **that network policy can address
94104
them**
95105

96106
2. Change the cluster-network-operator to apply the same label to all
@@ -123,22 +133,14 @@ compromised pod can not be used as a springboard for other attacks.
123133
chance to run (but that may break things installed from the operator
124134
catalog into the openshift namespace)
125135

126-
Issues:
127-
128-
- Need to work out a good way to say “can not talk to pods, only to
129-
external”. Right now it is ugly, it needs an ipblock rule with an
130-
‘except’ clause for all of the pod CIDRs… so an operator that needs
131-
that rule needs to read the config and maintain the policy
132-
133-
134136
### Workflow Description
135137

136138
**Cluster administrator** is a human user in charge of running a cluster.
137139

138140
**OpenShift developer** is a human responsible for creating and maintaining OpenShift.
139141

140142
**Third-Party developer** is a human who creates an operator that
141-
creates an openshift- namespace. This is assumed to be for
143+
creates an `openshift-` namespace. This is assumed to be for
142144
something extending OpenShift platform capabilities.
143145

144146
**Namespace Admission Controller** is a function in the OpenShift API
@@ -156,15 +158,15 @@ Issues:
156158

157159
2. The Namespace Admission Controller will look at the namespace name
158160

159-
3. If it starts with openshift- it will be treated as an OpenShift
161+
3. If it starts with `openshift-` it will be treated as an OpenShift
160162
namespace (since that namespace prefix has special meaning already
161163
elsewhere in the code)
162164

163165
1. The namespace object will be changed to have a label applied with
164-
the name openshift-namespace and the value “true”
166+
the name `security.openshift.io/openshift-namespace` and the value ''
165167

166-
4. If it does not start with openshift- then any
167-
openshift-namespace label will be stripped out and can not be set
168+
4. If it does not start with `openshift-` then any
169+
`security.openshift.io/openshift-namespace` label will be stripped out and can not be set
168170

169171

170172
#### Applying the label at upgrade
@@ -176,12 +178,18 @@ Issues:
176178

177179
1. Loop over all namespaces
178180

179-
2. If it sees a namespace starting with openshift-
181+
2. If it sees a namespace starting with `openshift-`
180182

181183
1. The namespace object will be changed to have a label applied
182-
with the name openshift-namespace and the value “true”
184+
with the name `security.openshift.io/openshift-namespace` and the value ""
183185

184-
3. Otherwise it will strip the “openshift-namespace” label
186+
3. Otherwise it will strip the `security.openshift.io/openshift-namespace` label
187+
188+
TODO: Decide if this is the correct behavior... do we want to allow
189+
namespaces to opt-in to being part of the platform. I do not think
190+
there is a security issue since we are just adding restrictions,
191+
but that needs more consideration. The advantage would be for
192+
things like ACS that do not install into an `openshift-` namespace.
185193

186194

187195
#### Opting Into a Default Deny for OpenShift
@@ -196,7 +204,7 @@ Issues:
196204

197205
#### Setting a Global Default Deny
198206

199-
1. The Cluster Administrator can deploy an Admin Network Policy we
207+
1. The Cluster Administrator can deploy an AdminNetworkPolicy we
200208
will document and test
201209

202210
2. The policy will change the default for all namespaces in the
@@ -206,7 +214,7 @@ Issues:
206214

207215
#### Removing Policy Restrictions for OpenShift
208216

209-
1. The Cluster Administrator can deploy an Admin Network Policy we
217+
1. The Cluster Administrator can deploy an AdminNetworkPolicy we
210218
will document with a public KCS and test
211219

212220
2. The policy will bypass Network Policy for all namespaces with the
@@ -257,9 +265,9 @@ Issues:
257265
### API Extensions
258266

259267
This extends the API server by changing the Admission Controller on
260-
namespace objects so that the label openshift-namespace is applied
268+
namespace objects so that the label `security.openshift.io/openshift-namespace` is applied
261269
or removed depending on whether the namespace name starts with
262-
openshift-.
270+
`openshift-`.
263271

264272
Other than that, there is no other API change.
265273

@@ -310,7 +318,7 @@ enhancement.
310318

311319
Almost every pod will need to have an egress policy to allow DNS.
312320
Would it be better to have one policy that can be enabled by a label?
313-
Or just have an admin network policy that just allows it.
321+
Or just have an AdminNetworkPolicy that just allows it.
314322

315323

316324
#### Host Network Pods
@@ -357,19 +365,6 @@ Admin Network Policy can be used to override our policies until a fix
357365
can be delivered in a z-stream.
358366

359367

360-
#### Policies Too Open
361-
362-
The converse can also happen… we may write a policy that a customer
363-
finds is too open, or they may wish to impose additional restrictions
364-
that we may allow in general (for instance, something could allow a
365-
webhook to be called off-cluster, but they may want to forbid all
366-
off-cluster traffic from the namespace since they do not use that
367-
feature).
368-
369-
Customers can write admin network policies that override the network
370-
policies that we ship.
371-
372-
373368
#### Challenges Debugging and Supporting
374369

375370
When a network policy blocks traffic, it may be blocking traffic of an
@@ -393,7 +388,7 @@ None foreseen.
393388

394389
- The existing e2e and integration tests should catch network policy errors where they are too restrictive
395390

396-
- We will need to add new tests to ensure that all openshift- namespaces have the default deny policy defined.
391+
- We will need to add new tests to ensure that all `openshift-` namespaces have the default deny policy defined.
397392

398393
- We should add a test that runs alongside the existing e2e tests to
399394
monitor for connections being blocked by network policy in openshift
@@ -404,11 +399,15 @@ None foreseen.
404399

405400
## Graduation Criteria
406401

407-
GA:
402+
### Dev Preview -> Tech Preview
403+
404+
We do not anticipate a dev preview or tech preview.
405+
406+
### Tech Preview -> GA
408407

409408
- Cluster Network Operator changes complete:
410409
- Namespace Admission controller change complete
411-
- Must-gather able to get all recent network policy connection blocks in openshift- namespaces
410+
- Must-gather able to get all recent network policy connection blocks in `openshift-` namespaces
412411
- Customers must be able to see network policy connection blocks using the observability tools
413412
- The test changes as described above must be complete
414413
- Documentation will be updated to describe how to:
@@ -417,14 +416,16 @@ GA:
417416
- Apply a default-deny rule to all cluster namespaces
418417
- Disable our policies in a KCS
419418

419+
### Removing a deprecated feature
420420

421-
## Upgrade / Downgrade Strategy
421+
If the feature is deprecated, then we will need to strip the labels we
422+
added and remove the code. The policies developed for the namespaces
423+
should remain.
422424

425+
## Upgrade / Downgrade Strategy
423426

424427
#### Upgrades:
425428

426-
427-
428429
1. The new API server will roll out and will start labeling namespaces
429430

430431
2. The Cluster Network Operator will be upgraded and upon restart it
@@ -460,6 +461,10 @@ At which point, the cluster administrator can use the new labels to easily apply
460461
have to define policies for the old flow and the new, but that would
461462
be atypical
462463

464+
## Operational Aspects of API Extensions
465+
466+
Not applicable. There will be no API change.
467+
463468

464469
## Support Procedures
465470

@@ -529,4 +534,14 @@ Ideas:
529534
stock one to allow DNS and API access and nothing else?
530535

531536
- Should we allow everything to get DNS access? Is there ever a need
532-
not to?
537+
not to?
538+
539+
- Need to work out a good way to say “can not talk to pods, only to
540+
external”. Right now it is ugly, it needs an ipblock rule with an
541+
‘except’ clause for all of the pod CIDRs… so an operator that needs
542+
that rule needs to read the config and maintain the policy.
543+
544+
Or we may define a global ANP that allows namespaces labelled with
545+
`security.openshift.io/openshift-namespace` to label pods that need
546+
this rule applied.
547+

0 commit comments

Comments
 (0)