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

SCC fixes #1340

Merged
merged 1 commit into from
Apr 18, 2024
Merged

SCC fixes #1340

merged 1 commit into from
Apr 18, 2024

Conversation

tangledbytes
Copy link
Member

@tangledbytes tangledbytes commented Apr 10, 2024

Explain the changes

This Pr introduces some "security" fixes which were done on the request of one of the NooBaa customer.

These changes were submitted to QE for preliminary testing. The initial testing failed as noobaa-endpoint had issue due to read-only root filesystem. IIRC, this was later on removed and the preliminary tests completed successfully. Hence this PR, has 3 changes which were not submitted to QE back then:

  • Removes read-only root filesystem for noobaa-endpoint (as QE found issue with this)

  • Adds a change for noobaa agent which was not possible to test earlier because we provision pods and pods can't be patched once created (other than container image).

  • Danny had some changes in the PG DB sts, this PR accommodates those changes (which were not there as the initial work was done on top of 5.14).

  • Doc added/updated

  • Tests added

@tangledbytes tangledbytes force-pushed the utkarsh/fix/sccs branch 3 times, most recently from 53c7ba2 to 22455fe Compare April 15, 2024 11:11
@tangledbytes
Copy link
Member Author

Tested on OpenShift. Test steps:

  1. Have OpenShift 🤷
  2. Create all three SCCs that are part of this PR.
  3. Install NooBaa operator (and only operator - I no longer recall why I just installed operator first)
  4. Create noobaa resource and CRDs (nb install -n noobaa)
  5. Check that the installation succeeded and BS and BC is ready.
  6. Check that nothing is in CLBO (for ~ 5mins).

@tangledbytes
Copy link
Member Author

NOTE: This PR adds a new SCC (for the operator itself) but that SCC is not being deployed by default (at least in the PR). Do we need do that as well @nimrod-becker?

deploy/role.yaml Outdated
@@ -132,3 +140,4 @@ rules:
- '*'
verbs:
- '*'

Copy link
Contributor

Choose a reason for hiding this comment

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

remove this so it can be removed also in deploy.go

@@ -10,6 +10,11 @@ allowHostPID: false
allowHostPorts: false
allowPrivilegedContainer: false
readOnlyRootFilesystem: false
allowedCapabilities:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? As we don't ask for these capabilities in statefulset-postgres-db.yaml

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, maybe we don't. I just tested the entire thing on openshift without this in place and it worked just fine. Will remove this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested it on 4.16 cluster as well (previously only on minishift).

@nimrod-becker
Copy link
Contributor

@tangledbytes I think we need to, otherwise we won't fix the security scanning right?

@tangledbytes
Copy link
Member Author

It seems that OLM does not support SCC deployment for operators right now, so we cannot really do it here (I mean we can but then NooBaa operator will create an SCC for itself, which is weird). They have an open issue for it - operator-framework/operator-lifecycle-manager#1547.

The above issue was opened by a Rook member (my guess) and they handle this right now by provisioning SCCs in the OCS operator here - https://github.com/red-hat-storage/ocs-operator/blob/main/controllers/ocsinitialization/sccs.go.

Given the above, I think we can merge this PR and I will open a PR in the OCS operator to make sure that just like for Rook, we have a SCC for noobaa operator as well there.

Any comments @jackyalbo?

Signed-off-by: Utkarsh Srivastava <[email protected]>

include pod agent change

Signed-off-by: Utkarsh Srivastava <[email protected]>

make gen-api

Signed-off-by: Utkarsh Srivastava <[email protected]>

update deploy.go

Signed-off-by: Utkarsh Srivastava <[email protected]>

address PR comments

Signed-off-by: Utkarsh Srivastava <[email protected]>
@tangledbytes
Copy link
Member Author

tangledbytes commented Apr 18, 2024

Merging this for now. Will create the required PR in OCS as next steps.

@tangledbytes tangledbytes merged commit fcc5240 into noobaa:master Apr 18, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants