Enforce Least-Privilege Permissions in Container Publishing Workflow - #5
Open
malakasaray-del wants to merge 1 commit into
Open
malakasaray-del wants to merge 1 commit into
malakasaray-del wants to merge 1 commit into
Conversation
### Description
This pull request addresses the CI/CD workflow security hygiene finding in `blockscout` (**F-25**), identified during the XRPL EVM workspace security audit[cite: 21].
Previously, `.github/workflows/publish-docker-image-for-xrplevm.yml` lacked an explicit `permissions` block, relying on default repository-wide token capabilities[cite: 21].
### Key Changes & Remediations
#### Workflow Scoping (F-25 - `.github/workflows/publish-docker-image-for-xrplevm.yml`)
* **Least-Privilege Scoping:** Added explicit job-level permissions strictly bounded to reading code and publishing packages[cite: 21, 35]:
```yaml
permissions:
contents: read
packages: write
Robust Release Version Parsing: Maintained single-match regex isolation (grep -oPm1) for reading RELEASE_VERSION from mix.exs with fail-fast assertions to prevent invalid image builds.
How to Review
Inspect .github/workflows/publish-docker-image-for-xrplevm.yml to verify that permissions: contents: read, packages: write is declared under push_to_registry. Verify YAML syntax validity using Python or standard linting:
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/publish-docker-image-for-xrplevm.yml'))"
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request addresses the CI/CD workflow security hygiene finding in
blockscout(F-25), identified during the XRPL EVM workspace security audit[cite: 21].Previously,
.github/workflows/publish-docker-image-for-xrplevm.ymllacked an explicitpermissionsblock, relying on default repository-wide token capabilities[cite: 21].Key Changes & Remediations
Workflow Scoping (F-25 -
.github/workflows/publish-docker-image-for-xrplevm.yml)Robust Release Version Parsing: Maintained single-match regex isolation (grep -oPm1) for reading RELEASE_VERSION from mix.exs with fail-fast assertions to prevent invalid image builds.
How to Review
Inspect .github/workflows/publish-docker-image-for-xrplevm.yml to verify that permissions: contents: read, packages: write is declared under push_to_registry. Verify YAML syntax validity using Python or standard linting:
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/publish-docker-image-for-xrplevm.yml'))"