{"id":48030432,"url":"https://github.com/aflock-ai/cilock-action","last_synced_at":"2026-05-26T01:00:54.306Z","repository":{"id":346061188,"uuid":"1165055877","full_name":"aflock-ai/cilock-action","owner":"aflock-ai","description":"GitHub Actions and GitLab CI integration for cilock — wrap any command or downstream action and emit a signed in-toto attestation.","archived":false,"fork":false,"pushed_at":"2026-05-21T20:09:16.000Z","size":1068,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T04:26:00.409Z","etag":null,"topics":["attestation","build-provenance","ci-cd","devsecops","dsse","github-actions","gitlab-ci","in-toto","sigstore","slsa","supply-chain-security"],"latest_commit_sha":null,"homepage":"https://cilock.aflock.ai/tutorials/github-actions-pipeline","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aflock-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-23T19:24:07.000Z","updated_at":"2026-05-21T20:09:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aflock-ai/cilock-action","commit_stats":null,"previous_names":["aflock-ai/cilock-action"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/aflock-ai/cilock-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aflock-ai%2Fcilock-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aflock-ai%2Fcilock-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aflock-ai%2Fcilock-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aflock-ai%2Fcilock-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aflock-ai","download_url":"https://codeload.github.com/aflock-ai/cilock-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aflock-ai%2Fcilock-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33499282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attestation","build-provenance","ci-cd","devsecops","dsse","github-actions","gitlab-ci","in-toto","sigstore","slsa","supply-chain-security"],"created_at":"2026-04-04T13:55:03.494Z","updated_at":"2026-05-26T01:00:54.294Z","avatar_url":"https://github.com/aflock-ai.png","language":"Go","funding_links":[],"categories":["Point-of-use validations"],"sub_categories":["Vulnerability information exchange"],"readme":"# cilock-action\n\nGitHub Action that wraps a command (or another action) with [cilock](https://github.com/aflock-ai/rookery) attestation. Records what ran, what files it touched, what containers it pulled, and what credentials it leaked — all into a signed [in-toto](https://in-toto.io/) statement.\n\n```yaml\n- uses: aflock-ai/cilock-action@v1\n  with:\n    step: build\n    attestations: \"environment git github sbom secretscan\"\n    outfile: ${{ github.workspace }}/attestation.json\n    command: make build\n```\n\nSee [`action.yml`](action.yml) for every input.\n\n## The `outfile` is a DSSE envelope, not a raw attestation\n\nThis trips up everyone the first time, including the people writing this README. The file at `outfile:` is a [DSSE](https://github.com/secure-systems-lab/dsse) envelope:\n\n```json\n{\n  \"payloadType\": \"application/vnd.in-toto+json\",\n  \"payload\": \"\u003cbase64-encoded in-toto Statement\u003e\",\n  \"signatures\": [{ \"keyid\": \"…\", \"sig\": \"…\", \"cert\": \"…\" }]\n}\n```\n\nThe actual attestation content — `predicateType`, `subject`, `predicate.attestations[]` — lives **inside `.payload`, base64-encoded**. Treating the envelope as the statement leads to OPA policies that silently match nothing because `input.predicate` doesn't exist at the envelope level.\n\n### Decode it before consuming\n\n```bash\n# Inspect the inner Statement\njq -r '.payload' attestation.json | base64 -d | jq .\n\n# Predicate type\njq -r '.payload' attestation.json | base64 -d | jq -r '.predicateType'\n# → https://aflock.ai/attestation-collection/v0.1\n\n# Per-attestor entries (this is where secretscan findings, trace data, etc. live)\njq -r '.payload' attestation.json | base64 -d \\\n  | jq '.predicate.attestations[] | {type, attestation_keys: (.attestation | keys)}'\n```\n\n### Feed it to OPA\n\nOPA Rego policies that match on `input.predicate.attestations[]` need the **decoded** statement, not the envelope. The right shape:\n\n```bash\njq -r '.payload' attestation.json | base64 -d \u003e /tmp/statement.json\n\nopa eval -d policy.rego -i /tmp/statement.json 'data.cilock.verify.deny' -f json\n```\n\nIf your policy expects a specific attestor's data at the top level (e.g. trace data from `command-run`), drill in one more layer:\n\n```bash\njq '.predicate.attestations[] | .attestation | select(has(\"processes\"))' /tmp/statement.json \\\n  \u003e /tmp/trace-input.json\n\nopa eval -d policy-trace.rego -i /tmp/trace-input.json 'data.cilock.verify.deny' -f json\n```\n\n### Why DSSE?\n\nDSSE is what makes the signature meaningful — it covers the exact bytes of the payload (including `payloadType`), so downstream verifiers can prove what was signed without re-canonicalizing JSON. The base64 wrapping prevents whitespace and key-ordering changes from invalidating signatures.\n\nThe downside is the extra unwrap step. If you build CI checks against cilock attestations, write a small helper:\n\n```bash\n# decode_attestation.sh\njq -r '.payload' \"$1\" | base64 -d\n```\n\n…and use it everywhere.\n\n## Inputs\n\nSee [`action.yml`](action.yml). The most-used ones:\n\n| Input | Purpose |\n|---|---|\n| `step` | Step name embedded in the attestation (required) |\n| `command` / `action-ref` | What to wrap (exactly one required) |\n| `attestations` | Space-separated attestor list |\n| `outfile` | Path for the DSSE envelope. **Format above.** |\n| `trace` | Enable command tracing (`ptrace` on Linux) |\n| `enable-sigstore` | Sign with Fulcio (default `true`) |\n| `enable-archivista` | Upload to Archivista (default `true`) |\n| `cilock-args` | Pass-through args to attestors (see [supported flags](#cilock-args-passthrough)) |\n\n### `cilock-args` passthrough\n\ncilock-action runs the rookery library in-process — it does not shell out to the cilock binary — so only flags that the action explicitly translates take effect. Currently supported:\n\n- `--attestor-secretscan-fail-on-detection [bool]` — exit non-zero when secretscan records findings\n- `--attestor-secretscan-max-decode-layers \u003cint\u003e` — how many encoding layers to recursively decode (default 3)\n- `--attestor-secretscan-max-file-size \u003cint-mb\u003e` — skip files larger than this\n- `--attestor-secretscan-config-path \u003cpath\u003e` — custom Gitleaks config\n\nUnknown flags are silently ignored. File an issue or PR if you need another attestor option wired through.\n\n## Examples\n\n### Wrap a command and assert on secretscan findings\n\n```yaml\n- uses: aflock-ai/cilock-action@v1\n  with:\n    step: build\n    attestations: \"environment git github secretscan\"\n    outfile: ${{ github.workspace }}/attestation.json\n    cilock-args: \"--attestor-secretscan-fail-on-detection\"\n    command: make build\n```\n\n### Wrap an upstream action (e.g. supply-chain hygiene)\n\n```yaml\n- uses: aflock-ai/cilock-action@v1\n  with:\n    step: trivy-scan\n    attestations: \"environment git github sbom\"\n    outfile: ${{ github.workspace }}/scan.attestation.json\n    action-ref: aquasecurity/trivy-action@76071ef0d7ec1c61c8c2dc1a37a91019797d3c1b\n    action-inputs: |\n      {\"scan-type\": \"fs\", \"scan-ref\": \".\"}\n```\n\n### Verify in CI with OPA\n\n```yaml\n- uses: aflock-ai/cilock-action@v1\n  with:\n    step: build\n    outfile: ${{ github.workspace }}/attestation.json\n    command: make build\n\n- name: Decode and verify\n  run: |\n    jq -r '.payload' attestation.json | base64 -d \u003e /tmp/statement.json\n    opa eval -d policy.rego -i /tmp/statement.json \\\n      'data.cilock.verify.deny' -f json | tee /tmp/opa-result.json\n    DENY=$(jq -r '.result[0].expressions[0].value | length // 0' /tmp/opa-result.json)\n    if [ \"$DENY\" -gt 0 ]; then\n      echo \"::error::policy denied $DENY rules\"\n      exit 1\n    fi\n```\n\n## Versioning\n\n- `@v1` — major-version tag, auto-updated on each `v1.x.y` release\n- `@v1.0.1` — exact-tag pin\n- `@\u003c40-hex-SHA\u003e` — SHA pin against the published-tag commit (recommended for supply-chain hygiene; the shim resolves the SHA to its release tag)\n\n## Related\n\n- **cilock** (the wrapped library): [aflock-ai/rookery](https://github.com/aflock-ai/rookery)\n- **Docs**: [cilock.aflock.ai](https://cilock.aflock.ai)\n- **Supply-chain attack catalog with live detection demos**: [aflock-ai/supply-chain-attacks](https://github.com/aflock-ai/supply-chain-attacks)\n- **Commercial / managed**: [TestifySec Platform](https://testifysec.com/product)\n\n## License\n\nApache 2.0. Built and sponsored by [TestifySec](https://testifysec.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faflock-ai%2Fcilock-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faflock-ai%2Fcilock-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faflock-ai%2Fcilock-action/lists"}