Skip to content

🛡️ Sentinel: Security hardening and workflow fixes#110

Merged
amrabed merged 3 commits into
mainfrom
sentinel/security-hardening-16241376048782602464
Jul 3, 2026
Merged

🛡️ Sentinel: Security hardening and workflow fixes#110
amrabed merged 3 commits into
mainfrom
sentinel/security-hardening-16241376048782602464

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🚨 Severity: MEDIUM
💡 Vulnerability:

  • Lack of timeouts in subprocess calls in scripts/init.py (DoS/Hanging risk).
  • Incorrect actions/checkout version (v7) in GitHub Actions workflows.
  • Missing security-related linting rules.

🎯 Impact:

  • Initialization script could hang indefinitely.
  • CI/CD pipelines could fail or be vulnerable to tag squatting.
  • Code quality and security issues might go undetected.

🔧 Fix:

  • Added timeout=5 and exception handling to subprocess calls.
  • Reverted actions/checkout to @v4.
  • Enabled B, TRY, and PTH rules in Ruff.
  • Migrated scripts/init.py to pathlib for better path handling and fixed closure capture bugs in regex replacements.

✅ Verification:

  • Ran uv run ruff check . and uv run coverage run -m pytest ..
  • Verified all tests pass and lint errors are resolved.

PR created automatically by Jules for task 16241376048782602464 started by @amrabed

- Add timeout=5 to subprocess calls in scripts/init.py to prevent hanging.
- Revert actions/checkout version to stable @v4 in GitHub workflows.
- Enable additional Ruff security and quality rules (B, TRY, PTH).
- Fix existing lint issues by migrating to pathlib in scripts/init.py and ignoring TRY003.
- Create security journal with critical learnings.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Improve email regex in scripts/init.py to resolve SonarCloud warning.
- Refactor scripts/init.py into modular functions to improve maintainability and resolve B-rating Quality Gate failure.
- Ensure all subprocess calls have timeouts and proper exception handling.
- Maintain stable actions/checkout@v4 in workflows.
- Keep stricter Ruff security rules enabled.
Comment thread .github/workflows/check.yml Outdated
Comment thread .github/workflows/docs.yml Outdated
- Revert actions/checkout version to v7 in check.yml and docs.yml.
- Address PR comments regarding the version change.
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@amrabed amrabed marked this pull request as ready for review July 3, 2026 10:33
@amrabed amrabed merged commit b51a408 into main Jul 3, 2026
5 checks passed
@amrabed amrabed deleted the sentinel/security-hardening-16241376048782602464 branch July 3, 2026 10:34
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