Repository navigation
Build the whole flow from public sources via Dagger #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
356c092
9824e7f
7a4b789
a6ca078
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: CI | ||
|
|
||
| # Builds and tests Cairn entirely from public sources. The Dagger `ci` function | ||
| # fetches the TamaGo fork, the shared Kyanite modules and the tamago-go compiler | ||
| # release from public GitHub, cross-compiles the AST2700 payload and runs the | ||
| # host unit tests — so this workflow needs no secrets and no extra inputs. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Build + test (dagger call ci) | ||
| uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1 | ||
| with: | ||
| version: "0.21.9" | ||
| verb: call | ||
| args: ci | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,17 +62,33 @@ Cairn follows the same embedded-friendly conventions as vein: | |
|
|
||
| ## Build | ||
|
|
||
| The AST2700 arm64 SoC/board support lives in a TamaGo fork that is not yet | ||
| upstream. Until it lands, `go.work` redirects `github.com/usbarmory/tamago` to | ||
| that fork (`../tamago`). | ||
| Everything is built with [Dagger](https://dagger.io), which fetches the TamaGo | ||
| fork (AST2700 support), the shared Kyanite modules and the tamago-go compiler | ||
| release from public GitHub — so the whole flow builds from public sources with | ||
| no local checkouts and no toolchain setup beyond Dagger: | ||
|
|
||
| ```bash | ||
| make build # AST2700 DC-SCM EVB ELF → bin/cairn.elf | ||
| make test # host unit tests (user_linux tag) | ||
| dagger call build export --path ./bin # AST2700 DC-SCM EVB ELF → bin/cairn.elf | ||
| dagger call test # host unit tests (user_linux tag) | ||
| dagger call ci # build + test (what CI runs) | ||
| ``` | ||
|
|
||
| Requires the TamaGo compiler (`TAMAGO=/path/to/tamago-go/bin/go`) and | ||
| `llvm-readelf`. | ||
| Pass `--<dir>` (e.g. `--core ../core`, `--tamago ../tamago`) to build against a | ||
| local checkout instead of the public default. | ||
|
|
||
| ### Full SPI flash image | ||
|
|
||
| ```bash | ||
| # A1: fully reproducible, in-container. --bmc-pb supplies the vendor prebuilts | ||
| # (Caliptra FW, DDR training, DP FW), which are not redistributable. | ||
| dagger call image --bmc-pb ../bmc-pb --silicon a1 export --path ./out | ||
|
|
||
| # A2: FLSH container + vendor-signed ATMN SoC manifest. The manifest signing | ||
| # uses the vendor cptra_imgtool and is not reproducible in-container, so it runs | ||
| # on the host — see tools/a2/gen-a2-image.sh. | ||
| CPTRA_IMGTOOL=../cptra_imgtool PREBUILT=/path/to/a2-prebuilts \ | ||
| tools/a2/gen-a2-image.sh | ||
|
Comment on lines
+89
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Document the host TamaGo requirement for A2.
|
||
| ``` | ||
|
|
||
| ## Module | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "cairn", | ||
| "engineVersion": "v0.21.6", | ||
| "engineVersion": "v0.21.9", | ||
| "sdk": { | ||
| "source": "go" | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: kyanitecomputer/cairn
Length of output: 2031
🌐 Web query:
Dagger GitHub Action pull request module source .git directory checkout persisted credentials accessibility💡 Result:
Inspection citation: inspection_997438e8922fe1ee007d7cf214560cca
<source_evidence>
Citations:
🏁 Script executed:
Repository: kyanitecomputer/cairn
Length of output: 12801
🌐 Web query:
Dagger Go SDK module sandbox Host Directory access from a module and dagger call GitHub Actions workspace💡 Result:
Inspection citation: inspection_b5cfbf450be3939450522f7ad3fe2fdf
<source_evidence>
Citations:
🌐 Web query:
Dagger 0.21 module +defaultPath "." Directory input excludes .git files source filtering documentation💡 Result:
Inspection citation: inspection_06a4c4479dfb57b9f3ae0f35216681f1
<source_evidence>
Citations:
Sensitive Data Exposure
Reachability: External
Exploitability: Trivial
CWE: CWE-522 — Insufficiently Protected Credentials
Disable persisted checkout credentials before running Dagger.
Ci.srcuses+defaultPath=".", so Dagger passes the repository context to the module without excluding.git. Pull-request-controlled Dagger code can readsrc.File(".git/config")and exfiltrate the checkout token. Dagger host access is not required.contents: readprevents write operations but still exposes a bearer token with repository-content read access.Suggested fix
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.30.0)
[warning] 25-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)