Pulumi IaC scaffolding for the bug-report ingest pipeline, added as its own Go module under infra/ (module github.com/JMR-dev/LibreMail-Bug-Report-Ingest/infra) so the root Worker module stays lean. Uses the Pulumi Go SDK with the pulumi-cloudflare (v6) and pulumi-gcp (v8) providers.
Resources defined (infra/deploy.go)
Logical name
Type
Purpose
ingest-worker
cloudflare.WorkersScript
The ingest Worker (libremail-bug-report-ingest, built in #1).
reports-bucket
cloudflare.R2Bucket
Encrypted bug-report storage (libremail-bug-reports). Per ADR 0001 only ciphertext is written.
ingest-dns-record
gcp.dns.RecordSet
Google Cloud DNS CNAME pointing the ingest hostname at the Worker's route/custom domain. The managed zone is referenced by name (managed outside this stack).
Per-environment stacks (Pulumi.dev.yaml / Pulumi.prod.yaml) via pulumi.Config; account id, zone, domain, bucket name, TTL, etc. are all parameterized.
Worker content is a documented placeholder. The real Worker is the TinyGo→Wasm build + syumai/workers shim emitted into ../build/ by the build pipeline; the program ships a placeholder module body (overridable via the workerScriptContent config or ContentFile/ContentSha256 at deploy time) so the resource is fully described and unit-testable without the artifact.
No secret values are committed. Stack files carry only non-secret config with REPLACE_ME_* placeholders.
The BUGREPORT_ENC_KEYRING encryption keyring lives in Cloudflare Secrets Store (ADR 0001), not here.
Testing (no Pulumi CLI required)
This machine has no Pulumi CLI, so the program is verified compile- and test-only via the Go SDK's mocking (pulumi.RunErr + pulumi.WithMocks implementing MockResourceMonitor). The tests assert the expected resources are registered with the expected inputs (Worker name/account/mainModule/compatibilityDate, R2 bucket name/account/location, DNS type/name/target/ttl/zone), plus a missing-required-config error path.
$ go build ./...
(exit 0)
$ go vet ./...
(exit 0)
$ go test -v ./...
=== RUN TestWorkerScriptRegistered
--- PASS: TestWorkerScriptRegistered (0.00s)
=== RUN TestR2BucketRegistered
--- PASS: TestR2BucketRegistered (0.00s)
=== RUN TestDNSRecordRegistered
--- PASS: TestDNSRecordRegistered (0.00s)
=== RUN TestExactlyThreeManagedResources
--- PASS: TestExactlyThreeManagedResources (0.00s)
=== RUN TestMissingRequiredConfigIsAnError
--- PASS: TestMissingRequiredConfigIsAnError (0.00s)
PASS
ok github.com/JMR-dev/LibreMail-Bug-Report-Ingest/infra 2.864s
Forward note (not in this PR)
The abuse/rate-limit ADR (#6, docs/decisions/labels-and-abuse.md) chose to implement ingest rate limiting as Cloudflare Rate Limiting rules via Pulumi (cloudflare.NewRuleset, phase http_ratelimit). That lands with #7 — this PR does not add rate-limit rules, but the program is structured so they slot in cleanly: a reserved cloudflareZoneId config key and a marked insertion point in deploy.go. Worker routes / a custom domain would attach the same way.
Scope / follow-ups
Files are confined to infra/; nothing outside it is touched (keeps this disjoint from the parallel #3 CI and #8 PII PRs).
Real pulumi preview/up verification is a follow-up once the Pulumi CLI is available and credentials are provided — deployment is gated behind a maintainer check-in.
## What
Pulumi IaC scaffolding for the bug-report ingest pipeline, added as its **own Go module** under `infra/` (module `github.com/JMR-dev/LibreMail-Bug-Report-Ingest/infra`) so the root Worker module stays lean. Uses the Pulumi Go SDK with the **pulumi-cloudflare (v6)** and **pulumi-gcp (v8)** providers.
### Resources defined (`infra/deploy.go`)
| Logical name | Type | Purpose |
| --- | --- | --- |
| `ingest-worker` | `cloudflare.WorkersScript` | The ingest Worker (`libremail-bug-report-ingest`, built in #1). |
| `reports-bucket` | `cloudflare.R2Bucket` | Encrypted bug-report storage (`libremail-bug-reports`). Per [ADR 0001](../blob/main/docs/decisions/encryption.md) only ciphertext is written. |
| `ingest-dns-record` | `gcp.dns.RecordSet` | Google Cloud DNS `CNAME` pointing the ingest hostname at the Worker's route/custom domain. The managed zone is **referenced by name** (managed outside this stack). |
- **Per-environment stacks** (`Pulumi.dev.yaml` / `Pulumi.prod.yaml`) via `pulumi.Config`; account id, zone, domain, bucket name, TTL, etc. are all parameterized.
- **Worker content is a documented placeholder.** The real Worker is the TinyGo→Wasm build + `syumai/workers` shim emitted into `../build/` by the build pipeline; the program ships a placeholder module body (overridable via the `workerScriptContent` config or `ContentFile`/`ContentSha256` at deploy time) so the resource is fully described and unit-testable without the artifact.
- No secret values are committed. Stack files carry only non-secret config with `REPLACE_ME_*` placeholders.
## Config / secrets a deployer must supply
Full contract in [`infra/README.md`](../blob/ticket-2-pulumi-scaffold/infra/README.md).
**Required program config** (namespace `libremail-bug-report-ingest-infra`): `cloudflareAccountId`, `dnsManagedZone` (existing zone name), `dnsRecordName` (FQDN, trailing dot), `dnsRecordTarget` (Worker route/custom-domain FQDN). Optional (defaulted): `workerName`, `workerCompatibilityDate`, `r2BucketName`, `r2BucketLocation`, `dnsRecordType`, `dnsTtlSeconds`, `gcpProject`, `cloudflareZoneId`.
**Secrets / credentials (never committed):**
- `cloudflare:apiToken` — `pulumi config set --secret cloudflare:apiToken <token>` (or `CLOUDFLARE_API_TOKEN`).
- `gcp:project` — `pulumi config set gcp:project <id>`.
- `gcp:credentials` — `pulumi config set --secret gcp:credentials "$(cat key.json)"` (or `GOOGLE_CREDENTIALS` / ADC).
- The `BUGREPORT_ENC_KEYRING` encryption keyring lives in **Cloudflare Secrets Store** (ADR 0001), not here.
## Testing (no Pulumi CLI required)
This machine has no Pulumi CLI, so the program is verified compile- and test-only via the Go SDK's mocking (`pulumi.RunErr` + `pulumi.WithMocks` implementing `MockResourceMonitor`). The tests assert the expected resources are registered with the expected inputs (Worker name/account/mainModule/compatibilityDate, R2 bucket name/account/location, DNS type/name/target/ttl/zone), plus a missing-required-config error path.
```
$ go build ./...
(exit 0)
$ go vet ./...
(exit 0)
$ go test -v ./...
=== RUN TestWorkerScriptRegistered
--- PASS: TestWorkerScriptRegistered (0.00s)
=== RUN TestR2BucketRegistered
--- PASS: TestR2BucketRegistered (0.00s)
=== RUN TestDNSRecordRegistered
--- PASS: TestDNSRecordRegistered (0.00s)
=== RUN TestExactlyThreeManagedResources
--- PASS: TestExactlyThreeManagedResources (0.00s)
=== RUN TestMissingRequiredConfigIsAnError
--- PASS: TestMissingRequiredConfigIsAnError (0.00s)
PASS
ok github.com/JMR-dev/LibreMail-Bug-Report-Ingest/infra 2.864s
```
## Forward note (not in this PR)
The abuse/rate-limit ADR (#6, `docs/decisions/labels-and-abuse.md`) chose to implement ingest rate limiting as **Cloudflare Rate Limiting rules via Pulumi** (`cloudflare.NewRuleset`, phase `http_ratelimit`). That lands with **#7** — this PR does **not** add rate-limit rules, but the program is structured so they slot in cleanly: a reserved `cloudflareZoneId` config key and a marked insertion point in `deploy.go`. Worker routes / a custom domain would attach the same way.
## Scope / follow-ups
- Files are confined to `infra/`; nothing outside it is touched (keeps this disjoint from the parallel #3 CI and #8 PII PRs).
- **Real `pulumi preview`/`up` verification is a follow-up** once the Pulumi CLI is available and credentials are provided — deployment is gated behind a maintainer check-in.
Closes #2
⚠️ GitGuardian has uncovered 7 secrets following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
following these best practices for managing and storing secrets including API keys and other credentials
🦉GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
#### ⚠️ GitGuardian has uncovered 7 secrets following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
<details>
<summary>🔎 Detected hardcoded secrets in your pull request</summary>
<br>
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
| -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- |
| [34486370](https://dashboard.gitguardian.com/workspace/616578/incidents/34486370?occurrence=277196235) | Triggered | Generic CLI Secret | 21665b172dc6a396be3f789820e6098415eb2873 | infra/README.md | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/21665b172dc6a396be3f789820e6098415eb2873#diff-a7185b3c971728dd36f544a064be689d9d77aef5a91e271608c5d0324c3710c4R75) |
| [34486412](https://dashboard.gitguardian.com/workspace/616578/incidents/34486412?occurrence=277220217) | Triggered | Google API Key | 9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693 | internal/scrub/scrub_test.go | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693#diff-2932eff712531fa44ddcd1da4509da244b7f5941341d6725be74ceb5a8a6ca26R106) |
| [34486411](https://dashboard.gitguardian.com/workspace/616578/incidents/34486411?occurrence=277220218) | Triggered | JSON Web Token | 9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693 | internal/scrub/scrub_test.go | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693#diff-2932eff712531fa44ddcd1da4509da244b7f5941341d6725be74ceb5a8a6ca26R78) |
| [34486412](https://dashboard.gitguardian.com/workspace/616578/incidents/34486412?occurrence=277220219) | Triggered | Google API Key | 9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693 | internal/scrub/scrub_test.go | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693#diff-2932eff712531fa44ddcd1da4509da244b7f5941341d6725be74ceb5a8a6ca26R106) |
| [34486413](https://dashboard.gitguardian.com/workspace/616578/incidents/34486413?occurrence=277220220) | Triggered | Bearer Token | 9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693 | internal/scrub/scrub_test.go | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693#diff-2932eff712531fa44ddcd1da4509da244b7f5941341d6725be74ceb5a8a6ca26R92) |
| [34486414](https://dashboard.gitguardian.com/workspace/616578/incidents/34486414?occurrence=277220221) | Triggered | GitHub Personal Access Token | 9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693 | internal/scrub/scrub_test.go | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693#diff-2932eff712531fa44ddcd1da4509da244b7f5941341d6725be74ceb5a8a6ca26R100) |
| [34486414](https://dashboard.gitguardian.com/workspace/616578/incidents/34486414?occurrence=277220222) | Triggered | GitHub Personal Access Token | 9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693 | internal/scrub/scrub_test.go | [View secret](https://github.com/JMR-dev/LibreMail-Bug-Report-Ingest/commit/9a2d9df944cb1f8bb1cc0e7eb45fe218f378f693#diff-2932eff712531fa44ddcd1da4509da244b7f5941341d6725be74ceb5a8a6ca26R100) |
</details>
<details>
<summary>🛠 Guidelines to remediate hardcoded secrets</summary>
<br>
1. Understand the implications of revoking this secret by investigating where it is used in your code.
2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices.
3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_cli_option_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment).
4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials
- install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.
</details>
---
<sup>🦉 [GitGuardian](https://dashboard.gitguardian.com/auth/login/?utm_medium=checkruns&utm_source=github&utm_campaign=cr1) detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.<br/></sup>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Pulumi IaC scaffolding for the bug-report ingest pipeline, added as its own Go module under
infra/(modulegithub.com/JMR-dev/LibreMail-Bug-Report-Ingest/infra) so the root Worker module stays lean. Uses the Pulumi Go SDK with the pulumi-cloudflare (v6) and pulumi-gcp (v8) providers.Resources defined (
infra/deploy.go)ingest-workercloudflare.WorkersScriptlibremail-bug-report-ingest, built in #1).reports-bucketcloudflare.R2Bucketlibremail-bug-reports). Per ADR 0001 only ciphertext is written.ingest-dns-recordgcp.dns.RecordSetCNAMEpointing the ingest hostname at the Worker's route/custom domain. The managed zone is referenced by name (managed outside this stack).Pulumi.dev.yaml/Pulumi.prod.yaml) viapulumi.Config; account id, zone, domain, bucket name, TTL, etc. are all parameterized.syumai/workersshim emitted into../build/by the build pipeline; the program ships a placeholder module body (overridable via theworkerScriptContentconfig orContentFile/ContentSha256at deploy time) so the resource is fully described and unit-testable without the artifact.REPLACE_ME_*placeholders.Config / secrets a deployer must supply
Full contract in
infra/README.md.Required program config (namespace
libremail-bug-report-ingest-infra):cloudflareAccountId,dnsManagedZone(existing zone name),dnsRecordName(FQDN, trailing dot),dnsRecordTarget(Worker route/custom-domain FQDN). Optional (defaulted):workerName,workerCompatibilityDate,r2BucketName,r2BucketLocation,dnsRecordType,dnsTtlSeconds,gcpProject,cloudflareZoneId.Secrets / credentials (never committed):
cloudflare:apiToken—pulumi config set --secret cloudflare:apiToken <token>(orCLOUDFLARE_API_TOKEN).gcp:project—pulumi config set gcp:project <id>.gcp:credentials—pulumi config set --secret gcp:credentials "$(cat key.json)"(orGOOGLE_CREDENTIALS/ ADC).BUGREPORT_ENC_KEYRINGencryption keyring lives in Cloudflare Secrets Store (ADR 0001), not here.Testing (no Pulumi CLI required)
This machine has no Pulumi CLI, so the program is verified compile- and test-only via the Go SDK's mocking (
pulumi.RunErr+pulumi.WithMocksimplementingMockResourceMonitor). The tests assert the expected resources are registered with the expected inputs (Worker name/account/mainModule/compatibilityDate, R2 bucket name/account/location, DNS type/name/target/ttl/zone), plus a missing-required-config error path.Forward note (not in this PR)
The abuse/rate-limit ADR (#6,
docs/decisions/labels-and-abuse.md) chose to implement ingest rate limiting as Cloudflare Rate Limiting rules via Pulumi (cloudflare.NewRuleset, phasehttp_ratelimit). That lands with #7 — this PR does not add rate-limit rules, but the program is structured so they slot in cleanly: a reservedcloudflareZoneIdconfig key and a marked insertion point indeploy.go. Worker routes / a custom domain would attach the same way.Scope / follow-ups
infra/; nothing outside it is touched (keeps this disjoint from the parallel #3 CI and #8 PII PRs).pulumi preview/upverification is a follow-up once the Pulumi CLI is available and credentials are provided — deployment is gated behind a maintainer check-in.Closes #2
⚠️ GitGuardian has uncovered 7 secrets following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
🔎 Detected hardcoded secrets in your pull request
21665b172d9a2d9df9449a2d9df9449a2d9df9449a2d9df9449a2d9df9449a2d9df944🛠 Guidelines to remediate hardcoded secrets
To avoid such incidents in the future consider
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.