All technological notes.
classic PAT (Personal Access Token) to grant a workflow access to code from another repo.
GitHub App and use its short-term credentials.fine-grained PAT
$GITHUB_TOKEN, use only the minimum set of permissions required by the workflow.$GITHUB_TOKEN to untrusted third-party software (for example, custom actions from untrusted sources).Script injection happens when attackers inject malicious code into the workflow’s context in the hope that it will be executed.
body, default_branch, email, head_ref, label, message, name, among others.OpenID Connect, it is possible to set up authentication so that we obtain short-term credentials from cloud providers instead of having to store long-term access credentials.OIDC trust in the cloud provider
OIDC token for credentials
name: 20 security
on:
pull_request:
jobs:
unsafe-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check the PR title
run: |
title=$
if [[ $title =~ ^feat ]]; then
echo "PR is a feature"
exit 0
else
echo "PR is not a feature"
exit 1
fi
safe-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check the PR title
env:
TITLE: $
run: |
if [[ $TITLE =~ ^feat ]]; then
echo "PR is a feature"
exit 0
else
echo "PR is not a feature"
exit 1
fi
"some title"; ls -R;ls -R: list all files
PR title is passed as an environment variable, not inserted directly into the Bash script.

script injection: title=”feature: new readme”; ls -R if [[$title =~ ^feat]]; then