Skip to content

🐛 (fix) PSA enforcement: Move from baseline to restricted #1829

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

Merged

Conversation

camilamacedo86
Copy link
Contributor

Namespaces should be restricted by default instead of have granted additional not required permissions

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@camilamacedo86 camilamacedo86 requested a review from a team as a code owner March 3, 2025 16:55
Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit f86d3f4
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/67c71c21764407000891283b
😎 Deploy Preview https://deploy-preview-1829--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@@ -3,6 +3,6 @@ kind: Namespace
metadata:
labels:
app.kubernetes.io/part-of: olm
pod-security.kubernetes.io/enforce: baseline
pod-security.kubernetes.io/enforce: restricted
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joelanford ^ JFY

Copy link
Contributor

Choose a reason for hiding this comment

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

@camilamacedo86 can you identify which, if any, current e2e test might be able to verify this doesn't cause a problem? Maybe just?:

in ./kind-config.yaml Should we turn on PodSecurity?

    kubeadmConfigPatches:
      - |
        kind: ClusterConfiguration
        apiServer:
            extraArgs:
-              enable-admission-plugins: OwnerReferencesPermissionEnforcement
+              enable-admission-plugins: OwnerReferencesPermissionEnforcement,PodSecurity

Copy link
Contributor

Choose a reason for hiding this comment

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

e2e seems to pass for me with this set, so maybe it's all good?

Copy link
Contributor

Choose a reason for hiding this comment

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

just trying to verify it's really used if I set it there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we install OLMv1 the ns will be set within right
So, the tests running on that. But do you still want any extra step? if so, can you please clarify? Sorry, I could not follow what are you asking for I do in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

nvm, seems like at our current version enforced for Kind, we've got PodSecurity by default. Verified it bounced a non-compliant pod trying to be created in an NS set restricted. Since our current e2e do deployment, they must be okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, are you ok with this change as well? Right?

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.42%. Comparing base (c899dc1) to head (f86d3f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1829      +/-   ##
==========================================
- Coverage   68.44%   68.42%   -0.02%     
==========================================
  Files          63       63              
  Lines        5134     5134              
==========================================
- Hits         3514     3513       -1     
- Misses       1390     1391       +1     
  Partials      230      230              
Flag Coverage Δ
e2e 51.57% <ø> (ø)
unit 56.01% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

perdasilva
perdasilva previously approved these changes Mar 4, 2025
@perdasilva perdasilva added this pull request to the merge queue Mar 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Mar 4, 2025
@camilamacedo86 camilamacedo86 enabled auto-merge March 4, 2025 11:54
@camilamacedo86
Copy link
Contributor Author

I need to rebase this one,
Could we get the approval again :-) ?
@perdasilva

Namespaces should be restricted by default rather than granted additional, unnecessary permissions.
@camilamacedo86 camilamacedo86 added this pull request to the merge queue Mar 4, 2025
Merged via the queue into operator-framework:main with commit 04a2b45 Mar 4, 2025
19 of 20 checks passed
@camilamacedo86 camilamacedo86 deleted the fix-psa-level branch March 4, 2025 17:16
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.

4 participants