Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-550-Update-default-deny #1230

Conversation

bmckercher123
Copy link
Contributor

@bmckercher123 bmckercher123 commented Dec 29, 2023

Fix wording around default deny policy for OSS.

Product Version(s):
All OSS active versions

Issue:
https://tigera.atlassian.net/browse/DOCS-550 and discussion: https://tigera.slack.com/archives/CGMG75AUV/p1656880509050909

Link to docs preview:
https://deploy-preview-1230--tigera.netlify.app/calico/latest/network-policy/get-started/kubernetes-default-deny

SME review:

  • An SME has approved this change.

DOCS review:

  • A member of the docs team has approved this change.

Additional information:

Merge checklist:

  • Deploy preview inspected wherever changes were made
  • Build completed successfully
  • Test have passed

@bmckercher123 bmckercher123 requested a review from fasaxc December 29, 2023 23:07
@bmckercher123 bmckercher123 requested a review from a team as a code owner December 29, 2023 23:07
Copy link

netlify bot commented Dec 29, 2023

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 48a9505
🔍 Latest deploy log https://app.netlify.com/sites/calico-docs-preview-next/deploys/65b16be9234a2800084b8548
😎 Deploy Preview https://deploy-preview-1230--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 67 (🟢 up 13 from production)
Accessibility: 93 (no change from production)
Best Practices: 92 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 29, 2023

Deploy Preview succeeded!

Name Link
🔨 Latest commit 48a9505
🔍 Latest deploy log https://app.netlify.com/sites/tigera/deploys/65b16be98375d80008cbd4d0
😎 Deploy Preview https://deploy-preview-1230--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 51 (🟢 up 5 from production)
Accessibility: 93 (no change from production)
Best Practices: 83 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@bmckercher123
Copy link
Contributor Author

@fasaxc Ideally, we should have an OSS version of this doc (https://docs.tigera.io/calico-enterprise/3.18/network-policy/default-deny), but it would take more work. Consider this a short-term fix.

@bmckercher123 bmckercher123 requested a review from ctauchen January 2, 2024 17:06

We recommend creating an implicit default deny policy for your Kubernetes pods, regardless of whether you use {{prodname}} or Kubernetes network policy. This ensures that unwanted traffic is denied by default. Note that implicit default deny policy always occurs last; if any other policy allows the traffic, then the deny does not come into effect. The deny is executed only after all other policies are evaluated.
We recommend that you create a {{prodname}} default deny policy (network policy with a `Deny` rule) for your Kubernetes pods shortly after installing {{prodname}}. This policy prevents pods without policy, incorrect policy, empty policy, and {{prodname}} policy for non-workload endpoints, from allowing traffic until you can put policies in place and test them. After you write policy for the traffic that you want to allow in the cluster, we recommend that you create a *global default deny policy* to secure your deployment. In short, creating a default deny policy covers security gaps without you having to remember default deny/allow behavior of Kubernetes and {{prodname}} policies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example below doesn't agree with this. Here it says "with a Deny rule" but below, there is no Deny rule. The policy below has no rules at all!

That's because the policy below is only added for its side effect... The default policy action (allow/deny) is:

  • Allow, if your workload has no policy at all.
  • Deny, if your policy has any policy at all.

Adding an empty policy has the side effect of triggering the above "Deny, if your policy has any policy at all" but the policy has no rules in it, so it doesn't matter what order it has because no packets can ever match the policy, only its side-effect.

@bmckercher123 bmckercher123 force-pushed the DOCS-550-Implicit-default-deny branch from 8659baa to 48a9505 Compare January 24, 2024 19:58
@bmckercher123
Copy link
Contributor Author

@fasaxc Your last comment reminded me why this doc required a total rewrite (not just a quick fix). I've rewritten the doc based on this CE doc (https://docs.tigera.io/calico-enterprise/latest/network-policy/default-deny). The CE doc refers to using staged policy so I just reworded to "test environment."

@ctauchen
Copy link
Collaborator

@fasaxc PTAL. Looks like Barbara pushed a revision to your latest comment. If this is good now, I'll merge and make the same changes to other OSS versions.

@ctauchen
Copy link
Collaborator

Closing and replacing with #1371

@ctauchen ctauchen closed this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants