Skip to content

[StepSecurity] Apply security best practices#890

Merged
inimaz merged 1 commit into
mlco2:masterfrom
step-security-bot:chore/GHA-101712-stepsecurity-remediation
Jul 10, 2025
Merged

[StepSecurity] Apply security best practices#890
inimaz merged 1 commit into
mlco2:masterfrom
step-security-bot:chore/GHA-101712-stepsecurity-remediation

Conversation

@step-security-bot

Copy link
Copy Markdown
Contributor

Summary

This pull request is created by StepSecurity at the request of @inimaz. Please merge the Pull Request to incorporate the requested changes. Please tag @inimaz on your message if you have any questions related to the PR.

Security Fixes

Least Privileged GitHub Actions Token Permissions

The GITHUB_TOKEN is an automatically generated secret to make authenticated calls to the GitHub API. GitHub recommends setting minimum token permissions for the GITHUB_TOKEN.

Pinned Dependencies

GitHub Action tags and Docker tags are mutable. This poses a security risk. GitHub's Security Hardening guide recommends pinning actions to full length commit.

Secure Dockerfiles

Pin image tags to digests in Dockerfiles. With the Docker v2 API release, it became possible to use digests in place of tags when pulling images or to use them in FROM lines in Dockerfiles.

Feedback

For bug reports, feature requests, and general feedback; please email support@stepsecurity.io. To create such PRs, please visit https://app.stepsecurity.io/securerepo.

Signed-off-by: StepSecurity Bot bot@stepsecurity.io

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
@inimaz inimaz requested review from benoit-cty and Copilot July 10, 2025 17:17

Copilot AI 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.

Pull Request Overview

This PR enhances security by pinning Docker base images to immutable digests, locking GitHub Action versions to specific SHAs, and enforcing least-privileged token permissions in workflows.

  • Dockerfiles updated to reference image digests.
  • GitHub Actions in workflows pinned to specific commit SHAs.
  • Permissions blocks added to restrict GITHUB_TOKEN scopes.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docker/Dockerfile Pinned Python base image to SHA256 digest
carbonserver/docker/Dockerfile Pinned Ubuntu image to SHA256 digest
act/Dockerfile Pinned Ubuntu image to SHA256 digest
.github/workflows/test-package.yml Pinned actions/checkout and setup-uv to commit SHAs
.github/workflows/release-drafter.yml Added permissions block and pinned release-drafter action
.github/workflows/python-publish.yml Pinned actions/checkout, setup-uv, and pypi-publish actions
.github/workflows/pre-commit.yml Added permissions block and pinned checkout, setup-python, cache actions
.github/workflows/package.yml Pinned checkout, setup-uv, setup-python, cache, upload-artifact actions
.github/workflows/deploy.yml Added permissions block and pinned actions/checkout
.github/workflows/codeql.yml Added permissions block and pinned checkout and codeql actions
.github/workflows/build-ui.yml Added permissions block and pinned checkout, setup-node, pnpm actions
.github/workflows/build-server.yml Pinned checkout and setup-uv actions
Comments suppressed due to low confidence (3)

.github/workflows/test-package.yml:3

  • Consider adding a top-level permissions: block (e.g., permissions: contents: read) to restrict GITHUB_TOKEN scopes in this workflow.
on:

.github/workflows/python-publish.yml:8

  • This workflow currently lacks a permissions: section—add permissions: contents: read to enforce least-privileged token usage.
on:

.github/workflows/build-server.yml:2

  • Add a permissions: block (e.g., permissions: contents: read) at the top to restrict the GITHUB_TOKEN for this workflow.
on:

@inimaz inimaz requested a review from SaboniAmine July 10, 2025 17:25

@SaboniAmine SaboniAmine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !
Those dockerfiles seem a bit updated, but it can be changed in a separate PR

@inimaz inimaz merged commit f469cf5 into mlco2:master Jul 10, 2025
7 checks passed
@benoit-cty benoit-cty mentioned this pull request Jul 11, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants