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

genpolicy: add support for runAsUser #153

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Conversation

danmihai1
Copy link

Add policy support for SecurityContext and PodSecurityContext runAsUser.

Also, remove outdated UID rule workaround.

Add policy support for SecurityContext and PodSecurityContext
runAsUser.

Also, remove outdated UID rule workaround.

Fixes: kata-containers#8879

Signed-off-by: Dan Mihai <[email protected]>
Update samples after adding support for runAsUser.

Signed-off-by: Dan Mihai <[email protected]>
@danmihai1 danmihai1 requested review from Redent0r and arc9693 January 23, 2024 05:41
@danmihai1 danmihai1 requested review from a team as code owners January 23, 2024 05:41
process.User.UID = uid.try_into().unwrap();
}
if let Some(allow) = context.allowPrivilegeEscalation {
process.NoNewPrivileges = !allow
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this compile with the missing semicolon? I'm guessing Rust considers this as a void expression?

Copy link
Author

Choose a reason for hiding this comment

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

It does - even the make check below passed.

I would rather change this in a future PR, to avoid re-testing. I agree it looks odd, and it wasn't intentional. I forgot it in there because this code used to look a bit differently:

        process.NoNewPrivileges = if let Some(allow) = context.allowPrivilegeEscalation {
            !allow
        } else {
            // something else that we don't need here
        };

@sprt sprt added the upstream/missing PRs that are yet to be upstreamed label Jan 23, 2024
@danmihai1 danmihai1 merged commit 5799fdf into msft-main Jan 24, 2024
45 of 58 checks passed
@danmihai1 danmihai1 deleted the danmihai1/run-as-user branch April 26, 2024 22:05
@Redent0r Redent0r added upstream/merged PRs that have been merged upstream and removed upstream/missing PRs that are yet to be upstreamed labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream/merged PRs that have been merged upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants