Skip to content

Potential fix for code scanning alert no. 74: Workflow does not contain permissions#884

Draft
Avery-Dunn wants to merge 1 commit intodevfrom
alert-autofix-74
Draft

Potential fix for code scanning alert no. 74: Workflow does not contain permissions#884
Avery-Dunn wants to merge 1 commit intodevfrom
alert-autofix-74

Conversation

@Avery-Dunn
Copy link
Contributor

Potential fix for https://github.com/AzureAD/microsoft-authentication-library-for-python/security/code-scanning/74

To fix the problem, the ci job should define an explicit permissions block that grants only the minimal access required. Since this job only needs to read the repository contents (for actions/checkout) and does not need to write anywhere, contents: read is sufficient. This aligns it with GitHub’s least‑privilege recommendation and with the CodeQL suggestion.

Concretely, in .github/workflows/python-package.yml, under jobs: ci:, add a permissions: section before env: (or anywhere inside the ci job) with contents: read. No other changes to steps are necessary, and no additional imports or methods are required because this is a YAML configuration change only.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

1 participant