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

Fix for the false positive of access-control's capabilities tcs. #2352

Conversation

greyerof
Copy link
Contributor

The forbidden capabilities test cases in access-control test suite are giving false positives. The code was stringifying the whole "capabilities" field and searching for the capability in the resulting string, which led to false positives when the capability was set in the "drop" list, as we've seen in a partner.

The new code checks whether it was explicitly set in the Add list directly, matching by capability name or by "ALL".

The forbidden capabilities test cases in access-control test suite are
giving false positives. The code was stringifying the whole
"capabilities" field and searching for the capability in the resulting
string, which led to false positives when the capability was set in the
"drop" list, as we've seen in a partner.

The new code checks whether it was explicitly set in the Add list
directly, matching by capability name or by "ALL".
tests/accesscontrol/suite_test.go Outdated Show resolved Hide resolved
@sebrandon1 sebrandon1 merged commit 6179120 into redhat-best-practices-for-k8s:main Aug 19, 2024
25 of 26 checks passed
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