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

Fix code scanning alerts #27074

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lucasmrod
Copy link
Member

@lucasmrod lucasmrod commented Mar 12, 2025

These are fixes to some of the alerts in: https://github.com/fleetdm/fleet/security/code-scanning

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.97%. Comparing base (f32f802) to head (8b1e191).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #27074   +/-   ##
=======================================
  Coverage   63.97%   63.97%           
=======================================
  Files        1707     1707           
  Lines      163021   163021           
  Branches     4384     4384           
=======================================
+ Hits       104293   104294    +1     
+ Misses      50598    50597    -1     
  Partials     8130     8130           
Flag Coverage Δ
backend 64.75% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -11,6 +11,9 @@ defaults:
# fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash

permissions:
contents: read
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you describe this change?
Who is getting read permission?

Copy link
Member Author

Choose a reason for hiding this comment

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

This Github action does not modify the repository, so it does not need "write" permissions. Thus we should set that it only needs "read" permissions on the repository (principle of least authority), to prevent abuse in the future.

@lucasmrod lucasmrod requested a review from sharon-fdm March 12, 2025 17:27
Copy link
Collaborator

@sharon-fdm sharon-fdm left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants