chore: publish IntegraCI build modules a11ec75d3e09

This commit is contained in:
dhimaz0445 committed 2026-11-11 03:41:55 +00:00
1 parent 694710104a
commit 3c2b80914e
78 files changed
+4982 -405

No files matched your search

+39
View File
@@ -32,6 +32,45 @@ When `tool=none`, the scan is skipped and a result with `skipped=true` is
returned. Results are POSTed to the API only when both `api-url` and
`token` are set.
## Air-gapped rules (`--rules-dir`, ADR-0093 §8)
`semgrep --config=auto` fetches its rules from the Semgrep registry and sends
the project URL, so it cannot run air-gapped. Pass `--rules-dir` with the
extracted `sast-rules` content pack (`catalog/sast-rules`, ADR-0078) and the
module runs `semgrep scan --config=/rules --metrics=off` with
`SEMGREP_SEND_METRICS=off` and `SEMGREP_ENABLE_VERSION_CHECK=0`. `auto` is
never used then. The argument builder is `semgrep_args.go`, tested without an
engine in `semgrep_args_test.go`.
Without `--rules-dir` the legacy `--config=auto` run is unchanged and does
NOT get `--metrics=off`: semgrep refuses that pair ("Cannot create auto config
when metrics are off", exit 2).
Licences: the pack holds only in-house or permissively licensed rule files
(the Semgrep-maintained registry rules are under the Semgrep Rules License
v1.0, which forbids redistribution). The semgrep engine (LGPL-2.1) is never
bundled by IntegraCI; the customer's mirror pulls `semgrep/semgrep` from
upstream.
```sh
dagger call sarif --source . --rules-dir ./sast-rules export --path=integraci-sarif/sast.sarif
```
### Which ruleset ran (#2908)
`--rules-dir` accepts any directory, and SARIF does not say which rule files
produced it. `scan` therefore digests the directory it mounts at `/rules`
(`ruleset.go`: for each non-hidden file in byte order of its relative path,
`<path>\0<sha256 hex>\n`, then `sha256:` + the sha256 of those lines) and
posts it as `report_data.sast_ruleset_digest`. The platform computes the digest
of the pack it ships (`catalog/sast-rules/rules`) itself and compares; where
the gate point and the `sast` family both enforce, a SAST scan of record with
no digest (no `--rules-dir`, CodeQL) or another one is `unknown`. The posted
value is never taken as the pack's digest. Paths with a hidden segment
(`.gitkeep`) are skipped on both sides. The API image and the pack the runners
mount must be deployed together: a pack revision the API image does not carry
reads `unknown`.
## Usage
> These commands are illustrative and have NOT been run here. Verify against