github / github/codeql

False positive: Workflow does not contain permissions

Abierto
#20,487 10 comentarios 8 reacciones 0 asignados Ver en GitHub
false-positive
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**Description of the false positive**

We get a lot of `Workflow does not contain permissions` alerts.

It's description states

> If a GitHub Actions job or workflow has no explicit permissions set, then the repository permissions are used. Repositories created under organizations inherit the organization permissions. The organizations or repositories created before February 2023 have the default permissions set to read-write. Often these permissions do not adhere to the principle of least privilege and can be reduced to read-only, leaving the write permission only to a specific types as issues: write or pull-requests: write.

While our org was created before February 2023, the default permission on the org is set to read contents and packages only, and in the repository I can't even change the setting.

Image

**Code samples or links to source code**

https://github.com/intility/templates/blob/8653a13809c06c5046e57cb689d8479726380414/.github/workflows/build-react.yml#L13-L36

**URL to the alert on GitHub code scanning (optional)**

https://github.com/intility/templates/security/code-scanning/4

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start with the linked workflow at .github/workflows/build-react.yml, lines 13-36, and compare its permissions with the reported code-scanning alert. Determine whether the alert is a false positive given the organization and repository defaults, then verify that the alert behavior or query outcome matches the documented permissions model.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github-actions
Área
ci-cd, security
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.