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

Create a policy to detect 'oc debug' #108

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

shaneboulden
Copy link
Contributor

@shaneboulden shaneboulden commented Sep 28, 2024

Adds a new policy to detect attempts to access pods using oc debug.

Note that oc debug doesn't invoke kubectl exec or similar commands to access the pod, instead creating a new debug pod configured the same as the original pod. For this reason we need to look at process activity inside pods (that look like /bin/sh or /bin/bash), and account for the ability of users to customise the shell via oc debug --shell.

Ideally we would distinguish this activity based on pod name or pod annotations like debug.openshift.io/source-container, but this is not currently possible for runtime policies. Instead we label this as "Possible oc debug activity", and guide users towards the OpenShift audit logs for validation.

@github-actions github-actions bot added the external-contributor To add to issues and PRs from external contributors label Sep 28, 2024
@SimonBaeumer SimonBaeumer merged commit 812bc99 into stackrox:main Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor To add to issues and PRs from external contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants