chore: publish IntegraCI build modules 732ec6c83925

This commit is contained in:
dhimaz0445 committed 2026-10-28 08:09:16 +00:00
1 parent 7a84930dea
commit 5f8a24d014
133 files changed
+18990 -2

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
# sast-scan
> **UNVERIFIED SCAFFOLD** — run `dagger develop` + `dagger functions` + test
> against a matching Dagger engine (engineVersion `v0.15.0`) before use. The
> Go in `main.go` has NOT been compiled or validated by Dagger codegen in
> this environment (`dagger develop` is unavailable, and the `dag` global
> plus the `*Directory` / `*Container` / `*File` types are generated). Do not
> assume it works as-is.
IntegraCI SAST (Static Application Security Testing) Dagger module. Runs
[Semgrep](https://semgrep.dev/) over a source directory, emits a SARIF
report, counts findings, and optionally POSTs the result to the IntegraCI
API.
It mirrors the structure and idioms of the sibling `security-scan` module.
## Functions
### `scan`
Runs Semgrep static analysis and returns a `ScanResult`.
| Param | Required | Default | Description |
| ------------ | -------- | ----------- | ------------------------------------------------ |
| `source` | yes | — | Source directory to scan |
| `tool` | no | `semgrep` | SAST tool to run; `none` skips scanning |
| `api-url` | no | — | IntegraCI API URL for posting results |
| `token` | no | — | JWT token for API authentication |
| `service-id` | no | — | Service ID to link scan results |
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.
## Usage
> These commands are illustrative and have NOT been run here. Verify against
> a live Dagger engine first.
```sh
# Scan and post results to the IntegraCI API
dagger call scan \
--source . \
--api-url http://localhost:8000 \
--token "$TOKEN" \
--service-id "$SVC_ID"
# Scan only (no API post)
dagger call scan --source .
# Skip scanning
dagger call scan --source . --tool none
```
## Verifying the scaffold
```sh
dagger develop # generate the SDK + codegen
dagger functions # confirm the 'scan' function is exposed
gofmt -l main.go # confirm formatting (should print nothing)
```