Skip to content

Conversation

ibihim
Copy link
Contributor

@ibihim ibihim commented Apr 8, 2024

What type of PR is this?

/kind enhancement

What does this PR do / why we need it:

Add pod security policy restricted to the openshift-gitops namespace.

openshift-prefixed namespaces are not managed by the pod security policy sync controller, which sets pod security labels automatically for the users. It is expected that openshift namespaces consciously pick their security stance.

This means, that if pod security labels are not set, the defaults from the global config are being applied, which are set to restricted.

I am adding the SCC restricted-v2, such that the necessary SecurityContext should be set by SCC mutation.

It is related to the PR to upstream: argoproj-labs/argocd-operator#1288.

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

  • Workloads should work as before.
  • openshift-gitops namespace should have the labels set in this PR.

@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Apr 8, 2024
@openshift-ci openshift-ci bot requested review from jannfis and jgwest April 8, 2024 17:06
Copy link

openshift-ci bot commented Apr 8, 2024

Hi @ibihim. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

iam-veeramalla
iam-veeramalla previously approved these changes Apr 10, 2024
Copy link
Contributor

@iam-veeramalla iam-veeramalla left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@ibihim
Copy link
Contributor Author

ibihim commented Apr 26, 2024

/retest-required

Copy link

openshift-ci bot commented Apr 26, 2024

@ibihim: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

ibihim added 2 commits April 29, 2024 19:00
It is recommended to pin the SCC required for the Pods. It can occur
that a customer specifies a SCC that has a higher priority than
required-v2, which could lead to failing workloads in the namespace.
@ibihim ibihim force-pushed the pod-security-admission-restricted branch from 1b96e1c to de49bcf Compare April 29, 2024 17:01
@openshift-ci openshift-ci bot removed the lgtm label Apr 29, 2024
@svghadi
Copy link
Member

svghadi commented May 17, 2024

/ok-to-test

@iam-veeramalla
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm label May 29, 2024
@openshift-ci openshift-ci bot removed the lgtm label May 29, 2024
@iam-veeramalla
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm label May 29, 2024
Copy link

openshift-ci bot commented May 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iam-veeramalla

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@svghadi
Copy link
Member

svghadi commented May 30, 2024

/test v4.13-e2e

@openshift-ci openshift-ci bot removed the lgtm label May 30, 2024
@svghadi
Copy link
Member

svghadi commented May 30, 2024

/retest

@svghadi
Copy link
Member

svghadi commented May 30, 2024

/test v4.14-e2e

@svghadi
Copy link
Member

svghadi commented May 30, 2024

/retest

@svghadi
Copy link
Member

svghadi commented May 30, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label May 30, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 3d9d30d into redhat-developer:master May 30, 2024
trdoyle81 pushed a commit to trdoyle81/gitops-operator that referenced this pull request Aug 13, 2024
…loper#674)

* controllers: add psa labels to ns

* controllers: add SCC pinning to Pods

It is recommended to pin the SCC required for the Pods. It can occur
that a customer specifies a SCC that has a higher priority than
required-v2, which could lead to failing workloads in the namespace.

---------

Co-authored-by: Siddhesh Ghadi <[email protected]>
Co-authored-by: Abhishek Veeramalla <[email protected]>
// Set pod security policy, which is required for namespaces pre-fixed with openshift
// as the pod security label syncer doesn't set them on OCP namespaces.
objectMeta.Labels["pod-security.kubernetes.io/enforce"] = "restricted"
objectMeta.Labels["pod-security.kubernetes.io/enforce-version"] = "v1.29"
Copy link
Member

Choose a reason for hiding this comment

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

Hi @ibihim, just trying to understand this change. Was there any special reason to set it to v1.29 and not latest?

@ibihim
Copy link
Contributor Author

ibihim commented Jan 28, 2025

Hi, yes. latest is better. at the moment in time, we used a fixed version in openshift, but we moved now ahead to latest.

@svghadi
Copy link
Member

svghadi commented Jan 29, 2025

Thanks for the confirmation @ibihim . Will update it to latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants