Skip to content

Harden amlsecscan scheduled entrypoint ownership - #4046

Merged
kingernupur merged 7 commits into
Azure:mainfrom
nlydick:fix-amlsecscan-root-cron-eop
Jul 14, 2026
Merged

Harden amlsecscan scheduled entrypoint ownership#4046
kingernupur merged 7 commits into
Azure:mainfrom
nlydick:fix-amlsecscan-root-cron-eop

Conversation

@nlydick

@nlydick nlydick commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Hardens the Azure ML Compute Instance security scanner installation layout so scheduled root execution does not depend on files in a user-owned directory.

This change:

  • Keeps the scanner execution directory and cron entrypoint root-owned.
  • Installs a root-owned copy of amlsecscan.py and has run.sh execute that trusted copy.
  • Keeps config.json root-owned and world-readable.
  • Moves generated scan artifacts to /var/lib/amlsecscan.
  • Adds regression coverage for the hardened install layout.
  • Updates scanner documentation with the new installed layout.

Validation

python -m py_compile .\setup\setup-ci\security-scanner\amlsecscan.py
python -m pytest .\setup\setup-ci\security-scanner\tests\test_amlsecscan.py

Result: 11 passed, 2 skipped.

savitamittal1
savitamittal1 previously approved these changes Jul 2, 2026
kingernupur
kingernupur previously approved these changes Jul 10, 2026
nlydick and others added 2 commits July 10, 2026 01:05
Preserve trusted installations during package setup and stage root-owned scanner files with rollback before switching the cron schedule.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reconcile the published formatting and /etc commit with the tested /opt installation layout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nlydick
nlydick dismissed stale reviews from kingernupur and savitamittal1 via 9c711ca July 10, 2026 08:07
@nlydick

nlydick commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

kingernupur This PR is approved on the current head (9c711caefbb8065d7b49a431dfeec3cc3cf67ef4), all required checks are green, and GitHub reports it CLEAN/MERGEABLE. My nlydick account has READ access to the upstream repo and GitHub rejected both direct merge and auto-merge. Could you please squash-merge it?

@kingernupur
kingernupur merged commit 7eee991 into Azure:main Jul 14, 2026
4 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.

4 participants