-
Notifications
You must be signed in to change notification settings - Fork 74
Security and robustness hardening #30
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
def75c1
Security and robustness hardening pass
lightos 00bec71
Merge main into hardening-review
lightos 36609de
Document the Panoptic LFI testbed
lightos 8dd1977
Update GitHub Actions runtimes
lightos c3c9b19
Fix minimum-version CI isolation
lightos eef07b7
Address hardening review findings
lightos 30a2c6f
Prevent hook dependency downloads
lightos 8e5dd95
Use canonical pre-commit checks
lightos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| *.py text eol=lf | ||
|
|
||
| panoptic/data/*.csv whitespace=cr-at-eol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
| # Pre-commit hook for Panoptic | ||
| # | ||
| # This hook delegates to the pre-commit framework for consistent tool configuration. | ||
| # The canonical check definitions are in .pre-commit-config.yaml. | ||
| # | ||
| # Setup options: | ||
| # Option A (recommended): Use pre-commit framework directly | ||
| # pip install pre-commit && pre-commit install | ||
| # | ||
| # Option B: Use this script via git config | ||
| # git config core.hooksPath .githooks | ||
| # | ||
| # Option C: Copy to .git/hooks | ||
| # cp .githooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit | ||
|
|
||
| # All setup options require the pre-commit package. Keeping one execution path | ||
| # ensures the pinned hooks and arguments in .pre-commit-config.yaml are always | ||
| # used, including Ruff fixes, formatting, strict mypy, Markdown linting, and the | ||
| # project dependency audit. | ||
| if ! command -v pre-commit >/dev/null 2>&1; then | ||
| echo "Error: pre-commit is required to run the Panoptic checks." >&2 | ||
| echo "Install it with: python -m pip install pre-commit" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| exec pre-commit run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Lower bounds of the declared runtime dependencies (see pyproject.toml). | ||
| # Used by the "minimum-versions" CI job to prove Panoptic works against the | ||
| # oldest dependency releases it claims to support, not just the newest. | ||
| httpx==0.28.1 | ||
| rich==15.0.0 | ||
| rich-argparse==1.4 | ||
| tomli==2.0; python_version < "3.11" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,22 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "pip" | ||
| directory: "/" | ||
| - package-ecosystem: pip | ||
| directory: / | ||
| schedule: | ||
| interval: "weekly" | ||
| interval: weekly | ||
| commit-message: | ||
| prefix: "deps" | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| prefix: deps | ||
| groups: | ||
| python-dependencies: | ||
| patterns: | ||
| - "*" | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: "weekly" | ||
| interval: weekly | ||
| commit-message: | ||
| prefix: "ci" | ||
| prefix: ci | ||
| groups: | ||
| github-actions: | ||
| patterns: | ||
| - "*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: Python ${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: pip | ||
| - run: python -m pip install --upgrade pip | ||
| - run: python -m pip install -e ".[dev]" | ||
| - run: pytest -q | ||
|
|
||
| minimum-versions: | ||
| name: Minimum dependency versions (Python 3.10) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.10" | ||
| cache: pip | ||
| - run: python -m pip install --upgrade pip | ||
| # Install the package pinned to the lowest declared runtime dependency | ||
| # versions. Install only the test dependencies separately so unrelated | ||
| # development tools cannot raise those runtime lower bounds. | ||
| - run: python -m pip install -e . -c .github/constraints-min.txt | ||
| - run: python -m pip install pytest pytest-asyncio pytest-httpx -c .github/constraints-min.txt | ||
| - run: python -m pip check | ||
| - run: pytest -q | ||
|
|
||
| quality: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.13" | ||
| cache: pip | ||
| - run: python -m pip install --upgrade pip | ||
| - run: python -m pip install -e ".[dev]" | ||
| - run: ruff check . | ||
| - run: ruff format --check . | ||
| - run: mypy panoptic | ||
| - run: python -m build | ||
| - run: python -m twine check dist/* | ||
| - run: pip-audit . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.