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

security requirements of the container-native operators #1967

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shimritproj
Copy link
Contributor

@shimritproj shimritproj commented Apr 8, 2024

Issue Link
https://issues.redhat.com/browse/CNFCERT-882?filter=-1

This PR includes 4 operator test cases.

  • testOperatorRunAsUserID(): This test verifies that no pods managed by operators run with the root user ID (UID) of 0, which could introduce security vulnerabilities.

  • testOperatorRunAsNonRoot(): This test ensures that pods managed by operators adhere to security best practices by running as non-root users.

  • testOperatorAutomountTokens(): This test evaluates the configuration of automount service tokens in pods managed by operators.

  • testOperatorReadOnlyFilesystem(): This test verifies whether containers within pods managed by operators have a read-only root filesystem, enhancing security by preventing unauthorized modifications.

We get pods of all operators and then test the above conditions.

In addition, the 'rbac' folder moved into the 'common' folder because it is used by functions in many places in the code, and we want to avoid duplicating code.

@dcibot
Copy link
Collaborator

dcibot commented Apr 8, 2024

cnf-certification-test/operator/suite.go Outdated Show resolved Hide resolved
cnf-certification-test/operator/suite.go Outdated Show resolved Hide resolved
cnf-certification-test/identifiers/identifiers.go Outdated Show resolved Hide resolved
cnf-certification-test/identifiers/doclinks.go Outdated Show resolved Hide resolved
pkg/provider/containers.go Show resolved Hide resolved
pkg/provider/pods.go Show resolved Hide resolved
@ramperher
Copy link
Collaborator

@shimritproj could you add this new test to the CATALOG.md? Thanks

@test-network-function test-network-function deleted a comment from bnshr Apr 24, 2024
@shimritproj shimritproj force-pushed the securityOperators branch 6 times, most recently from b9b2eb3 to 1deda2b Compare May 1, 2024 13:13
@dcibot
Copy link
Collaborator

dcibot commented May 5, 2024

@ramperher
Copy link
Collaborator

ramperher commented May 7, 2024

from change #1967:

Don't know if it's expected, but the four new tests added in this change are all skipped in this DCI job. Are they behaving properly?

@dcibot
Copy link
Collaborator

dcibot commented May 7, 2024

@bnshr
Copy link
Contributor

bnshr commented May 7, 2024

@shimritproj Could you please move the description of the functions as code comments?

cnf-certification-test/operator/suite.go Outdated Show resolved Hide resolved
cnf-certification-test/operator/suite.go Outdated Show resolved Hide resolved
@shimritproj
Copy link
Contributor Author

from change #1967:

Don't know if it's expected, but the four new tests added in this change are all skipped in this DCI job. Are they behaving properly?

I am aware of the issue and actively working on it. This is why I indicated that the PR is still a work in progress and not yet ready for review. @ramperher

@shimritproj shimritproj force-pushed the securityOperators branch 3 times, most recently from 5854570 to 4c5443a Compare May 20, 2024 17:56
@shimritproj shimritproj force-pushed the securityOperators branch 2 times, most recently from 52df14d to 1ec1c62 Compare May 29, 2024 17:59
cnf-certification-test/operator/suite.go Outdated Show resolved Hide resolved
…ve operators

checks:
USER id should not be 0

readOnlyRootFilesystem = true

runAsNonRoot = true

automount service account token = false{}
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.

None yet

7 participants