Audit a staging API on AWS
End-to-end: authenticate, ground a local LLM, and run cbx audit aws against a small API + Postgres environment — including a CI-friendly JSON run.
Audit a staging API on AWS
This example walks through auditing a small environment already running on AWS — a VPC, a Postgres database, and a Fargate service running an API container — with cbx audit aws end to end. Expect about 10 minutes.
Provisioning and applying changes is a portal flow, not a CLI one. You declare intent, review the ADR/diagram, and apply ChangeSets in the CloudBooster portal — see Review and apply a ChangeSet. The CLI's job here is read-only auditing of what's already deployed.
What you'll audit
A staging environment that:
- Lives in its own VPC in
eu-west-1. - Runs a containerized API on Fargate with two tasks behind a load balancer.
- Uses managed Postgres (RDS) with credentials in Secrets Manager.
Prerequisites
- An AWS account you can read with the SDK — your normal credential resolution (environment, shared config, or SSO) must work. Confirm with
aws sts get-caller-identity. - The
cbxCLI installed. Runcbx versionto confirm. - A local LLM CLI on
PATHfor grounding —claude(default) orcodex.cbx audit awscites CloudBooster's curated AWS knowledge and rule pack through this executor, so one must be installed and authenticated.
1. Authenticate to CloudBooster
cbx audit aws fetches the curated AWS knowledge and rule pack over the CloudBooster knowledge API, so sign in first:
2. Make sure a grounding LLM is ready
The audit runs a pre-discovery preflight against the LLM executor and aborts with E_LLM_PREFLIGHT if it isn't ready — before any AWS calls. Verify it up front:
If you authenticate via an API provider instead of a local CLI subscription, log in once:
To use Codex instead of Claude, test cbx llm cli test codex and add --llm-executor codex to the audit command below.
3. Run the audit
On the first online run, cbx resolves the AWS rule pack from the registry and caches it under ~/.cache/cbx/rulepack/, then discovers your live resources, inlines the curated knowledge alongside them, and runs the local LLM to produce grounded, cited findings. You'll see findings such as "RDS instance is single-AZ" (expected for staging) plus the security baseline checks, each tied back to a rule.
Scope or tune the run as needed:
4. Wire it into CI
For machine-readable output, use the global JSON flag — findings are wrapped in the standard envelope and the process exits non-zero when findings meet the severity threshold:
-o json— structured output for parsing.--no-tui— disable the interactive TUI in headless runners.--strict— treat discovery-integrity warnings (timeouts, throttling, truncated lists) as failures, so a partial scan can't pass.
In CI, make sure the grounding CLI is installed and authenticated on the runner, and pin the rule pack for reproducibility:
If the runner can't reach the rule-pack registry, bake a local copy in and point CBX_AUDIT_RULES_FILE at it.
Remediating findings
Fixing findings is a portal flow: open the finding, let CloudBooster propose a ChangeSet, and review and apply it. On the next audit, resolved findings drop off.
Where next
- Run it in CI — see Run
cbx auditin GitHub Actions. - Understand grounding — see Audits for what the rule pack and knowledge API contribute.
- Manage LLM executors —
cbx llm list,cbx llm default, andcbx llm modelcontrol which executor and model the audit uses.