magma / magma

Platform for building access networks and modular network services
https://www.magmacore.org/
Other
1.67k stars 598 forks source link

Bug Bounty: refactor workflow for maintainability and security #15325

Open lucasgonze opened 11 months ago

lucasgonze commented 11 months ago

Description

On reviewing the Github Action workflows, we found that one was too complicated for maintainability. Its complexity constrains the ability to reason and debug, and this is limiting our ability to ensure security.

The workflow needs to be refactored. In doing this it will be broken up into multiple files.

Each one of those files must follow best practices for security.

Proposed differences

  1. Break up each of the larger units into a separate file
  2. add a new secret github_token_rw that has write priveledges
  3. make the existing github_token a read only token
  4. change the pull_request_target trigger to pull_request.

(See also https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token, where there is a described way of changing to the restricted mode for the token)

Additional context

Perceived complexity

The technical obstacles are roughly at medium difficulty. They entail:

Proposed bounty reward

$1000

lucasgonze commented 10 months ago

Discussed and approved for vote in TSC Oct 30.