Skip to content

Add CI runner hardening audit#704

Open
arussell-nvidia wants to merge 2 commits into
mainfrom
codex/cxr-3779-runner-hardening
Open

Add CI runner hardening audit#704
arussell-nvidia wants to merge 2 commits into
mainfrom
codex/cxr-3779-runner-hardening

Conversation

@arussell-nvidia

@arussell-nvidia arussell-nvidia commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a GitHub Actions audit that rejects CI configuration introducing privileged Docker, Docker socket mounts, or Unix Docker host access.
  • Pin checkout to the resolved actions/checkout@v6 SHA and disable persisted checkout credentials.
  • Establish a repository-side guardrail against future workflow changes that would grant jobs Docker host access.

Validation

  • SKIP=check-copyright-year pre-commit run --all-files

Notes

This guards the Isaac Teleop repository configuration. Runner provisioning changes outside this repository are handled separately by the runner owners.

Summary by CodeRabbit

  • New Features
    • Added a new CI audit workflow that runs on pull requests, pushes to main/release branches, and manual triggers.
    • The audit checks workflow and action files for Docker host-access settings and fails the run if risky configurations are found.
    • In-progress pull request audits are now automatically canceled when new commits are pushed.

Signed-off-by: Andrew Russell <arussell@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new GitHub Actions workflow that runs on pull requests, pushes to main and release/*.*.x, and manual dispatch. It checks out the repository, searches .github/workflows, .github/actions, and optionally .gitlab-ci.yml for privileged Docker and socket-access patterns, prints matches, and fails when any are found.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a CI runner hardening audit workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cxr-3779-runner-hardening

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci-runner-hardening.yml:
- Around line 57-65: The deny-pattern list in the CI hardening workflow is
missing the equivalent Docker socket path, so audit checks can be bypassed via
/run/docker.sock. Update the pattern set used by the workflow’s
socket-blocking/audit logic to include /run/docker.sock alongside the existing
/var/run/docker.sock entry, keeping the change in the same denylist section that
references docker.sock and DOCKER_HOST patterns.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 948bdebe-fe71-4f4e-a61c-13aa492cad4e

📥 Commits

Reviewing files that changed from the base of the PR and between 3276b5c and 8e28141.

📒 Files selected for processing (1)
  • .github/workflows/ci-runner-hardening.yml

Comment on lines +57 to +65
--privileged
/var/run/docker.sock
docker.sock:
docker.sock=
docker.sock/
privileged: true
DOCKER_HOST=unix://
DOCKER_HOST: unix://
PATTERNS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Add /run/docker.sock to deny patterns to prevent audit bypass.

The audit currently blocks /var/run/docker.sock but misses /run/docker.sock, which allows equivalent Docker host socket access to pass undetected.

Suggested patch
         --privileged
         /var/run/docker.sock
+        /run/docker.sock
         docker.sock:
         docker.sock=
         docker.sock/

As per path instructions, .github/workflows/**: “Focus on security (secret handling, permissions) and correctness of build/test steps.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
--privileged
/var/run/docker.sock
docker.sock:
docker.sock=
docker.sock/
privileged: true
DOCKER_HOST=unix://
DOCKER_HOST: unix://
PATTERNS
--privileged
/var/run/docker.sock
/run/docker.sock
docker.sock:
docker.sock=
docker.sock/
privileged: true
DOCKER_HOST=unix://
DOCKER_HOST: unix://
PATTERNS
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-runner-hardening.yml around lines 57 - 65, The
deny-pattern list in the CI hardening workflow is missing the equivalent Docker
socket path, so audit checks can be bypassed via /run/docker.sock. Update the
pattern set used by the workflow’s socket-blocking/audit logic to include
/run/docker.sock alongside the existing /var/run/docker.sock entry, keeping the
change in the same denylist section that references docker.sock and DOCKER_HOST
patterns.

Source: Path instructions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in de5fbc7: added /run/docker.sock to the denylist next to /var/run/docker.sock so the audit catches both common Docker socket paths.

Signed-off-by: Andrew Russell <arussell@nvidia.com>
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.

1 participant