Skip to content
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

[StepSecurity] ci: Harden GitHub Actions #739

Conversation

step-security-bot
Copy link
Contributor

Summary

This pull request is created by StepSecurity at the request of @juhoinkinen. Please merge the Pull Request to incorporate the requested changes. Please tag @juhoinkinen 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 mutatble. This poses a security risk. GitHub's Security Hardening guide recommends pinning actions to full length commit.

Feedback

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

Signed-off-by: StepSecurity Bot [email protected]

Copy link

sonarcloud bot commented Nov 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ff1d32c) 99.67% compared to head (d72d788) 99.67%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #739   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files          89       89           
  Lines        6404     6404           
=======================================
  Hits         6383     6383           
  Misses         21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@juhoinkinen
Copy link
Member

Found this StepSecurity tool by looking at OpenSSF Scorecard report of Annif. Before this PR it gave a score of 6.3.

The permission of GITHUB token was already set "Read repo contents" on organization level, but it does hurt to explicitly set it the workflows (and this should increase the OpenSSF score).

@juhoinkinen juhoinkinen added this to the 1.1 milestone Nov 16, 2023
@juhoinkinen juhoinkinen merged commit 26570a7 into NatLibFi:main Nov 16, 2023
18 checks passed
@juhoinkinen
Copy link
Member

juhoinkinen commented Nov 21, 2023

Found this StepSecurity tool by looking at OpenSSF Scorecard report of Annif. Before this PR it gave a score of 6.3.

The permission of GITHUB token was already set "Read repo contents" on organization level, but it does hurt to explicitly set it the workflows (and this should increase the OpenSSF score).

The tool scans repositories weekly: now the score is 7.4.

One way to increase the score would be to add SECURITY.md for vulnerabilities reporting. However, via the Security tab of the repository reporting is already possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants