Setup
Everything is deployed by the lab. This page has the values you need, a two-minute check that the lab is ready, and what to do when part of it is not.
This lab
From the VM, as of the time below - recorded when the guide was last deployed. Refresh with
sudo cws-lab guide on the VM, then reload.
- No lab data yet - this page is being previewed outside a lab, or setup is still running.
Checked - · lab build - · VM: -
The lab needs at least 4 vCPU, 8 GB RAM and 40 GB disk; 16 GB RAM is comfortable. Setup stops on a smaller VM rather than half-deploying GitLab, and adds a swap file below 12 GB.
Where everything is
| This guide | | Public - share it freely |
| Exfiltration test | open | |
| GitLab | open | user root - password on the exfiltration test's Lab page |
| acme-infra | open | The repository whose pipeline every CI chapter uses |
| Cloudflare account | dashboard ↗ | account - |
| CWS deployment | open ↗ | - |
| DNS zone | - |
The git server's password is deliberately not on this page. The guide is public, and its admin account can read the
project's CI/CD variables - which include this lab's Cloudflare API token. It is on the exfiltration test's Lab page,
behind Access, and in /opt/cloudflare/cws-lab/credentials.txt on the VM (sudo cws-lab status).
On the Windows desktop
Nothing to install. Every demo runs in a browser: open , then sign in to the exfiltration test and
the git server with your email's one-time PIN - one sign-in covers both.
Keep three tabs - the exfiltration test, the git server signed in as root,
and the Cloudflare dashboard on Cloud Workload Security ↗.
Chapter 7 also needs a terminal on the lab's Ubuntu VM. Everything else is browser-only.
Pre-flight check
Two minutes, before every session.
- The strip under the top bar says Lab ready. If it does not, see Fixing things.
- Open the exfiltration test, choose Through Cloudflare CWS and run it. Expect 5 of 5 preventative controls succeeded, and the business-as-usual write allowed.
- Click Run it without controls. Expect 5 of 5 failed - the "before" works too.
- Click Empty the attacker's account, so your audience starts from zero.
- Open acme-infra → Build → Pipelines. the latest pipeline is green.
- In the dashboard, open Policy sets ↗ and check Enforce is on for every policy - a previous session may have left one off.
Fixing things
The CWS proxy has not loaded its deploymentthe most likely first-run problem
The proxy loads its configuration with an API token that needs the Cloud Workload Security Deployment permission. If the lab's token does not have it, the proxy logs a 401 or 403 and every request through it fails.
- In the dashboard, Account API tokens ↗ → Create token → custom, with Cloud Workload Security Deployment for this account.
- On the VM:
sudo cws-lab set-proxy-token <the new token> - Watch for
remote_config_loadedandaction_mapper_loaded:sudo cws-lab logs cws-proxy -f
Requests through CWS return 503 Action Mapper unavailablethe proxy is failing closed
The proxy refuses inspected traffic until it has loaded its Action Mapper data - Cloudflare's catalogue of what each cloud API call is. It retries on its own; check its log for the reason:
sudo cws-lab logs cws-proxy | grep -i action_mapper
The git server has no acme-infra project, or its pipeline is stuckpending jobs, or a 404
GitLab's first boot takes several minutes (Gitea's, seconds), and setup gives up on the project if it is not ready in time. Re-run the bootstrap - every step checks before it creates:
sudo cws-lab git
A job stuck in pending means no runner: the same command registers it.
The exfiltration test shows Error rather than Blocked or Exfiltratedusually the emulator or the proxy
Each row's breakdown shows the exact error. ENOTFOUND cws-proxy or a connection refused means the
proxy container is down; anything mentioning the emulator means it is restarting. Then:
sudo cws-lab status
sudo cws-lab restart cws-proxy exfil-test
A dashboard change has no effectwait 30 seconds
The proxy polls for its configuration every 30 seconds, the minimum. Run the test again after that. If it still has no effect, the proxy may be keeping its previous configuration because a refresh failed:
sudo cws-lab logs cws-proxy | grep -E 'remote_config_(fetch|prepare)_failed'
Start again from a clean emulatorthe AWS state is in memory
Restarting the emulator empties every bucket, queue, stream and table. The exfiltration test re-seeds its own resources; the next pipeline run re-creates Acme's.
sudo cws-lab reset --emulator
On the VM
| Command | What it does |
|---|---|
sudo cws-lab status | Containers, proxy state, URLs and credentials, including the git server's password. |
sudo cws-lab guide | Redeploy this guide with fresh checks - about a minute. |
sudo cws-lab decisions -f | The proxy's request decisions, one line each, live. |
sudo cws-lab shell | An AWS CLI and curl shell routed through CWS as workstation. --direct for no controls. |
sudo cws-lab test | Run the exfiltration test from the terminal. sudo cws-lab test direct for the before. |
sudo cws-lab reset | Empty the attacker's resources. |
sudo cws-lab logs cws-proxy -f | Raw logs from any service: cws-proxy, aws-emulator, gitlab or gitea, gitlab-runner or gitea-runner, exfil-test, cloudflared. |
Each client of the proxy has its own Basic Auth identity, which policies can match:
ci-pipeline for every CI job, workstation for the exfiltration test and
cws-lab shell. Their passwords live in the VM's configuration and in a masked CI/CD variable - nobody
needs to type them.