42/71
Sign inSign up free

599. Lock Down a Release Workflow

medium 20 XP ~10 minHands-on lab

In /home/student/repos/data-pipeline, .github/workflows/release.yml builds and publishes a release when a version tag is pushed. A security review found two problems:

  1. The workflow sets no permissions, so every job gets the repository's default token permissions.
  2. It uses a third-party action by a movable tag. The security team vetted one exact commit of it; it's recorded in SECURITY-PINS.md.

Task

Edit release.yml so that:

  • the workflow's default token permissions are read-only access to contents and nothing else,
  • only the publish job may write contents (it creates the GitHub release); the test job stays read-only,
  • the third-party action is pinned to the full commit SHA from SECURITY-PINS.md,
  • the jobs, triggers and steps otherwise stay as they are.

Actions under actions/ (GitHub's own) may keep their version tags.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.