Skip to content

fix(security): least-privilege tokens in docouture workflows - #20

Merged
ivanasabi merged 3 commits into
mainfrom
fix/docouture-token-permissions
Oct 5, 2026
Merged

ivanasabi merged 3 commits into
mainfrom
fix/docouture-token-permissions

Conversation

@ivanasabi

Copy link
Copy Markdown
Contributor

Resumen

Resuelve los 5 alertos Token-Permissions (high) de Scorecard abiertos sobre main (#9–#13), localizados en los 4 workflows docouture-* introducidos por #9.

Alertos resueltos

# Archivo Línea Motivo
13 .github/workflows/docouture-release.yml 89 top-level contents: write
12 .github/workflows/docouture-release-preview.yml 1 sin top-level permissions
11 .github/workflows/docouture-publish.yml 1 sin top-level permissions
10 .github/workflows/docouture-publish.yml 53 job-level contents: write
9 .github/workflows/docouture-publish-prerelease.yml 131 job-level contents: write

Qué cambia

Los 6 workflows docouture-* adoptan el hardening ya validado en InditexTech/internal-ops#768 para el mismo scaffold:

  • permissions: {} a nivel de workflow; contents: read (o pull-requests: write solo en los jobs de comentario) por job.
  • Los pushes a gh-pages, tags docs/* y el bump de docs/.release-version ya autentican con el App token, ahora acotado (owner/repositories/permission-contents: write); GITHUB_TOKEN queda read-only con persist-credentials: false.
  • APP_PRIVATE_KEY pasa al reusable como secret explícito en vez de secrets: inherit.
  • Sin caches en las lanes que publican (cache-poisoning) y sin dorny/paths-filter (diff git local).

Los dos TEMPORARY WORKAROUND propios de cerbia (Build docs / Cut release + fix-search-index.mjs) se conservan intactos.

Verificación

  • zizmor (1.29.0, persona regular) sobre los 6 workflows: 0 hallazgos (antes 14, incl. los 5 de excessive-permissions).
  • YAML válido en los 6 ficheros.

Resolves Scorecard Token-Permissions alerts #9-#13 on main:

- docouture-release.yml:89  top-level 'contents: write'
- docouture-release-preview.yml:1  no top-level permission
- docouture-publish.yml:1  no top-level permission
- docouture-publish.yml:53  job-level 'contents: write'
- docouture-publish-prerelease.yml:131  job-level 'contents: write'

Adopts the hardened versions already shipped in InditexTech/internal-ops#768
for these same docouture scaffold workflows: top-level permissions {}, job
permissions content read with the gh-pages/tag pushes authenticating via the
narrowed App token, explicit APP_PRIVATE_KEY instead of secrets: inherit, no
dorny/paths-filter and no caches on publishing lanes. cerbia's two temporary
workarounds (Build docs / Cut release) are preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ivanasabi
ivanasabi requested a review from a team as a code owner October 5, 2026 08:54
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

❗ This Pull Request will not trigger a docs release

A Pull Request with no docs/release label will not trigger a docs site release — label it docs/release if you want this merge to release the docs site.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

❌ No changes in CHANGELOG.md

Update the ## [Unreleased] section listing the changes for this release before merging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

❗ This Pull Request will not trigger a docs release

A Pull Request with no docs/release label will not trigger a docs site release — label it docs/release if you want this merge to release the docs site.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Python Release Preview

  • Workspace release strategy: locked-step
  • cerbia: 0.3.0 -> 0.4.0
  • cerbia-cli: 0.3.0 -> 0.4.0
  • cerbia-core: 0.3.0 -> 0.4.0
  • cerbia-ml: 0.3.0 -> 0.4.0
  • cerbia-presidio: 0.3.0 -> 0.4.0
  • cerbia-protectai: 0.3.0 -> 0.4.0
  • Release type: minor
  • Expected merge strategy: Squash and merge

Changes

Fixed

@ivanasabi ivanasabi added the skip-release Do not publish a release for this change. label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

❗ This Pull Request will not trigger a docs release

A Pull Request with no docs/release label will not trigger a docs site release — label it docs/release if you want this merge to release the docs site.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Release Preview

This pull request has the skip-release label and will not create a Python release.

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

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

Labels

skip-release Do not publish a release for this change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant