Repository navigation
v0.4.0
sisakulint v0.4.0
日本語版はこのページの後半(「sisakulint v0.4.0(日本語)」)にあります。
v0.4.0 is the first release of the v1 linter, a rewrite of sisakulint. ("v1" is the name of the implementation, not a version number.) The flags, the exit codes, the output, the rule IDs, and the configuration file are not compatible with v0.3.8 and earlier, and no compatibility wrapper exists. Some flags keep their 0.x name but have a different meaning, so a CI script in which only the flag names are copied still runs, but gives different results.
Important
Read MIGRATION.md before you upgrade a CI script, a Homebrew installation, or gh-intel/sisakulint-action. The sections below summarize it.
Highlights
- A new analysis engine with no third-party Go modules. The v1 linter reads YAML with its own lossless YAML 1.2.2 syntax tree, reads
${{ }}expressions with an expression parser, and readsrunscripts with a bash and sh parser.go.modhas norequireline, and the binary links only the Go standard library. - 35 security rules and 13 quality rules. Each security rule declares its threat: the attackers, the events, what the attackers gain, the preconditions (with citations of GitHub documentation and observations), and reported incidents.
--explainprints the declaration. - Severity from CVSS v4.0. Each of the 78 finding kinds has a CVSS v4.0 vector, with a reason for each metric. The severity of a finding kind is derived from the vector by a fixed table of impact and likelihood.
- Three certainties. A
Findingisconfirmed,conditional(it depends on a fact that has no answer), orinconclusive(the rule could not decide the place). Each certainty sets its own bit of the exit code. - Offline by default, facts on request. A run uses no network unless
--onlineis given. Facts about the repository and about other repositories (whether the repository is public, the commit of a tag, the advisories of an action, and so on) come from--online, a facts file, or--fact. With--online, the rules also read composite actions (to depth 4) and reusable workflows (to depth 3) of other repositories. - A gate for pull requests.
--remote OWNER/REPO --pull-request N --pull-request-head SHAreads the head of a pull request through the GitHub API without a clone, and reports only the inputs that the pull request changed. - Fixes with stated side effects. 14 fix kinds in 12 rules.
--fixapplies the 2 safe kinds,--fix=reviewapplies all kinds, and--dry-runwrites a diff forgit apply. - An HTML report view.
--html FILEand--servedraw the path of the evidence of eachFinding.--examples --serveserves a catalog of the examples of every rule. - SARIF for code scanning, with one SARIF rule for each finding kind, levels from the severity, and fingerprints that do not depend on line numbers.
Before you upgrade (breaking changes)
Installation and module path
The organization sisaku-security was renamed to gh-intel, and the module path changed.
| 0.x (v0.3.8 and earlier) | v0.4.0 and later | |
|---|---|---|
| Module path | github.com/sisaku-security/sisakulint |
github.com/gh-intel/sisakulint |
go install |
go install github.com/sisaku-security/sisakulint/cmd/sisakulint@v0.3.8 |
go install github.com/gh-intel/sisakulint/cmd/sisakulint@v0.4.0 |
go install github.com/gh-intel/sisakulint/cmd/sisakulint@v0.3.8fails, because the 0.x versions declare the 0.x module path. To keep 0.x, use the 0.x path.- To build from source, Go 1.26.11 is required.
- The command name, the command package (
cmd/sisakulint), and the SARIF tool name (sisakulint) are the same as in 0.x. - Homebrew: the tap distributes v0.4.0 and later, so
brew upgradereplaces 0.x with the v1 linter. Rewrite your scripts before the upgrade. gh-intel/sisakulint-action: do not set the inputversionto 0.4.0 or later with the current action. The action at604b94binstalls 0.3.0 by default, and always passes-fix "$SISAKULINT_AUTOFIX"and-format '{{sarif .}}'. With the v1 linter, these flags stop the run with exit code 64 or 66. The gate of the action also infers a severity from the end of the ruleId (-critical, and so on) and from words in the message, and the v1 linter writes neither. On the SARIF of the all-rules example, 233 of 237 results becamelow, so the defaultfail-on: highpasses most results silently. Use v0.4.0 with the action only after a version of the action passes the flags of the v1 linter and reads its severity.
Exit codes
0.x returned 0 (no finding), 1 (findings), 2 (flag error), or 3 (fatal error). When the v1 linter has written the Report and has done everything that was requested, it returns the sum of these bits:
| Bit | Set when |
|---|---|
| 1 | A confirmed Finding at or above --fail-on exists |
| 2 | A conditional Finding at or above --fail-on exists, or no input remains after the excluded inputs are removed |
| 4 | An internal error occurred |
| 8 | An inconclusive Finding of a rule at or above --fail-on exists, and --accept does not accept it |
| 16 | An input, or an input that an input calls (uses: ./x), cannot be read or is invalid |
Any other result is exactly one of these codes. With 64, 66, and 75, nothing is written to stdout.
| Code | Meaning |
|---|---|
| 64 | Usage error (2 in 0.x) |
| 66 | An input, a facts file, an acceptance file, or a configuration file cannot be read or is invalid, or the repository, commit, or pull request of --remote cannot be read |
| 70 | Not all fixes can be written |
| 74 | An output file (Report, SARIF, facts) cannot be written |
| 75 | The head of the pull request is not the value of --pull-request-head |
What to check in a CI gate:
- A gate that fails on every non-zero exit code works without change. It fails in more runs than with 0.x, because of bits 2 and 8.
- Exit codes 2 and 3 no longer mean a flag error or a fatal error. They mean bit 2, and bits 1 and 2.
- A script that checks only
code & 1passes silently on aconditionalFinding. If you map the exit code to 0 or 1, return 1 when any of bits 1, 2, 8, and 16 is set. Do not map bit 4, 64, 66, 70, 74, or 75 to 0. --fail-on SEVERITY(info,low,medium,high,critical) is the lowest severity that sets bits 1, 2, and 8.- Findings of quality rules set no bit.
Flags that keep a 0.x name but have a different meaning
| 0.x | Behavior in v0.4.0 | Use instead |
|---|---|---|
-fix on, -fix off, -fix dry-run |
--fix takes no separate value. on is read as a PATH that does not exist, and the run stops with exit code 66 (-fix=on gives 64) |
--fix (safe fixes), --fix=review (all fixes), --fix --dry-run (a diff on stdout). For off, pass no --fix |
-verbose |
The same as --detail full. No progress log is written |
Read inputs[] and errors[] of the Report (--format json) |
-init |
Writes a template to stdout and creates no file | --init > FILE |
-remote QUERY |
Reads only one repository. A search query (org:…) gives exit code 64 |
No replacement |
Removed flags
A removed flag prints flag provided but not defined: -NAME and the usage to stderr, and the run stops with exit code 64.
| 0.x | v0.4.0 |
|---|---|
-ignore REGEX |
--skip-rule ID[,ID…]. An exact rule ID, not a regular expression. The skipped rule does not run (0.x ran the rule and discarded its findings) |
-enable-rule NAME |
--rule ID[,ID…] runs only the named rules. To add one rule to the default rules, list every ID |
-format TEMPLATE |
--format text|line|json|sarif. Apply jq to the JSON Report instead of a Go template |
-config-file FILE |
--config FILE |
-github-token TOKEN |
The environment variable GITHUB_TOKEN only |
-pr N |
--remote OWNER/REPO --pull-request N |
-expected-head-sha SHA |
--pull-request-head SHA (exit code 75 instead of 3) |
-remote-checkout-dir DIR |
--write-snapshot DIR |
-remote-target PATH |
A positional PATH |
-r, -D |
--online reads the reusable workflows and actions of other repositories |
-stdin-filename, -generate-action-list, -boilerplate, -debug, -l, -p |
None |
Inputs
- The v1 linter does not search the ancestor directories for the repository root. The root is
--root(default.). A run in a subdirectory of the repository finds no input and sets bit 2. - Only the
.ymland.yamlfiles directly under.github/workflowsare workflows. GitHub does not run a file in a lower directory as a workflow. Everyaction.ymlof the repository (oraction.yamlwhen noaction.ymlexists) is also an input. - A PATH argument reads only that file. To read the whole repository and report only the places related to PATH, use
--read-all PATH….
Configuration file
-
The v1 linter does not look for
.github/sisakulint.yaml. It reads a configuration file only when--config FILEis given. When you lint the repository of another person with--root, a file in that repository must not remove rules. -
The keys are
exclude,fail-on,rule,skip-rule,accept,facts,repo,fact,add-attacker, andno-assumptions. Each key works in the same way as the flag of the same name. -
To migrate a 0.x file, run this at the repository root, read the output, and commit it:
sisakulint --init --legacy-configuration .github/sisakulint.yaml --root . > .github/sisakulint-config.yaml
action-listbecomes the factrepo.action-list, andconfig-variablesbecomesrepo.configuration-variables.secret-exfiltration.allowed-hostsand the workflow directive# sisakulint:secret-exfiltration.allowed-hosts: …becomerequest.destination-trusted, one entry for each pair of a secret and a destination that a current workflow sends the secret to. 0.x allowed a destination by host, so after the migration aFindingappears when a workflow sends a different secret to the same host.self-hosted-runner.labelsis not migrated. Each entry that is not migrated is written as a comment in the output and as a line on stderr.
GitHub API and token
- 0.x always called the GitHub API. The v1 linter calls it only with
--online. - The token is read only from
GITHUB_TOKEN.SISAKULINT_GITHUB_TOKEN,GH_TOKEN,gh auth token, and Git credential helpers are not used. On a local machine, runGITHUB_TOKEN=$(gh auth token) sisakulint …. - Facts about the repository itself (whether it is public, whether the default token can write, and so on) are asked only when
--repo OWNER/NAMEis given. The name is not inferred from the environment or from git. In CI, pass--repo "$GITHUB_REPOSITORY". - In 0.x, a step whose API call failed passed without a finding. In v0.4.0, a
Findingthat depends on a fact without an answer isconditionaland sets bit 2.
Output, SARIF, and reviewdog
- The default
--format textis a summary grouped by finding kind. For one line per finding, use--format line(path:line:column: severity kind: message). - Go templates are gone.
--format jsonwrites the Report (schemasisakulint/report/v0). The Report has theCondition,Inconclusive, andFixof each finding, which a 0.x template could not write. - The severity is a field of a
Finding. It is not written in the message or in the rule ID. - reviewdog: rewrite
sisakulint -format "{{sarif .}}" | reviewdog -f=sarif …tosisakulint --format sarif | reviewdog -f=sarif …. - Code scanning: the ruleId is now
<rule>.<kind>(for examplecode-injection.controlled), and the fingerprint differs from 0.x. The SARIF tool name is stillsisakulint, so an upload with the same category as 0.x overwrites the 0.x results.MIGRATION.mdexpects, without verification, that the 0.x alerts close and that the v1 findings open as new alerts. To keep the 0.x alerts open for comparison, upload with a differentcategoryinput ofgithub/codeql-action/upload-sarif.
Rule IDs and the rules that run
-
Each pair of
-criticaland-mediumrules of 0.x became one ID, and theFindingholds the severity (for example,code-injection-criticalandcode-injection-mediumbecamecode-injection). -
Other renames and merges:
0.x v0.4.0 cache-poisoning-poisonable-stepuntrusted-checkoutimproper-access-controluntrusted-checkout,untrusted-checkout-toctouuntrusted-checkout-toctou/critical,/highuntrusted-checkout-toctoureusable-workflow-taintcode-injection,envvar-injection,output-clobbering,envpath-injectionref-confusioncommit-shaobfuscationuses-path(quality rule; theusespath part ofobfuscation)deprecated-commandsunsecure-commands(an attacker value inset-envoradd-path) anddeprecated-commands(quality rule)expressiona model Diagnostic, andexpression(quality rule) -
syntax,needs,id, andworkflow-callare modelDiagnostics now, not rules. A modelDiagnosticreports a form that GitHub rejects when GitHub reads the workflow.--skip-rulecannot exclude it, the input becomesinvalid, and bit 16 is set. -
dependabot-ecosystemwas removed. -
These rules became quality rules, whose findings set no bit of the exit code:
missing-timeout-minutes,archived-uses,deprecated-node-runtime,cache-bloat,dependabot-github-actions,dependency-review-settings,env-var,cond,uses-path, and parts ofexpressionanddeprecated-commands. The findings are inquality_findingsof the Report. Do not use them as a CI gate. -
Rules that need facts do not run in a default offline run:
known-vulnerable-actions,impostor-commit,archived-uses, anddeprecated-node-runtimerun with--online, with a facts file or--factthat answers the fact they need, or when--rulenames them. 0.x always called the API for them.action-listruns only when a facts file or--fact(also thefactsandfactkeys of the configuration file) answersrepo.action-list, or when--rulenames it.--onlinealone does not run it.missing-timeout-minutesruns only when--rulenames it, as in 0.x.
Fixes
v0.4.0 has 14 fix kinds in 12 rules (see "Fixes" under "What's new"). These rules had an auto-fixer in 0.x and have no fix in v0.4.0: missing-timeout-minutes, credentials, permissions, dangerous-triggers, secrets-inherit, secret-exposure, secret-in-log, unmasked-secret-exposure, secrets-in-artifacts, argument-injection, request-forgery, envpath-injection, impostor-commit, cache-bloat, cond, uses-path (0.x obfuscation), and dependabot-github-actions.
--fix without a value applies only the safe fixes. A fix that needs a fact (for example, the commit SHA of a tag) is produced only when the fact is answered before the run (--online, --facts, --fact). In 0.x, the fix of commit-sha called the API during the fix and stopped with exit code 3 on a rate limit.
Detection differences on the same workflows
0.x and the v1 linter were run on the Example inputs of all rules on 2026-11-15. These are not the workflows of users, so the differences on your workflows can be different. The large groups of findings that only 0.x reports:
missing-timeout-minuteson steps and on jobs that call a reusable workflow. The v1 linter reports only a job that hasruns-on; thetimeout-minutesof the job applies to its steps.artipackedon a checkout without an upload. The v1 linter reports only a form in which credentials enter an artifact.deprecated-node-runtimefrom an embedded table of Node.js versions. The v1 linter asks the factaction.runs-using, and does not run without an answer. For a local action (uses: ./x), it reportsruns.usinginx/action.yml, not the step.- One harm reported many times. 0.x reported
cache-poisoning-poisonable-stepfor each later step that runs the code of the pull request. The v1 linter reports oneFindingfor each harm, and holds the later steps inEvidenceorRelated.
What's new
Rules
35 security rules, grouped by the kind of flaw (weakness in --explain). The severity of a rule is the worst severity of its finding kinds.
| Weakness | Rules (severity) |
|---|---|
| Script injection | code-injection (critical) |
| Argument injection | argument-injection (critical) |
| Environment file injection | envvar-injection (critical), output-clobbering (critical), envpath-injection (high) |
| Workflow command injection | set-output-injection (critical) new, unsecure-commands (critical) new |
| Request forgery | request-forgery (critical) |
| Untrusted code execution | untrusted-checkout (critical), artifact-poisoning (critical), untrusted-checkout-toctou (medium), self-hosted-runner (high) |
| Gate bypass | bot-conditions (critical), unsound-contains (critical) |
| AI agent hijack | ai-action-excessive-tools (critical), ai-action-execution-order (high), ai-action-prompt-injection (high), ai-action-unrestricted-trigger (high), ai-action-unsafe-sandbox (high) |
| Untrusted reference | known-vulnerable-actions (critical), commit-sha (high), impostor-commit (high), action-list (high), unpinned-images (high) |
| Credential leak | artipacked (critical), credentials (critical), secret-in-log (critical), secrets-in-artifacts (critical), unmasked-secret-exposure (critical), secret-exfiltration (medium) |
| Excessive privilege | cache-poisoning (high), dangerous-triggers (high), permissions (high), secret-exposure (high), secrets-inherit (high) |
The 78 finding kinds are 31 critical, 42 high, 3 medium, and 2 low.
New security rules:
set-output-injection: a step that has anidprints a value of the attacker (the title of an issue, a commit message, and so on) to the log. Regardless ofACTIONS_ALLOW_UNSECURE_COMMANDS, the runner reads##[set-output name=…;]in a log line, and::set-outputat the start of a line, as a command, and writes an output of the step.unsecure-commands: in a step whereACTIONS_ALLOW_UNSECURE_COMMANDSis true, a value of the attacker is printed to the log, and the runner reads it asset-envoradd-path. The attacker writes the env and the PATH of later steps.
13 quality rules: allowed-actions, archived-uses, cache-bloat, cond, dependabot-github-actions, dependency-review-settings, deprecated-commands, deprecated-node-runtime, env-var, expression, missing-timeout-minutes, unset-configuration-variable, uses-path. A quality finding alone gives an attacker nothing. A quality rule has no threat, no CVSS, and no severity.
New quality rules:
allowed-actions: ausesnames an action, a reusable workflow, or an image that the allowed-actions setting of the repository does not permit (the factrepo.allowed-actions), or the setting requires a full commit SHA and theusesnames a tag or a branch. GitHub does not start the run, or fails the job in Set up job.unset-configuration-variable: a${{ }}readsvars.<name>, and no level (repository, organization, environment) defines the variable. GitHub makes the value an empty string, andfromJSONof it fails.uses-path: ausespath has an empty element,.,.., or\, or goes above the root of the repository or of the workspace. GitHub does not read it as written. This replaces theusespart of 0.xobfuscation.
A threat model in every rule
--explain IDand--explain=allprint each rule as Markdown: the problem, the expected state, the threat (preconditions with citations and observations, attackers, events, gains, incidents with advisories and CVEs), the finding kinds, the fix kinds with their side effects, the undetected forms, the inconclusive kinds, the false positive forms, and the examples.--explain=termsdefines the item names and values.--registrywrites the same declarations as JSON (sisakulint/registry/v0), and--registry=fulladds the fact answers of each example. Read this JSON in programs; the Markdown of--explainmay change.- Severity: each finding kind has CVSS v4.0 Base metrics and Exploit Maturity (
E), with a reason for each value. The impact is the highest of VC, VI, VA, SC, SI, and SA. The likelihood comes from AV, AT, and PR, and AC:H or UI:A lowers it one step. A table maps impact and likelihood to the severity (for example, impact H with high likelihood is critical).--explainalso prints CVSS-B and CVSS-BT from a port of the FIRST reference calculator, for reference.
Certainty, assumptions, and attackers
confirmedsets bit 1.conditional(theFindingdepends on a fact that has no answer; the Report names the fact) sets bit 2.inconclusive(a place where the rule cannot decide, such as a value that the rule does not read) sets bit 8.- When no source answers a fact, the run uses an assumed value (the worst case) and prints it, for example
assumed: repo.default-token-write = true.--no-assumptionstreats those facts as unknown instead. - A default run counts only attacks by outside people.
--add-attacker VALUEalso runs the rules with one added attacker:read-member,triage-account,writer-pull-requests-token,writer-issues-token,required-reviewer,app-installation-token,variables-writer, orsecrets-writer. AFindingthat appears only with the added attacker is marked (added_attackersin the Report,added attacker:in the text output,properties.added_attackersin SARIF). Which approval, gate, orifeach value passes comes from the tables ofactions/boundary, and each row has evidence.--add-attackercannot be used with--fix.
Facts
--onlineasks the GitHub API (token:GITHUB_TOKEN).--github-api URLsets the API root for GitHub Enterprise Server.--facts FILEreads answers from a file, and--write-facts FILEwrites the facts that the run asked and their answers. A CI without a network can run with a facts file written on another machine.--fact KIND=VALUEor--fact 'KIND[ARG=VALUE,…]=VALUE'answers one fact (the value is JSON). The order of precedence is--fact, then the facts file, then the API.- 29 fact kinds exist, for example
repo.public,repo.default-token-write,repo.environment-protected,repo.fork-pr-secrets,git.ref-commit,git.commit-ref,package.advisories,action.definition,workflow.definition, andrequest.destination-trusted.--explain=termslists all of them and how--onlineanswers each. - Actions and reusable workflows of other repositories: with
--online(or a facts file that has the answers), the run reads a composite action and the steps inside it to depth 4 (action.definition), and a reusable workflow and its jobs to depth 3 (workflow.definition). AFindinginside appears at theusesof the caller, with the location inside at the start of theEvidence, and has noFix. An action is read from the archive that the runner fetches, and a reusable workflow from the blob of the commit. When something cannot be answered (a private repository, a size or request limit, beyond the depth), the place becomesInconclusive(remote-unknown,remote-callee-unknown), which sets bit 8. pull_request_targetpolicy: GitHub's default policy that stopspull_request_targetin public repositories is enforced on 2026-12-02. For a workflow that the policy stops, answer--fact 'repo.pull-request-target-allowed[input_path=.github/workflows/<file>]=false', and the findings whose only attacker event ispull_request_targetare no longer reported. The API is not asked for this fact. Without an answer, the rules assume that the run starts..github/dependabot.ymland the Renovate configuration are read as facts from the files under--root.
Warning
A facts file written by --write-facts contains the content of the actions and reusable workflows that were read, including those of private repositories.
Remote repositories and pull requests
--remotereads a GitHub repository instead of--root:OWNER/REPO,OWNER/REPO@REF(branch, tag, or commit SHA), or a URL (https://github.com/OWNER/REPO,…/tree/<ref>,…/pull/<N>). The ref is resolved to a commit first, and only that commit is read, file by file, through the git tree and blob APIs. Nothing is cloned or written to disk.remote_revisionof the Report lists the repository, ref, commit, tree, and each file read with its blob SHA.- Limits: 1000 requests per run and 1 MiB per file (an input over a limit becomes unreadable and sets bit 16). A tree with more than 100,000 entries, a rate limit, or a network error stops the run with exit code 66. Without a token, the API allows 60 requests per hour, and one file costs one request.
--pull-request Nreads the head of the pull request (also from a fork) and reports only the inputs that the pull request changed, computed from the trees of the merge base and the head. A changed symlink target and a changed submodule commit called withuses: ./count as changes. When the pull request changes a file that is read but is not an input (.github/dependabot.yml, the labeler configuration), all inputs are reported.--pull-request-head SHAstops the run with exit code 75 when the head of the pull request is not that SHA. Pass it when you attach the result to a commit, for example as a status check.remote_revision.pull_request.behind_byshows how far the base moved ahead of the merge base. When the moved part touches an input or a file that was read, bit 16 is set.--write-snapshot DIRwrites the files that were read to a new directory, and with--fixfixes the files there.README.mdlists what to check before you use this as a gate: a strict branch protection or a merge queue, a gate that runs outside the workflows that the pull request can change, and the limits of--accept.
Fixes
| Rule | Fix kind | Safety | What it does |
|---|---|---|---|
commit-sha |
pin-sha |
safe | Pins the ref to the full SHA of the commit that the runner runs for it now |
untrusted-checkout-toctou |
pin-head-sha |
safe | Checks out github.event.pull_request.head.sha, the commit that the approval saw, instead of a branch or refs/pull/<n>/head |
untrusted-checkout-toctou |
pin-head-sha-review |
review | Checks out the head that the approval saw instead of refs/pull/<n>/merge |
code-injection |
env-var |
review | Moves the expressions into the env of the step, and reads the variables, quoted as the shell needs (bash and sh) |
code-injection, envvar-injection, output-clobbering |
env-var-review |
review | Moves the expressions into env and reads them as "${NAME}" (bash, sh), $env:NAME (pwsh), or process.env.NAME (github-script); removes line breaks from what is written to $GITHUB_ENV or $GITHUB_OUTPUT, or makes the name<<DELIM delimiter random |
untrusted-checkout |
base-checkout |
review | Checks out the code of the base (removes the inputs that name the pull request) |
artifact-poisoning |
runner-temp-path |
review | Downloads the artifact to ${{ runner.temp }}/artifacts, outside the workspace |
artipacked |
persist-credentials-false |
review | persist-credentials: false on the checkout |
bot-conditions |
author-context |
review | Compares github.event.pull_request.user.login instead of the actor |
cache-poisoning |
cache-mode-no-write |
review | Saves nothing to the cache on the events of the attacker |
known-vulnerable-actions |
upgrade-version |
review | For a uses pinned to a full SHA: pins it to the commit of the first version that fixes every advisory found, and names the version in the comment at the end of the line |
unsound-contains |
contains-array |
review | contains(fromJSON('[...]'), x): compares whole values |
unsound-contains |
equality |
review | contains(x, 'value') becomes x == 'value' |
--fixapplies the safe kinds,--fix=reviewapplies all kinds, and--dry-runwrites a diff thatgit applyaccepts instead of writing the files.- The side effects of a review fix (changes other than the removal of the
Finding) are printed under the fix line of the text output and infix.side_effectsof the Report. --fixchecks the result with the rules that ran. AFixthat changes the certainty or the condition of anotherFindingis an error. When an appliedFixchanges something that a skipped rule reads, the rule is reported asnot checked:.
$ sisakulint --root . --fix=review --dry-run
diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml
--- a/.github/workflows/triage.yml
+++ b/.github/workflows/triage.yml
@@ -6,4 +6,6 @@
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - run: echo "${{ github.event.issue.title }}"
+ - run: echo "${ISSUE_TITLE}"
+ env:
+ ISSUE_TITLE: ${{ github.event.issue.title }}Output
The default text output, for a workflow on issues that writes ${{ github.event.issue.title }} in run (some lines omitted):
$ sisakulint --root .
critical code-injection.controlled .github/workflows/triage.yml:9:24
github.event.issue.title is written into the run script by ${{ }}, and an attacker controls it on issues
impact: the value becomes code
9 | - run: echo "${{ github.event.issue.title }}"
| ^^^^^^^^^^^^^^^^^^^^^^^^
remedy: pass it through env and read the variable
fix (review): move the expressions into the env of the step, and read the variables where they were, quoted as the shell needs (bash and sh) [--fix=review]
high dangerous-triggers.token-write .github/workflows/triage.yml:6:5
the job runs on issues, which an attacker triggers, with no approval and a GITHUB_TOKEN that may write
...
assumed: repo.default-token-write = true (--no-assumptions to drop)
high commit-sha.unpinned .github/workflows/triage.yml:8:32
actions/checkout@v4 is not pinned to a full commit SHA
...
no fix: the commit of the ref is not known (offline: pass --facts or --online)
quality
dependabot-github-actions.no-update-tool
.github/workflows/triage.yml:8:32 no update tool updates actions/checkout@v4 ...
inputs 1 read (every workflow and action.yml under --root)
...
not run known-vulnerable-actions: ... in a run without --rule, the rule runs when --online is given, ...
4 findings: 4 confirmed (critical 1, high 3), 0 conditional, 0 inconclusive
1 quality finding: the bits do not count quality findings
bits 1 = 1 (confirmed findings)--format text(default),line,json, orsarif.--detail summary|normal|full(-visfull), and--color auto|always|never(autorespectsNO_COLOR).--report FILEwrites the JSON Report and--sarif FILEwrites SARIF, in addition to the stdout output.- The Report has
findings[](with certainty, condition, evidence, related places, fix, and fingerprint),quality_findings,inputs[],errors[],skipped_rules,reported_inputs, andremote_revision. --versionprints the version, the commit, the Go version and platform, and the JSON schemas that the binary writes and reads.
SARIF and code scanning
- One SARIF rule (
reportingDescriptor) for each finding kind, with the ID<rule>.<kind>. critical and high becomeerror, medium becomeswarning, and low and info becomenote.security-severityis set. A quality finding becomes anotethat is not a security alert. - An
Inconclusivebecomes an alert with the tagssecurityandinconclusive. AnInconclusiveaccepted with--acceptis not written. AconditionalFindingbecomes the same alert as aconfirmedone, and the fact without an answer is appended to the message. Relatedplaces are written torelatedLocationsand linked from the message.partialFingerprints.primaryLocationLineHashcomes from theFingerprint, which has no line number, so aFindingkeeps its alert when lines move.- File locations are relative URIs with the
uriBaseId%SRCROOT%, and the absolute path of the machine that ran the lint is not written. - Unreadable inputs and internal errors are written to
invocations[0].toolExecutionNotifications.
permissions:
contents: read
security-events: write
actions: read # needed only in a private repository
steps:
# after actions/checkout and a step that installs sisakulint
- run: sisakulint --root . --sarif sisakulint.sarif
- if: ${{ !cancelled() }}
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: sisakulint.sarifHTML report view and example catalog
--html FILEwrites, and--serveserves on 127.0.0.1 (--serve=ADDRfor another loopback address), a page that draws the path of theEvidenceof eachFinding, marks the lines of the quality findings, and lets you try the condition of each finding.--examples --serveserves the results of theExampleof every rule and quality rule, run with the fact answers of each example (--examples=RULE --html FILEfor one rule). The catalog groups rules byweaknessorattack means, shows the "boundary" (each gain by role, with the rows of evidence), and links the definitions of--explain=terms.
Warning
The HTML contains lines of the workflows. When you share the HTML of a private repository, those lines leak.
Accepting an Inconclusive
- When a person has looked at an
Inconclusiveplace and decided that the value is not an attacker value, write the place in an acceptance file (sisakulint/acceptances/v0) with a reason, and pass it with--accept FILE. The place no longer sets bit 8, and it stays infindings[]of the Report withacceptance.reason. - An entry matches when six values are equal: the rule,
kind_id, the input,key_path,span_text, andspan_lines. Line numbers are not used. An empty reason, an unknown rule, or a duplicate entry stops the run with exit code 66. An entry that matches nothing is named on stderr. README.mdhas ajqcommand that writes a template from the Report.- A pull request can add an acceptance file or change the configuration file. When the lint runs in a workflow that the author of the pull request cannot change, read these files from the base branch or protect them with CODEOWNERS.
Other inputs
--stdin-name NAMEreads one file from stdin as the pathNAMEof the repository.--exclude PATH(repeatable) leaves out a path. Excludedaction.ymlfiles are listed as excluded..github/workflowscannot be excluded, because GitHub always runs the workflows there.
Build, packaging, and development
- Release assets:
sisakulint_0.4.0_darwin_amd64.tar.gz,sisakulint_0.4.0_darwin_arm64.tar.gz,sisakulint_0.4.0_linux_amd64.tar.gz,sisakulint_0.4.0_linux_arm64.tar.gz,sisakulint_0.4.0_linux_armv6.tar.gz, andsisakulint_0.4.0_checksums.txt. The binaries are built withCGO_ENABLED=0. - Go: go.mod requires Go 1.26.11 (v0.3.8 required Go 1.26.9). In the 0.x line, #670 raised Go to 1.26.10 to fix a govulncheck finding in the standard library.
- Dependencies: v0.3.8 required
go-github,yaml.v3,mvdan.cc/sh,oauth2,fatih/color,go-sarif, and others. v0.4.0 requires no third-party module, and the repository has nogo.sum. - 32-bit build (#684): the first release run of v0.4.0 failed on linux/arm, because the bound
1<<40on the exponent of a JSON number overflowed the 32-bitint. The exponent is nowint64. - Tests:
go test ./...skips the 14 slowest tests unlessACTIONS_LONG=1(#681). Without the race detector,go test ./...took 2 minutes 25 seconds in the measurement of #681 (actions/rules 277 s → 101 s, actions/cli 191 s → 67 s, actions/reportview 137 s → 12 s). CI runs the tests without the race detector (#683).ACTIONS_UPSTREAM=1(withGH_TOKEN) runs the tests that compare data taken from other projects with those projects, and.github/workflows/upstream-drift.yamlruns them every week. CI also runs govulncheck v1.6.0 and checksgofmt. - The package layout is described in
CLAUDE.md.
Compatibility from here
The JSON schemas are sisakulint/report/v0, sisakulint/registry/v0, sisakulint/facts/v0, and sisakulint/acceptances/v0 (--version lists them). v0.4.0 does not promise that the JSON schemas and the Go packages stay compatible in later 0.x releases.
Upgrade checklist
- Install from the new module path, or pin 0.x with
go install github.com/sisaku-security/sisakulint/cmd/sisakulint@v0.3.8. Check Homebrew andsisakulint-actionbefore you upgrade them. - Replace the removed flags and the flags whose meaning changed (
-fix on,-format '{{…}}',-ignore,-enable-rule,-config-file,-github-token). - Rewrite the exit-code handling for bits 1, 2, 4, 8, and 16 and for codes 64, 66, 70, 74, and 75.
- Rewrite the rule names in
--skip-ruleand--rulewith the table in section 6 ofMIGRATION.md. - Move the configuration with
--init --legacy-configuration, and pass it with--config. - In CI, set
GITHUB_TOKENin theenvof the step, and pass--online --repo "$GITHUB_REPOSITORY"(or a facts file). - Upload SARIF with a new
categoryif you want to compare with the 0.x alerts. - Run once with
--format json, and look at theconditionalandinconclusivefindings. Answer the missing facts, or accept reviewedInconclusiveplaces with--accept.
Pull requests
- #670 Bump Go to 1.26.10 to fix a govulncheck standard library finding (@sushant-me)
- #679 Replace the 0.x implementation with the v1 linter, adapt CI, release, and review settings, and document the migration (@on-keyday)
- #680 MIGRATION.md: state that v0.4.0 is the first release of the rewritten linter (@on-keyday)
- #681 Skip the 14 slowest tests by default; run them with
ACTIONS_LONG=1(@on-keyday) - #682 Rename the module path to
github.com/gh-intel/sisakulint(@on-keyday) - #683 Before v0.4.0: remove time-bound statements from the documents, and run CI tests without the race detector (@on-keyday)
- #684 Fix the build for 32-bit platforms (linux/arm), which failed the v0.4.0 release (@on-keyday)
Full Changelog: v0.3.8...v0.4.0
sisakulint v0.4.0(日本語)
v0.4.0 は、sisakulint を書き直した v1 linter の最初のリリースです(「v1」は実装の名前で、バージョン番号ではありません)。フラグ、exit code、出力、ルール ID、設定ファイルは v0.3.8 以前と互換性がなく、互換レイヤーもありません。0.x と同じ名前のまま意味が変わったフラグがあるため、フラグ名だけを書き写した CI スクリプトはエラーにならずに動き、異なる結果を返します。
Important
CI スクリプト、Homebrew のインストール、gh-intel/sisakulint-action をアップグレードする前に、MIGRATION.md を読んでください。以下の節はその要約です。
ハイライト
- サードパーティの Go モジュールを使わない新しい解析エンジン。 v1 linter は、独自のロスレスな YAML 1.2.2 構文木で YAML を、式パーサーで
${{ }}式を、bash と sh のパーサーでrunのスクリプトを読みます。go.modにrequire行はなく、バイナリがリンクするのは Go の標準ライブラリだけです。 - セキュリティルール 35 件と品質ルール 13 件。 各セキュリティルールは脅威を宣言しています。攻撃者、イベント、攻撃者が得るもの、前提条件(GitHub のドキュメントや観測結果の引用付き)、報告されたインシデントです。
--explainで宣言を表示できます。 - CVSS v4.0 に基づく severity。 78 種類の finding kind はそれぞれ CVSS v4.0 ベクトルを持ち、各メトリクスに理由が付いています。finding kind の severity は、impact と likelihood の固定の表によってベクトルから求めます。
- 3 種類の certainty。
Findingはconfirmed、conditional(回答のない fact に依存する)、inconclusive(ルールが判断できなかった箇所)のいずれかです。certainty ごとに exit code の別のビットが立ちます。 - デフォルトはオフライン、fact は必要なときだけ取得。
--onlineを付けない限り、ネットワークは使いません。リポジトリ自身や他リポジトリについての fact(リポジトリが public か、タグのコミット、action の advisory など)は、--online、facts ファイル、--factから得ます。--onlineを付けると、他リポジトリの composite action(深さ 4 まで)と reusable workflow(深さ 3 まで)の中身もルールが読みます。 - プルリクエスト用のゲート。
--remote OWNER/REPO --pull-request N --pull-request-head SHAは、clone せずに GitHub API でプルリクエストの head を読み、そのプルリクエストが変更した入力だけを報告します。 - 副作用を明示した Fix。 12 ルールに 14 種類の fix kind があります。
--fixは safe な 2 種類を、--fix=reviewはすべての種類を適用し、--dry-runはgit apply用の diff を出力します。 - HTML レポートビュー。
--html FILEと--serveは、各Findingの evidence の経路を描画します。--examples --serveは全ルールの例のカタログを表示します。 - code scanning 向けの SARIF。 finding kind ごとに 1 つの SARIF ルールがあり、level は severity から決まり、fingerprint は行番号に依存しません。
アップグレードの前に(破壊的変更)
インストールとモジュールパス
Organization sisaku-security は gh-intel に名前が変わり、モジュールパスも変わりました。
| 0.x(v0.3.8 以前) | v0.4.0 以降 | |
|---|---|---|
| モジュールパス | github.com/sisaku-security/sisakulint |
github.com/gh-intel/sisakulint |
go install |
go install github.com/sisaku-security/sisakulint/cmd/sisakulint@v0.3.8 |
go install github.com/gh-intel/sisakulint/cmd/sisakulint@v0.4.0 |
- 0.x の各バージョンは 0.x のモジュールパスを宣言しているため、
go install github.com/gh-intel/sisakulint/cmd/sisakulint@v0.3.8は失敗します。0.x を使い続ける場合は 0.x のパスを指定してください。 - ソースからビルドするには Go 1.26.11 が必要です。
- コマンド名、コマンドのパッケージ(
cmd/sisakulint)、SARIF のツール名(sisakulint)は 0.x と同じです。 - Homebrew: tap は v0.4.0 以降を配布するため、
brew upgradeで 0.x が v1 linter に置き換わります。アップグレードの前にスクリプトを書き換えてください。 gh-intel/sisakulint-action: 現在の action では、入力versionを 0.4.0 以上にしないでください。604b94bの action はデフォルトで 0.3.0 をインストールし、常に-fix "$SISAKULINT_AUTOFIX"と-format '{{sarif .}}'を渡します。v1 linter はこれらのフラグで exit code 64 または 66 を返して停止します。さらに、action のゲートは ruleId の末尾(-criticalなど)とメッセージ中の単語から severity を推定しますが、v1 linter はどちらも出力しません。all-rules の例の SARIF では 237 件中 233 件がlowと判定され、デフォルトのfail-on: highではほとんどの結果が黙って通過します。action で v0.4.0 を使うのは、v1 linter のフラグを渡し、その severity を読むバージョンの action が出てからにしてください。
Exit code
0.x は 0(finding なし)、1(finding あり)、2(フラグのエラー)、3(致命的エラー)を返していました。v1 linter は、Report を書き出し、要求されたことをすべて終えた場合、次のビットの合計を返します。
| ビット | 立つ条件 |
|---|---|
| 1 | --fail-on 以上の confirmed な Finding がある |
| 2 | --fail-on 以上の conditional な Finding がある、または除外後に入力が残っていない |
| 4 | 内部エラーが起きた |
| 8 | --fail-on 以上のルールの inconclusive な Finding があり、--accept で受け入れられていない |
| 16 | 入力、または入力が呼び出す入力(uses: ./x)を読めない、または不正である |
それ以外の結果は、次のいずれか 1 つのコードになります。64、66、75 のときは stdout に何も出力しません。
| コード | 意味 |
|---|---|
| 64 | 使い方の誤り(0.x の 2) |
| 66 | 入力、facts ファイル、acceptance ファイル、設定ファイルを読めない・不正である、または --remote のリポジトリ・コミット・プルリクエストを読めない |
| 70 | すべての Fix を書き込めなかった |
| 74 | 出力ファイル(Report、SARIF、facts)を書き込めない |
| 75 | プルリクエストの head が --pull-request-head の値と異なる |
CI ゲートで確認すること:
- 0 以外のすべての exit code で失敗するゲートは、そのまま動きます。ビット 2 と 8 があるため、0.x より失敗する実行が増えます。
- exit code 2 と 3 は、フラグのエラーや致命的エラーを意味しなくなりました。それぞれビット 2、ビット 1 と 2 を意味します。
code & 1だけを見るスクリプトは、conditionalなFindingを黙って通します。exit code を 0 か 1 に変換する場合は、ビット 1、2、8、16 のいずれかが立っていれば 1 を返してください。ビット 4 と、64、66、70、74、75 は 0 に変換しないでください。--fail-on SEVERITY(info、low、medium、high、critical)は、ビット 1、2、8 を立てる最低の severity です。- 品質ルールの finding はどのビットも立てません。
0.x と同じ名前で意味が変わったフラグ
| 0.x | v0.4.0 での動作 | 代わりに使うもの |
|---|---|---|
-fix on、-fix off、-fix dry-run |
--fix は別の引数を値として取らない。on は存在しない PATH として読まれ、exit code 66 で停止する(-fix=on は 64) |
--fix(safe な Fix)、--fix=review(すべての Fix)、--fix --dry-run(stdout に diff)。off にあたるのは --fix を渡さないこと |
-verbose |
--detail full と同じ。進捗ログは出力しない |
Report(--format json)の inputs[] と errors[] を読む |
-init |
テンプレートを stdout に出力し、ファイルは作らない | --init > FILE |
-remote QUERY |
読むのは 1 リポジトリだけ。検索クエリ(org:…)は exit code 64 |
代替なし |
削除されたフラグ
削除されたフラグを渡すと、flag provided but not defined: -NAME と使い方を stderr に出力し、exit code 64 で停止します。
| 0.x | v0.4.0 |
|---|---|
-ignore REGEX |
--skip-rule ID[,ID…]。正規表現ではなく、ルール ID の完全一致。スキップしたルールは実行されない(0.x はルールを実行してから finding を捨てていた) |
-enable-rule NAME |
--rule ID[,ID…] は指定したルールだけを実行する。デフォルトのルールに 1 つ追加するには、すべての ID を並べる |
-format TEMPLATE |
--format text|line|json|sarif。Go テンプレートの代わりに、JSON の Report に jq を使う |
-config-file FILE |
--config FILE |
-github-token TOKEN |
環境変数 GITHUB_TOKEN のみ |
-pr N |
--remote OWNER/REPO --pull-request N |
-expected-head-sha SHA |
--pull-request-head SHA(exit code は 3 ではなく 75) |
-remote-checkout-dir DIR |
--write-snapshot DIR |
-remote-target PATH |
位置引数の PATH |
-r、-D |
--online で他リポジトリの reusable workflow と action を読む |
-stdin-filename、-generate-action-list、-boilerplate、-debug、-l、-p |
なし |
入力
- v1 linter は、リポジトリのルートを祖先ディレクトリにさかのぼって探しません。ルートは
--root(デフォルトは.)です。リポジトリのサブディレクトリで実行すると入力が見つからず、ビット 2 が立ちます。 - workflow として扱うのは、
.github/workflowsの直下にある.ymlと.yamlのファイルだけです。GitHub はそれより下のディレクトリにあるファイルを workflow として実行しません。リポジトリ内のすべてのaction.yml(action.ymlがない場合はaction.yaml)も入力になります。 - PATH 引数を渡すと、そのファイルだけを読みます。リポジトリ全体を読んだうえで PATH に関係する箇所だけを報告するには、
--read-all PATH…を使います。
設定ファイル
-
v1 linter は
.github/sisakulint.yamlを探しません。設定ファイルを読むのは--config FILEを渡したときだけです。--rootで他人のリポジトリを lint するときに、そのリポジトリ内のファイルでルールを外されないようにするためです。 -
キーは
exclude、fail-on、rule、skip-rule、accept、facts、repo、fact、add-attacker、no-assumptionsです。各キーは同名のフラグと同じように働きます。 -
0.x のファイルを移行するには、リポジトリのルートで次のコマンドを実行し、出力を読んでからコミットしてください。
sisakulint --init --legacy-configuration .github/sisakulint.yaml --root . > .github/sisakulint-config.yaml
action-listは factrepo.action-listに、config-variablesはrepo.configuration-variablesになります。secret-exfiltration.allowed-hostsと workflow のディレクティブ# sisakulint:secret-exfiltration.allowed-hosts: …はrequest.destination-trustedになり、現在の workflow が secret を送っている「secret と送信先」の組ごとに 1 エントリが作られます。0.x はホスト単位で送信先を許可していたため、移行後に workflow が同じホストへ別の secret を送るとFindingが出ます。self-hosted-runner.labelsは移行されません。移行されなかったエントリは、出力中のコメントと stderr の 1 行として出力されます。
GitHub API とトークン
- 0.x は常に GitHub API を呼び出していました。v1 linter が API を呼ぶのは
--onlineのときだけです。 - トークンは
GITHUB_TOKENからのみ読みます。SISAKULINT_GITHUB_TOKEN、GH_TOKEN、gh auth token、Git の credential helper は使いません。ローカルではGITHUB_TOKEN=$(gh auth token) sisakulint …のように実行してください。 - リポジトリ自身についての fact(public かどうか、デフォルトのトークンが書き込めるかどうかなど)を問い合わせるのは、
--repo OWNER/NAMEを渡したときだけです。名前を環境変数や git から推測することはしません。CI では--repo "$GITHUB_REPOSITORY"を渡してください。 - 0.x では、API 呼び出しに失敗したステップは finding なしで通過していました。v0.4.0 では、回答のない fact に依存する
Findingはconditionalになり、ビット 2 が立ちます。
出力、SARIF、reviewdog
- デフォルトの
--format textは、finding kind ごとにまとめた要約です。finding ごとに 1 行で出力するには--format line(path:line:column: severity kind: message)を使います。 - Go テンプレートはなくなりました。
--format jsonは Report(スキーマsisakulint/report/v0)を出力します。Report には、0.x のテンプレートでは出力できなかった各 finding のCondition、Inconclusive、Fixが含まれます。 - severity は
Findingのフィールドです。メッセージやルール ID には書かれません。 - reviewdog:
sisakulint -format "{{sarif .}}" | reviewdog -f=sarif …をsisakulint --format sarif | reviewdog -f=sarif …に書き換えてください。 - code scanning: ruleId は
<rule>.<kind>(例:code-injection.controlled)になり、fingerprint も 0.x とは異なります。SARIF のツール名はsisakulintのままなので、0.x と同じ category でアップロードすると 0.x の結果が上書きされます。MIGRATION.mdは、0.x のアラートが閉じられ、v1 の finding が新しいアラートとして開かれると推測しています(未検証)。比較のために 0.x のアラートを開いたままにしたい場合は、github/codeql-action/upload-sarifの入力categoryに別の値を指定してアップロードしてください。
ルール ID と実行されるルール
-
0.x の
-criticalと-mediumの組は 1 つの ID にまとまり、severity はFindingが持ちます(例:code-injection-criticalとcode-injection-mediumはcode-injectionになりました)。 -
その他の名前の変更と統合:
0.x v0.4.0 cache-poisoning-poisonable-stepuntrusted-checkoutimproper-access-controluntrusted-checkout、untrusted-checkout-toctouuntrusted-checkout-toctou/critical、/highuntrusted-checkout-toctoureusable-workflow-taintcode-injection、envvar-injection、output-clobbering、envpath-injectionref-confusioncommit-shaobfuscationuses-path(品質ルール。obfuscationのうちusesのパスの部分)deprecated-commandsunsecure-commands(set-envやadd-pathに攻撃者の値が入るもの)とdeprecated-commands(品質ルール)expressionモデルの Diagnosticとexpression(品質ルール) -
syntax、needs、id、workflow-callは、ルールではなくモデルのDiagnosticになりました。モデルのDiagnosticは、GitHub が workflow を読む時点で拒否する形を報告するものです。--skip-ruleでは除外できず、その入力はinvalidになり、ビット 16 が立ちます。 -
dependabot-ecosystemは削除されました。 -
次のルールは品質ルールになり、その finding は exit code のビットを立てません:
missing-timeout-minutes、archived-uses、deprecated-node-runtime、cache-bloat、dependabot-github-actions、dependency-review-settings、env-var、cond、uses-path、およびexpressionとdeprecated-commandsの一部。finding は Report のquality_findingsに入ります。CI ゲートには使わないでください。 -
fact を必要とするルールは、デフォルトのオフライン実行では動きません。
known-vulnerable-actions、impostor-commit、archived-uses、deprecated-node-runtimeは、--onlineを付けたとき、必要な fact に facts ファイルや--factが回答したとき、または--ruleで指定したときに動きます。0.x はこれらのために常に API を呼んでいました。action-listは、facts ファイルや--fact(設定ファイルのfactsとfactのキーを含む)がrepo.action-listに回答したとき、または--ruleで指定したときだけ動きます。--onlineだけでは動きません。missing-timeout-minutesは、0.x と同じく--ruleで指定したときだけ動きます。
Fix
v0.4.0 には、12 ルールに 14 種類の fix kind があります(「新機能」の「Fix」を参照)。次のルールは 0.x では自動修正がありましたが、v0.4.0 には Fix がありません: missing-timeout-minutes、credentials、permissions、dangerous-triggers、secrets-inherit、secret-exposure、secret-in-log、unmasked-secret-exposure、secrets-in-artifacts、argument-injection、request-forgery、envpath-injection、impostor-commit、cache-bloat、cond、uses-path(0.x の obfuscation)、dependabot-github-actions。
値なしの --fix は safe な Fix だけを適用します。fact を必要とする Fix(例: タグのコミット SHA)は、実行前にその fact が回答されている場合(--online、--facts、--fact)にだけ作られます。0.x では、commit-sha の Fix が修正中に API を呼び、レート制限に達すると exit code 3 で停止していました。
同じ workflow での検出結果の違い
2026-11-15 に、全ルールの Example の入力に対して 0.x と v1 linter を実行して比較しました。ユーザーの workflow ではないため、手元の workflow での違いはこれと異なる場合があります。0.x だけが報告する finding の大きなまとまりは次のとおりです。
- ステップ、および reusable workflow を呼び出す job に対する
missing-timeout-minutes。v1 linter はruns-onを持つ job だけを報告します。job のtimeout-minutesはそのステップにも適用されるためです。 - アップロードを伴わない checkout に対する
artipacked。v1 linter は、認証情報が artifact に入る形だけを報告します。 - 組み込みの Node.js バージョン表に基づく
deprecated-node-runtime。v1 linter は factaction.runs-usingを問い合わせ、回答がなければ実行しません。ローカルの action(uses: ./x)では、ステップではなくx/action.ymlのruns.usingを報告します。 - 1 つの害を何度も報告していたもの。0.x は、プルリクエストのコードを実行する後続のステップごとに
cache-poisoning-poisonable-stepを報告していました。v1 linter は害ごとに 1 つのFindingを報告し、後続のステップはEvidenceやRelatedに含めます。
新機能
ルール
35 件のセキュリティルールを、欠陥の種類(--explain の weakness)ごとに並べています。ルールの severity は、その finding kind のうち最も重い severity です。
| 欠陥の種類 | ルール(severity) |
|---|---|
| スクリプトインジェクション | code-injection(critical) |
| 引数インジェクション | argument-injection(critical) |
| 環境ファイルインジェクション | envvar-injection(critical)、output-clobbering(critical)、envpath-injection(high) |
| ワークフローコマンドインジェクション | set-output-injection(critical)新規、unsecure-commands(critical)新規 |
| リクエストフォージェリ | request-forgery(critical) |
| 信頼できないコードの実行 | untrusted-checkout(critical)、artifact-poisoning(critical)、untrusted-checkout-toctou(medium)、self-hosted-runner(high) |
| ゲートの迂回 | bot-conditions(critical)、unsound-contains(critical) |
| AI エージェントの乗っ取り | ai-action-excessive-tools(critical)、ai-action-execution-order(high)、ai-action-prompt-injection(high)、ai-action-unrestricted-trigger(high)、ai-action-unsafe-sandbox(high) |
| 信頼できない参照 | known-vulnerable-actions(critical)、commit-sha(high)、impostor-commit(high)、action-list(high)、unpinned-images(high) |
| 認証情報の漏えい | artipacked(critical)、credentials(critical)、secret-in-log(critical)、secrets-in-artifacts(critical)、unmasked-secret-exposure(critical)、secret-exfiltration(medium) |
| 過剰な権限 | cache-poisoning(high)、dangerous-triggers(high)、permissions(high)、secret-exposure(high)、secrets-inherit(high) |
78 種類の finding kind の内訳は、critical 31、high 42、medium 3、low 2 です。
新しいセキュリティルール:
set-output-injection:idを持つステップが、攻撃者の値(issue のタイトル、コミットメッセージなど)をログに出力します。ACTIONS_ALLOW_UNSECURE_COMMANDSの値に関係なく、runner はログの行中の##[set-output name=…;]と行頭の::set-outputをコマンドとして読み、ステップの output を書き込みます。unsecure-commands:ACTIONS_ALLOW_UNSECURE_COMMANDSが true のステップで攻撃者の値がログに出力され、runner がそれをset-envやadd-pathとして読みます。攻撃者は後続ステップの env と PATH を書き換えられます。
品質ルール 13 件: allowed-actions、archived-uses、cache-bloat、cond、dependabot-github-actions、dependency-review-settings、deprecated-commands、deprecated-node-runtime、env-var、expression、missing-timeout-minutes、unset-configuration-variable、uses-path。品質ルールの finding 単体では、攻撃者は何も得ません。品質ルールには脅威、CVSS、severity がありません。
新しい品質ルール:
allowed-actions:usesが、リポジトリの allowed actions 設定(factrepo.allowed-actions)で許可されていない action、reusable workflow、イメージを指定している。または、設定が完全なコミット SHA を要求しているのに、usesがタグやブランチを指定している。GitHub は実行を開始しないか、Set up job で job を失敗させます。unset-configuration-variable:${{ }}がvars.<name>を読んでいるが、どのレベル(リポジトリ、Organization、environment)でもその変数が定義されていない。GitHub は値を空文字列にし、それを渡したfromJSONは失敗します。uses-path:usesのパスに空の要素、.、..、\が含まれている、またはパスがリポジトリやワークスペースのルートより上に出る。GitHub は書かれたとおりには読みません。0.x のobfuscationのうちusesの部分を引き継ぎます。
すべてのルールに脅威モデル
--explain IDと--explain=allは、各ルールを Markdown で出力します。内容は、問題、期待される状態、脅威(引用と観測結果付きの前提条件、攻撃者、イベント、得るもの、advisory や CVE 付きのインシデント)、finding kind、副作用付きの fix kind、検出しない形(undetected forms)、inconclusive kind、誤検知になる形(false positive forms)、例です。--explain=termsは、項目名と値の定義を出力します。--registryは同じ宣言を JSON(sisakulint/registry/v0)で出力し、--registry=fullは各例の fact の回答も加えます。プログラムからはこの JSON を読んでください。--explainの Markdown は変わることがあります。- severity: 各 finding kind は CVSS v4.0 の Base メトリクスと Exploit Maturity(
E)を持ち、各値に理由が付いています。impact は VC、VI、VA、SC、SI、SA のうち最も高い値です。likelihood は AV、AT、PR から決まり、AC:H または UI:A で 1 段階下がります。impact と likelihood から表で severity を決めます(例: impact が H で likelihood が high なら critical)。--explainは参考として、FIRST のリファレンス計算機を移植した実装で求めた CVSS-B と CVSS-BT も出力します。
certainty、仮定、攻撃者
confirmedはビット 1 を立てます。conditional(Findingが回答のない fact に依存している。Report にその fact が示される)はビット 2 を立てます。inconclusive(ルールが読まない値など、ルールが判断できない箇所)はビット 8 を立てます。- どこからも回答のない fact には仮定の値(最悪の場合)を使い、それを表示します(例:
assumed: repo.default-token-write = true)。--no-assumptionsを付けると、それらの fact を不明として扱います。 - デフォルトの実行では、外部の人による攻撃だけを数えます。
--add-attacker VALUEは、攻撃者を 1 人追加した実行も行います。値はread-member、triage-account、writer-pull-requests-token、writer-issues-token、required-reviewer、app-installation-token、variables-writer、secrets-writerです。追加した攻撃者がいるときだけ現れるFindingには印が付きます(Report のadded_attackers、テキスト出力のadded attacker:、SARIF のproperties.added_attackers)。各値がどの承認、ゲート、ifを通過できるかはactions/boundaryの表で決まり、表の各行には根拠があります。--add-attackerは--fixと同時に使えません。
fact
--onlineは GitHub API に問い合わせます(トークンはGITHUB_TOKEN)。--github-api URLで GitHub Enterprise Server の API のルートを指定できます。--facts FILEはファイルから回答を読み、--write-facts FILEはその実行で問い合わせた fact と回答を書き出します。別のマシンで書き出した facts ファイルを使えば、ネットワークのない CI でも実行できます。--fact KIND=VALUEまたは--fact 'KIND[ARG=VALUE,…]=VALUE'は 1 つの fact に回答します(値は JSON)。優先順位は--fact、facts ファイル、API の順です。- fact の種類は 29 あります。例:
repo.public、repo.default-token-write、repo.environment-protected、repo.fork-pr-secrets、git.ref-commit、git.commit-ref、package.advisories、action.definition、workflow.definition、request.destination-trusted。すべての種類と、--onlineが各種類にどう回答するかは--explain=termsに載っています。 - 他リポジトリの action と reusable workflow:
--online(または回答を含む facts ファイル)を使うと、composite action とその中のステップを深さ 4 まで(action.definition)、reusable workflow とその job を深さ 3 まで(workflow.definition)読みます。中で見つかったFindingは呼び出し側のusesに報告され、中の位置はEvidenceの先頭に入り、Fixはありません。action は runner が取得するアーカイブから、reusable workflow はコミットの blob から読みます。回答が得られない場合(private リポジトリ、サイズやリクエスト数の上限、深さの上限を超えた場合)、その箇所はInconclusive(remote-unknown、remote-callee-unknown)になり、ビット 8 が立ちます。 pull_request_targetのポリシー: public リポジトリでpull_request_targetを止める GitHub のデフォルトポリシーは、2026-12-02 に適用されます。このポリシーで止まる workflow について--fact 'repo.pull-request-target-allowed[input_path=.github/workflows/<file>]=false'と回答すると、攻撃者のイベントがpull_request_targetだけの finding は報告されなくなります。この fact は API には問い合わせません。回答がなければ、ルールは実行が開始されるものとして扱います。.github/dependabot.ymlと Renovate の設定は、--root以下のファイルから fact として読みます。
Warning
--write-facts で書き出した facts ファイルには、読み込んだ action と reusable workflow の内容が含まれます。private リポジトリのものも含まれます。
リモートのリポジトリとプルリクエスト
--remoteは、--rootの代わりに GitHub のリポジトリを読みます。指定できるのはOWNER/REPO、OWNER/REPO@REF(ブランチ、タグ、コミット SHA)、または URL(https://github.com/OWNER/REPO、…/tree/<ref>、…/pull/<N>)です。最初に ref をコミットに解決し、以後はそのコミットだけを、git の tree API と blob API でファイルごとに読みます。clone もディスクへの書き込みもしません。Report のremote_revisionには、リポジトリ、ref、コミット、tree、読んだ各ファイルとその blob SHA が載ります。- 上限は、1 回の実行につき 1000 リクエスト、1 ファイルにつき 1 MiB です(上限を超えた入力は読めないものとして扱われ、ビット 16 が立ちます)。tree のエントリが 100,000 を超える場合、レート制限、ネットワークエラーのときは exit code 66 で停止します。トークンがない場合、API は 1 時間に 60 リクエストまでで、1 ファイルに 1 リクエストを使います。
--pull-request Nは、プルリクエストの head を読み(fork からのプルリクエストも読めます)、そのプルリクエストが変更した入力だけを報告します。変更は merge base と head の tree の差から求めます。symlink の参照先の変更や、uses: ./で呼ばれる submodule のコミットの変更も変更として数えます。入力ではないが読み込むファイル(.github/dependabot.yml、labeler の設定)をプルリクエストが変更した場合は、すべての入力を報告します。--pull-request-head SHAは、プルリクエストの head がその SHA でないとき、exit code 75 で停止します。結果をコミットに紐付ける場合(例: status check)に渡してください。remote_revision.pull_request.behind_byは、base が merge base からどれだけ先に進んだかを示します。進んだ部分が入力や読み込んだファイルに触れている場合は、ビット 16 が立ちます。--write-snapshot DIRは、読み込んだファイルを新しいディレクトリに書き出します。--fixと組み合わせると、そこにあるファイルを修正します。- ゲートとして使う前に確認すべきことは
README.mdにあります。strict なブランチ保護または merge queue を使うこと、プルリクエストが変更できない場所でゲートを動かすこと、--acceptの限界です。
Fix
| ルール | fix kind | safety | 内容 |
|---|---|---|---|
commit-sha |
pin-sha |
safe | ref を、runner が現在それに対して実行するコミットの完全な SHA に固定する |
untrusted-checkout-toctou |
pin-head-sha |
safe | ブランチや refs/pull/<n>/head の代わりに、承認時に見たコミット github.event.pull_request.head.sha を checkout する |
untrusted-checkout-toctou |
pin-head-sha-review |
review | refs/pull/<n>/merge の代わりに、承認時に見た head を checkout する |
code-injection |
env-var |
review | 式をステップの env に移し、シェルに必要なクォートを付けて変数を読む(bash と sh) |
code-injection、envvar-injection、output-clobbering |
env-var-review |
review | 式を env に移し、"${NAME}"(bash、sh)、$env:NAME(pwsh)、process.env.NAME(github-script)として読む。$GITHUB_ENV や $GITHUB_OUTPUT に書く値から改行を取り除くか、name<<DELIM の区切り文字をランダムにする |
untrusted-checkout |
base-checkout |
review | base のコードを checkout する(プルリクエストを指す入力を取り除く) |
artifact-poisoning |
runner-temp-path |
review | artifact をワークスペースの外の ${{ runner.temp }}/artifacts にダウンロードする |
artipacked |
persist-credentials-false |
review | checkout に persist-credentials: false を付ける |
bot-conditions |
author-context |
review | actor の代わりに github.event.pull_request.user.login を比較する |
cache-poisoning |
cache-mode-no-write |
review | 攻撃者のイベントではキャッシュに何も保存しない |
known-vulnerable-actions |
upgrade-version |
review | 完全な SHA に固定された uses を、見つかったすべての advisory を修正した最初のバージョンのコミットに固定し、行末のコメントにそのバージョンを書く |
unsound-contains |
contains-array |
review | contains(fromJSON('[...]'), x) にして、値全体で比較する |
unsound-contains |
equality |
review | contains(x, 'value') を x == 'value' にする |
--fixは safe な種類を、--fix=reviewはすべての種類を適用します。--dry-runは、ファイルを書き換える代わりにgit applyで適用できる diff を出力します。- review の Fix の副作用(
Findingの解消以外の変化)は、テキスト出力の fix 行の下と、Report のfix.side_effectsに出力されます。 --fixは、実行したルールで修正結果を確認します。他のFindingの certainty や condition を変えるFixはエラーになります。適用したFixが、スキップしたルールの読む部分を変えた場合、そのルールはnot checked:として報告されます。
$ sisakulint --root . --fix=review --dry-run
diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml
--- a/.github/workflows/triage.yml
+++ b/.github/workflows/triage.yml
@@ -6,4 +6,6 @@
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - run: echo "${{ github.event.issue.title }}"
+ - run: echo "${ISSUE_TITLE}"
+ env:
+ ISSUE_TITLE: ${{ github.event.issue.title }}出力
issues で起動し、run に ${{ github.event.issue.title }} を書いた workflow に対する、デフォルトのテキスト出力です(一部省略)。
$ sisakulint --root .
critical code-injection.controlled .github/workflows/triage.yml:9:24
github.event.issue.title is written into the run script by ${{ }}, and an attacker controls it on issues
impact: the value becomes code
9 | - run: echo "${{ github.event.issue.title }}"
| ^^^^^^^^^^^^^^^^^^^^^^^^
remedy: pass it through env and read the variable
fix (review): move the expressions into the env of the step, and read the variables where they were, quoted as the shell needs (bash and sh) [--fix=review]
high dangerous-triggers.token-write .github/workflows/triage.yml:6:5
the job runs on issues, which an attacker triggers, with no approval and a GITHUB_TOKEN that may write
...
assumed: repo.default-token-write = true (--no-assumptions to drop)
high commit-sha.unpinned .github/workflows/triage.yml:8:32
actions/checkout@v4 is not pinned to a full commit SHA
...
no fix: the commit of the ref is not known (offline: pass --facts or --online)
quality
dependabot-github-actions.no-update-tool
.github/workflows/triage.yml:8:32 no update tool updates actions/checkout@v4 ...
inputs 1 read (every workflow and action.yml under --root)
...
not run known-vulnerable-actions: ... in a run without --rule, the rule runs when --online is given, ...
4 findings: 4 confirmed (critical 1, high 3), 0 conditional, 0 inconclusive
1 quality finding: the bits do not count quality findings
bits 1 = 1 (confirmed findings)--formatはtext(デフォルト)、line、json、sarifから選びます。--detail summary|normal|full(-vはfull)と--color auto|always|never(autoはNO_COLORに従う)も使えます。--report FILEは JSON の Report を、--sarif FILEは SARIF を、stdout への出力に加えて書き出します。- Report には、
findings[](certainty、condition、evidence、関連箇所、fix、fingerprint を含む)、quality_findings、inputs[]、errors[]、skipped_rules、reported_inputs、remote_revisionがあります。 --versionは、バージョン、コミット、Go のバージョンとプラットフォーム、バイナリが読み書きする JSON スキーマを出力します。
SARIF と code scanning
- finding kind ごとに 1 つの SARIF ルール(
reportingDescriptor)があり、ID は<rule>.<kind>です。critical と high はerror、medium はwarning、low と info はnoteになり、security-severityも設定されます。品質ルールの finding は、セキュリティアラートではないnoteになります。 Inconclusiveは、タグsecurityとinconclusiveを持つアラートになります。--acceptで受け入れたInconclusiveは出力されません。conditionalなFindingはconfirmedと同じアラートになり、回答のない fact がメッセージの末尾に付きます。Relatedの箇所はrelatedLocationsに書かれ、メッセージからリンクされます。partialFingerprints.primaryLocationLineHashは、行番号を含まないFingerprintから作られます。そのため、行が移動してもFindingは同じアラートのままです。- ファイルの位置は
uriBaseIdが%SRCROOT%の相対 URI で、lint を実行したマシンの絶対パスは書かれません。 - 読めなかった入力と内部エラーは
invocations[0].toolExecutionNotificationsに書かれます。
permissions:
contents: read
security-events: write
actions: read # private リポジトリでのみ必要
steps:
# actions/checkout と、sisakulint をインストールするステップの後に置く
- run: sisakulint --root . --sarif sisakulint.sarif
- if: ${{ !cancelled() }}
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: sisakulint.sarifHTML レポートビューと例のカタログ
--html FILEはファイルに書き出し、--serveは 127.0.0.1 で表示します(別のループバックアドレスには--serve=ADDR)。このページは各FindingのEvidenceの経路を描画し、品質ルールの finding の行に印を付け、各 finding の条件を試せるようにします。--examples --serveは、全ルールと全品質ルールのExampleを、それぞれの例の fact の回答で実行した結果を表示します(1 ルールだけなら--examples=RULE --html FILE)。カタログは、ルールをweaknessまたはattack meansでグループ化し、「boundary」(ロールごとの得るものと、その根拠の行)を表示し、--explain=termsの定義にリンクします。
Warning
HTML には workflow の行が含まれます。private リポジトリの HTML を共有すると、その行が漏れます。
Inconclusive の受け入れ
- 人が
Inconclusiveの箇所を確認し、値が攻撃者の値ではないと判断した場合は、その箇所を理由とともに acceptance ファイル(sisakulint/acceptances/v0)に書き、--accept FILEで渡します。その箇所はビット 8 を立てなくなり、Report のfindings[]にはacceptance.reason付きで残ります。 - エントリは、ルール、
kind_id、入力、key_path、span_text、span_linesの 6 つの値が等しいときに一致します。行番号は使いません。理由が空のエントリ、未知のルール、重複したエントリがあると、exit code 66 で停止します。どれにも一致しなかったエントリは stderr に表示されます。 - Report からテンプレートを作る
jqコマンドがREADME.mdにあります。 - プルリクエストで acceptance ファイルを追加したり、設定ファイルを変更したりできます。プルリクエストの作者が変更できない workflow で lint を動かす場合は、これらのファイルを base ブランチから読むか、CODEOWNERS で保護してください。
その他の入力
--stdin-name NAMEは、stdin から 1 ファイルを読み、リポジトリのパスNAMEのファイルとして扱います。--exclude PATH(繰り返し指定可)はパスを除外します。除外したaction.ymlは、除外済みとして一覧に載ります。GitHub は.github/workflowsの workflow を常に実行するため、このディレクトリは除外できません。
ビルド、パッケージ、開発
- リリースアセット:
sisakulint_0.4.0_darwin_amd64.tar.gz、sisakulint_0.4.0_darwin_arm64.tar.gz、sisakulint_0.4.0_linux_amd64.tar.gz、sisakulint_0.4.0_linux_arm64.tar.gz、sisakulint_0.4.0_linux_armv6.tar.gz、sisakulint_0.4.0_checksums.txt。バイナリはCGO_ENABLED=0でビルドしています。 - Go: go.mod は Go 1.26.11 を要求します(v0.3.8 は Go 1.26.9)。0.x の系列では、#670 で標準ライブラリに対する govulncheck の指摘を解消するため、Go を 1.26.10 に上げています。
- 依存関係: v0.3.8 は
go-github、yaml.v3、mvdan.cc/sh、oauth2、fatih/color、go-sarifなどを必要としていました。v0.4.0 はサードパーティのモジュールを必要とせず、リポジトリにgo.sumはありません。 - 32 ビットビルド(#684): v0.4.0 の最初のリリース実行は linux/arm で失敗しました。JSON の数値の指数に対する上限
1<<40が、32 ビットのintでオーバーフローしたためです。指数はint64になりました。 - テスト:
go test ./...は、ACTIONS_LONG=1でない限り、最も遅い 14 個のテストをスキップします(#681)。#681 の計測では、race detector なしのgo test ./...は 2 分 25 秒でした(actions/rules 277 秒 → 101 秒、actions/cli 191 秒 → 67 秒、actions/reportview 137 秒 → 12 秒)。CI は race detector なしでテストを実行します(#683)。ACTIONS_UPSTREAM=1(GH_TOKEN付き)は、他プロジェクトから取り込んだデータをそのプロジェクトと比較するテストを実行し、.github/workflows/upstream-drift.yamlが毎週それを実行します。CI は govulncheck v1.6.0 とgofmtのチェックも実行します。 - パッケージの構成は
CLAUDE.mdに書かれています。
今後の互換性
JSON スキーマは sisakulint/report/v0、sisakulint/registry/v0、sisakulint/facts/v0、sisakulint/acceptances/v0 です(--version で一覧できます)。v0.4.0 は、以降の 0.x リリースで JSON スキーマと Go パッケージの互換性が保たれることを約束しません。
アップグレードのチェックリスト
- 新しいモジュールパスからインストールするか、
go install github.com/sisaku-security/sisakulint/cmd/sisakulint@v0.3.8で 0.x に固定する。Homebrew とsisakulint-actionは、アップグレードする前に確認する。 - 削除されたフラグと、意味が変わったフラグ(
-fix on、-format '{{…}}'、-ignore、-enable-rule、-config-file、-github-token)を置き換える。 - exit code の処理を、ビット 1、2、4、8、16 とコード 64、66、70、74、75 に合わせて書き換える。
--skip-ruleと--ruleのルール名を、MIGRATION.mdの 6 節の表に従って書き換える。--init --legacy-configurationで設定を移行し、--configで渡す。- CI では、ステップの
envにGITHUB_TOKENを設定し、--online --repo "$GITHUB_REPOSITORY"(または facts ファイル)を渡す。 - 0.x のアラートと比較したい場合は、新しい
categoryで SARIF をアップロードする。 - 一度
--format jsonで実行し、conditionalとinconclusiveの finding を確認する。足りない fact に回答するか、確認済みのInconclusiveを--acceptで受け入れる。
プルリクエスト
- #670 govulncheck の標準ライブラリに対する指摘を解消するため、Go を 1.26.10 に更新(@sushant-me)
- #679 0.x の実装を v1 linter に置き換え、CI・リリース・レビューの設定を対応させ、移行手順を文書化(@on-keyday)
- #680 MIGRATION.md: v0.4.0 が書き直した linter の最初のリリースであることを明記(@on-keyday)
- #681 最も遅い 14 個のテストをデフォルトでスキップし、
ACTIONS_LONG=1で実行するように変更(@on-keyday) - #682 モジュールパスを
github.com/gh-intel/sisakulintに変更(@on-keyday) - #683 v0.4.0 の前に、文書から時期に依存する記述を取り除き、CI のテストを race detector なしで実行するように変更(@on-keyday)
- #684 v0.4.0 のリリースを失敗させた 32 ビットプラットフォーム(linux/arm)のビルドを修正(@on-keyday)
Full Changelog: v0.3.8...v0.4.0