Skip to content

[CI][Docker] Restrict the container venv to group writes and check wheel metadata without installing packages - #9347

Open
hujc7 wants to merge 3 commits into
isaac-sim:mainfrom
hujc7:jichuanh/sonar-ci-container-perms
Open

hujc7 wants to merge 3 commits into
isaac-sim:mainfrom
hujc7:jichuanh/sonar-ci-container-perms

Conversation

@hujc7

@hujc7 hujc7 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the four SonarQube vulnerabilities deferred from the 3.0.0 GA. The Docker images no longer make the virtual environment world-writable, and the release wheel metadata check no longer installs an unlocked package.

Description

Fixes NVBug 6937519

  1. Docker venv permissions (S2612, Dockerfile.base and Dockerfile.curobo). The images made the venv's lib and bin world-writable so that CI, which runs the image as the runner's uid, could install test-only packages. They are now writable by group 1000, the venv's group, and the CI docker run calls (run_tests.sh, multi_gpu_host_launcher.sh) add --group-add 1000.
  2. Release metadata check (S8544, S8541, wheel.yml). The check installed packaging from the index, unpinned and with source builds allowed, only to find direct URL requirements. It now uses the standard library, since PEP 508 puts a direct reference's @ before any marker, and runs with python3, so the step installs nothing.
  3. S131 (isaaclab.sh) no longer applies: Make uv the only installation workflow #8128 removed the file.

Tests:

  • In isaac-lab:latest-main with world-write removed from the venv, uid 4321 in group 1000 installs a package and uid 4322 outside it gets EACCES.
  • test_pypi_metadata_validator_rejects_direct_urls: 4 passed, with two marker and extras cases added. With python3 -I -S, the script accepts registry pins and rejects URL, URL with extras and marker, and Git URL requirements.
  • Not run locally: the full image build and the CI --user path; this PR's CI runs both.

Not changed: wheel.yml also runs uv run --no-project --python 3.12 --with pytest for the resolution test. It was added in #8905 after the scan and falls under the same rule; locking it needs a dependency group in uv.lock, so it is left for a follow-up.

Suggested reviewer: kellyguo11 (filed the deferral).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Release backport

  • Backport this pull request to the active release branch after it merges into main

Screenshots

Not applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • No documentation change is needed: only CI and the Docker images change
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package: a .skip fragment, since only a test changes
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

hujc7 added 3 commits December 1, 2026 12:25
…a check

The Docker images made the venv lib and bin world-writable so CI, which
runs the image as the runner's uid, could install test-only packages into
it. Make them writable by the isaaclab group (gid 1000) instead, and add
that group to the CI containers with --group-add 1000.

The PyPI metadata check resolved the newest packaging release and allowed
source builds. Pin it to the locked version and pass --no-build.
The release metadata check installed packaging from the index at run
time, so its only lock was a version pin: SonarQube S8544 asks for a
dependency locked to verified hashes. The check needs packaging only to
find direct URL requirements, which PEP 508 writes as "name @ url"
before any marker. Detect that with the standard library and run the
script with the runner's python3, so the step installs nothing.
@github-actions github-actions Bot added isaac-lab Related to Isaac Lab team infrastructure labels Dec 2, 2026
@hujc7
hujc7 marked this pull request as ready for review December 2, 2026 16:08
@hujc7
hujc7 requested a review from a team December 2, 2026 16:08
@hujc7

hujc7 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Dec 2, 2026

@isaaclab-review-bot isaaclab-review-bot 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.

Isaac Lab Review Bot

Needs attention: Implementation (1). Other reviewed categories look good.

  • PR description: The title and security scope match the diff, but the documentation checklist omits tooling changes; correct that wording and keep image-build and host-UID validation marked pending, with no performance comparison needed.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: The string search accepts malformed requirements such as torch==, allowing invalid metadata through the release gate; restore PEP 508 syntax validation without an unlocked installation.
  • Style consistency: Style consistency looks good.
  • Test quality: Test quality looks good.

Significant concerns. Posted 1 inline finding.

Automated review; human maintainers own approval decisions.

# A PEP 508 direct reference is "name [extras] @ url [; marker]": its "@" comes before the marker, where a
# registry requirement has none. Standard library only, so the release check installs nothing.
requirements = metadata.get_all("Requires-Dist", [])
direct_urls = [requirement for requirement in requirements if "@" in requirement.split(";")[0]]

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.

🔴 Critical · Implementation — Keep validating requirement syntax

Malformed Requires-Dist values such as torch== now pass because they contain no @; Requirement previously rejected them. The release gate can approve invalid metadata. Use a locked, offline PEP 508 parser.

@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR limits venv writes to the owning group and removes the package installation from the release metadata check.

  • CI test containers write to the virtual environment through group 1000.
  • Release wheel checks reject direct URLs without installing a helper package.

Acknowledged deferral: hujc7 explicitly leaves the existing unlocked pytest installation in wheel.yml for a follow-up because locking it requires a dependency group in uv.lock.

Reviews (1) · Last reviewed commit: "Check release wheel metadata without ins..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant