crickets-and-comb/shared

Change shared workflows to be only used by trusted internal workflows.

Open

#38 aperta il 22 mar 2025

Vedi su GitHub
 (0 commenti) (0 reazioni) (1 assegnatario)Makefile (0 fork)auto 404
bughelp wanted

Metriche repository

Star
 (2 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

There are points of code injection that do not pose a direct risk to the organization, but that malicious actors could use as a threat vector to trick others into using our workflows in a way that makes them vulnerable.

Rather than validating all user input and environmental variables, we need to add a trusted workflow list to all workflow call blocks:

on:
  workflow_call:
    inputs:
      ...
    secrets:
      ...
    required_workflows:
      - your-org/your-repo/.github/workflows/your-workflow.yml

How to test:

First case: Add one calling workflow to one reusable workflow that multiple workflows call. If the workflow added to the list can still call it, but no other workflows can, then we've got the correct syntax etc. Add the remaining workflows to this first reusable workflow and make sure they can all call it successfully.

Repeat for all other reusable workflows.

Guida contributor