Skip to the levels
ROOTSPIRE
DiscsFor teachers
▶ Play freeLibrary 16 discsDiscsFor teachersLog in

Every level, in the open

Cloud & IaC

7 worlds · 76 levels · 7 bosses

SOLUTION HIDDENTeachers see answer keys in the classroom.

▶ Play this discAll discs
All discsLinux: Zero to RootBash ScriptingGitDatabasesPython for OpsLinux Sysadmin ProNetworkingObservabilityCloud & IaCDocker & ContainersCTF ArenaSOC FieldWindows for Linux peopleKubernetesAnsibleThe Guildhall: First Week

Run a cloud account from the terminal: IAM, VPCs, compute, storage, then Terraform-style IaC, security posture and cost. Honest note: cloud, tf and tofu are SIMs of the AWS CLI, Terraform and OpenTofu that print the real command; one lab world runs real OpenTofu.

Guided levels show the command first. Alone levels give the goal only. Bosses and exams are timed.

Jump to a world

World 1 Sky ConsoleWorld 2 Sky HarborWorld 3 Fleet & VaultWorld 4 Blueprint ForgeWorld 5 Night WatchWorld 6 Open ForgeWorld 7 Real OpenTofu

World 1Sky Console

12 levels

Your first cloud account: who you are, where things live, and what you're allowed to do.

  1. 1

    Level 1: Who am I up there?

    GuidedEasy

    Objective: Find the account ID your terminal is signed in to and tell Kern with kern ACCOUNT_ID.

    Every cloud command is an API call signed by an identity. hidden (real: aws sts get-caller-identity) answers: which account, which user.

    Commands taughtcloudcloud-identity

    ▶ Play: Who am I up there?SOLUTION HIDDEN20 XP
  2. 2

    Level 2: Pick a city

    GuidedEasy

    Objective: Give your terminal a home region, Paris, then tell Kern the zone ID of eu-west-3b.

    A region is a city full of datacenters (eu-west-3 = Paris); an Availability Zone (AZ) is one separate building in it, like eu-west-3b. hidden (real: aws configure set region eu-west-3) writes the default into ~/.cloud/config (real: ~/.aws/config).

    Commands taughtregions-azscloud-configure

    ▶ Play: Pick a citySOLUTION HIDDEN25 XP
  3. 3

    Level 3: Needle in the fleet

    GuidedEasy

    Objective: Twelve servers run in Paris; tell Kern the instance ID of the one tagged Team=payments and Env=prod.

    --filters Name=tag:Team,Values=payments makes the API return only matches, and --query 'Reservations[].Instances[].InstanceId' --output text (same flags in aws) keeps just the field you want.

    Commands taughtquery-output

    ▶ Play: Needle in the fleetSOLUTION HIDDEN30 XP
  4. 4

    Level 4: A badge for Noor

    GuidedEasy

    Objective: Noor joins as an auditor: give her a user in a group auditors that has the managed policy ReadOnlyAccess.

    IAM (Identity and Access Management) users are people or programs; a group hands the same policies to all its members. Give permissions to groups, not users: cloud iam create-group = aws iam create-group.

    Commands taughtiam-users-groups

    ▶ Play: A badge for NoorSOLUTION HIDDEN30 XP
  5. 5

    Level 5: Only the reports

    GuidedEasy

    Objective: Lena may download sky-reports/reports/* and nothing else: write that policy, attach it to lena, and prove it.

    A policy is JSON: Effect (Allow/Deny), Action (s3:GetObject) and Resource (an ARN, * allowed at the end: arn:aws:s3:::sky-reports/reports/*). Least privilege: allow exactly what the job needs, nothing more.

    Commands taughtiam-policy-jsonpolicy-simulator

    ▶ Play: Only the reportsSOLUTION HIDDEN40 XP
  6. 6

    Level 6: Name tags for everything

    GuidedEasy

    Objective: Label annex: first copy Kern's example, then add a second label on your own.

    A tag is a Key=Value label you stick on any resource: cloud ec2 create-tags --resources ID --tags Key=Owner,Value=noor (real: aws ec2 create-tags). Filters and bills can then find it.

    Commands taughttags

    ▶ Play: Name tags for everythingSOLUTION HIDDEN25 XP
  7. 7

    Level 7: The server that vanished

    AloneMedium

    Objective: Mira swears her server night-owl exists but nobody sees it: find it and tag it Owner=mira.

    Resources are regional: describe-instances only looks in your default region. --region ap-southeast-1 (same in aws) sends one command to another region; tags (Key=Owner,Value=mira) label anything.

    Commands taughttags

    ▶ Play: The server that vanishedSOLUTION HIDDEN35 XP
  8. 8

    Level 8: Who can burn the vault?

    AloneMedium

    Objective: Three users have S3 rights; tell Kern which one can delete the bucket sky-vault (kern NAME).

    The policy engine: an explicit Deny anywhere wins, then any Allow, else implicit deny. simulate-principal-policy answers for one user without trying the real thing.

    Commands taughtpolicy-evaluation

    ▶ Play: Who can burn the vault?SOLUTION HIDDEN40 XP
  9. 9

    Level 9: Spare keys

    GuidedEasy

    Objective: Practice the key moves on the throwaway user temp-bot, so the pager level feels familiar.

    An access key is an ID plus a secret. A user can hold two: that is how you rotate. update-access-key flips one Active/Inactive, create-access-key makes a new one, and a profile in ~/.cloud/config stores the settings for one identity.

    Commands taughtaccess-keys-profiles

    ▶ Play: Spare keysSOLUTION HIDDEN35 XP
  10. 10

    Level 10: PAGER: key on GitHub

    Alone⏱ TimedHard

    Objective: PAGER: ci-bot's key leaked: kill it, make a new key, and set up profile ci (region eu-west-3) so hidden works.

    An access key (ID + secret) is a password for programs: if it leaks, deactivate it, make a new one, and give it to the program. Profiles in ~/.cloud/credentials (real: ~/.aws/credentials) hold several keys; --profile ci or AWS_PROFILE=ci picks one.

    Commands taughtaccess-keys-profiles

    ▶ Play: PAGER: key on GitHubSOLUTION HIDDEN50 XP
  11. 11

    Level 11: Taking a badge back

    GuidedEasy

    Objective: Find who holds a policy, then take it back from one user.

    To see who holds a managed policy: cloud iam list-entities-for-policy --policy-arn P. To take it from a user: cloud iam detach-user-policy --user-name U --policy-arn P. The policy itself survives; only the link is cut.

    Commands taughtleast-privilege

    ▶ Play: Taking a badge backSOLUTION HIDDEN35 XP
  12. 12

    Level 12: The intern with the crown

    Boss⏱ TimedHard

    Objective: Least-privilege audit: the intern pip has admin; leave pip with read+write on sky-logs/intern/* only, and prove it.

    Find who holds AdministratorAccess, take it from the intern, give the intern a group with a scoped policy, then prove it by simulation.

    Commands taughtleast-privilegeiam-roles

    ▶ Play: The intern with the crownSOLUTION HIDDEN80 XP

World 2Sky Harbor

13 levels

Build the harbor's private network (VPC, subnets in two zones, gates, guards on every door) and find out why the lights go dark.

  1. 13

    Level 13: A harbor in the sky

    GuidedEasy

    Objective: Create the harbor's VPC: CIDR 10.40.0.0/16, tagged Name=harbor (see ~/harbor/ticket.txt).

    A VPC is your own private network inside the cloud, defined by one CIDR block. cloud ec2 create-vpc (real: aws ec2 create-vpc) makes it; --tag-specifications gives it a Name so humans can find it.

    Commands taughtvpc

    ▶ Play: A harbor in the skySOLUTION HIDDEN25 XP
  2. 14

    Level 14: Two docks, two buildings

    GuidedEasy

    Objective: Create subnets dock-a (10.40.1.0/24 in eu-west-3a) and dock-b (10.40.2.0/24 in eu-west-3b) in the harbor VPC.

    A subnet is a slice of the VPC's block that lives in ONE availability zone. It must fit inside the VPC, must not overlap another subnet, and the cloud keeps 5 of its addresses (network, router, DNS, reserved, broadcast).

    Commands taughtsubnet-cidr

    ▶ Play: Two docks, two buildingsSOLUTION HIDDEN30 XP
  3. 15

    Level 15: Open the harbor gate

    GuidedEasy

    Objective: Make dock-a public: attach an internet gateway to harbor and route 0.0.0.0/0 to it from a route table associated with dock-a.

    An internet gateway is the VPC's door to the internet. A subnet is PUBLIC only when its route table sends 0.0.0.0/0 to that gateway; subnets without that route are private.

    Commands taughtinternet-gatewayroute-table

    ▶ Play: Open the harbor gateSOLUTION HIDDEN35 XP
  4. 16

    Level 16: Guards on the lighthouse

    GuidedEasy

    Objective: Make the lighthouse reachable on HTTPS from anywhere, with SSH allowed only from the admin laptop 198.51.100.7.

    A security group is a stateful firewall on each server: only allow rules, and replies to allowed traffic go back automatically. cloud ec2 analyze-path (a SIM of the VPC Reachability Analyzer) traces a connection hop by hop and names the hop that blocks it.

    Commands taughtanalyze-pathsecurity-group

    ▶ Play: Guards on the lighthouseSOLUTION HIDDEN40 XP
  5. 17

    Level 17: Block the noisy range

    GuidedEasy

    Objective: Deny all traffic from 192.0.2.0/24 into harbor's subnets with a network ACL rule that wins over the default allow (rule 100).

    A network ACL guards a whole subnet with numbered allow AND deny rules, checked from the lowest number up; the first match wins. It is stateless: it doesn't remember connections.

    Commands taughtnetwork-acl

    ▶ Play: Block the noisy rangeSOLUTION HIDDEN40 XP
  6. 18

    Level 18: NAT parts, one at a time

    GuidedEasy

    Objective: Handle every NAT piece once, in a toy VPC called yard, before the real job.

    A NAT gateway is built from pieces: an Elastic IP, the gateway in a public subnet, and a route in the private table that points at it. Practise each piece in a small yard first.

    Commands taughtnat-gateway

    ▶ Play: NAT parts, one at a timeSOLUTION HIDDEN40 XP
  7. 19

    Level 19: A quiet way out

    AloneMedium

    Objective: Let ledger (private subnet hold-a) reach the internet on tcp 443 through a NAT gateway, without making it public.

    A NAT gateway lets servers in a private subnet start connections to the internet while nobody can start one to them. It needs an Elastic IP, must live in a PUBLIC subnet, and the private subnet's route table sends 0.0.0.0/0 to it.

    Commands taughtnat-gateway

    ▶ Play: A quiet way outSOLUTION HIDDEN50 XP
  8. 20

    Level 20: Open and close doors

    GuidedEasy

    Objective: In the lane VPC: look at the route tables, close a door you opened by mistake, then let only the app tier in.

    Security group rules can be removed (revoke-security-group-ingress, same flags as authorize) and can name another group as the source (--source-group sg-ID) instead of an IP range. describe-route-tables shows where each subnet's traffic goes.

    Commands taughtsecurity-group

    ▶ Play: Open and close doorsSOLUTION HIDDEN40 XP
  9. 21

    Level 21: Only the lighthouse may ask

    AloneMedium

    Objective: Make ledger's API (tcp 8080) answer only servers in lighthouse-sg, not drifter and not the rest of the VPC.

    A security group rule can name another security group as its source instead of an IP range: every server in that group is allowed, whatever its IP, now and later.

    ▶ Play: Only the lighthouse may askSOLUTION HIDDEN50 XP
  10. 22

    Level 22: The ferry went dark

    AloneMedium

    Objective: Bring https://beacon (VPC ferry) back on tcp 443 from the internet without making anything else public.

    When a server is unreachable, trace before you touch: analyze-path names the first blocked hop. Fix that hop, trace again, repeat.

    ▶ Play: The ferry went darkSOLUTION HIDDEN60 XP
  11. 23

    Level 23: Four berths, five minutes

    Alone⏱ TimedHard

    Objective: Carve 10.40.36.0/22 into 4 equal subnets in the harbor VPC, spread over eu-west-3a and eu-west-3b.

    Splitting a block into 2^n equal pieces adds n bits to the prefix: a /22 makes four /24s. Spread them over zones so one zone failing can't take every berth.

    ▶ Play: Four berths, five minutesSOLUTION HIDDEN60 XP
  12. 24

    Level 24: A name, a rule, a way out

    GuidedEasy

    Objective: Make a new security group, then give a locked-down subnet a way for its HTTPS answers to leave.

    Create a security group with cloud ec2 create-security-group --vpc-id V --group-name G --description TEXT. A network ACL is stateless, so replies need their own OUTBOUND rule: create-network-acl-entry --egress --port-range From=1024,To=65535 (answers go to high ports).

    Commands taughtsecurity-groupnetwork-acl

    ▶ Play: A name, a rule, a way outSOLUTION HIDDEN40 XP
  13. 25

    Level 25: The Bazaar ticket

    Boss⏱ TimedHard

    Objective: Work ticket BAZAAR-1 (~/harbor/ticket.txt): fix the old stall, then build the two-tier bazaar network.

    A real two-tier network: a public web tier, a private app tier behind NAT, and security groups that chain web → app. Plus a reminder that ACLs are stateless.

    Commands taughtsg-vs-nacl

    ▶ Play: The Bazaar ticketSOLUTION HIDDEN120 XP

World 3Fleet & Vault

11 levels

The network is built, so fill it: servers, a storage vault, a load balancer, a name people can type, and a bill that makes sense.

  1. 26

    Level 26: Light the first server

    GuidedEasy

    Objective: Launch web-1 from the nginx image as a t3.micro in subnet public-a with security group web-sg, as ~/fleet/ticket.txt asks.

    An instance is a rented computer: an image (AMI = the disk it boots from), a type (its size and price), a subnet (where it lives) and security groups (who may talk to it). cloud ec2 run-instances = aws ec2 run-instances.

    Commands taughtfleet-run-instances

    ▶ Play: Light the first serverSOLUTION HIDDEN30 XP
  2. 27

    Level 27: Bigger boots for web-1

    GuidedEasy

    Objective: web-1 is out of memory: make it a t3.small and have it running again.

    You can't change an instance's type while it runs: stop it, change the type (cloud ec2 modify-instance-attribute = aws ec2 modify-instance-attribute), start it. A stopped instance has no compute charge, but its disk (EBS volume) still bills.

    Commands taughtfleet-instance-lifecycle

    ▶ Play: Bigger boots for web-1SOLUTION HIDDEN30 XP
  3. 28

    Level 28: A vault for the website

    GuidedEasy

    Objective: Make a bucket with a unique name and put ~/fleet/site/index.html at its top level.

    S3 stores files (objects) in buckets. Bucket names are global: one namespace for every account on Earth, so 'assets' is long gone. cloud s3 mb / cp / ls = aws s3 mb / cp / ls.

    Commands taughtfleet-s3-basics

    ▶ Play: A vault for the websiteSOLUTION HIDDEN30 XP
  4. 29

    Level 29: Two servers, one front door

    GuidedEasy

    Objective: Put web-a and web-b behind a new load balancer web-alb until both targets report healthy.

    An Application Load Balancer spreads requests over a target group of servers, across at least 2 AZs, and only sends traffic to targets that pass health checks. cloud elbv2 = aws elbv2.

    Commands taughtfleet-load-balancer

    ▶ Play: Two servers, one front doorSOLUTION HIDDEN50 XP
  5. 30

    Level 30: A name people can type

    GuidedEasy

    Objective: Create the zone fleet.example and point www.fleet.example at web-alb with an alias A record.

    Route 53 is AWS's DNS. A hosted zone holds a domain's records; an alias A record points a name at an AWS resource like a load balancer and follows its changing IPs. cloud route53 = aws route53.

    Commands taughtfleet-route53-alias

    ▶ Play: A name people can typeSOLUTION HIDDEN40 XP
  6. 31

    Level 31: Is my bucket open?

    GuidedEasy

    Objective: In the small bucket lab-notes: test as a stranger, close the leak, and turn on versioning.

    cloud s3api (real: aws s3api) is the low-level S3 API: get-bucket-policy reads who is allowed in, delete-bucket-policy removes it, put-public-access-block flips the four safety switches, put-bucket-versioning keeps old versions. --no-sign-request tests as a stranger.

    Commands taughtfleet-bucket-privacy

    ▶ Play: Is my bucket open?SOLUTION HIDDEN40 XP
  7. 32

    Level 32: The invoices are public

    AloneMedium

    Objective: The scanner says fleet-invoices-210987654321 is public: lock it down and keep old versions of every invoice.

    Three locks keep a bucket private: the public access block (four switches that override everything), a bucket policy with no Principal "*", and versioning so a bad write or delete can be undone. --no-sign-request asks as a stranger.

    Commands taughtfleet-bucket-privacy

    ▶ Play: The invoices are publicSOLUTION HIDDEN60 XP
  8. 33

    Level 33: Zero healthy targets

    AloneMedium

    Objective: Bring both targets of web-tg back to healthy, without opening the servers to the internet.

    describe-target-health says WHY a target is out: Target.Timeout (a security group or NACL drops the check), Target.FailedHealthChecks (nothing answers on that port), Target.InvalidState (the instance isn't running).

    ▶ Play: Zero healthy targetsSOLUTION HIDDEN60 XP
  9. 34

    Level 34: The bill, line by line

    GuidedEasy

    Objective: Read a bill, then remove one forgotten volume, one idle address and one forgotten server in another region.

    cloud ce get-cost-and-usage (Cost Explorer) answers where the money goes: --time-period, --granularity, --metrics, then --group-by SERVICE or REGION. Waste is removed with delete-volume, release-address and terminate-instances, always one named ID at a time.

    Commands taughtfleet-cost-explorer

    ▶ Play: The bill, line by lineSOLUTION HIDDEN40 XP
  10. 35

    Level 35: Who doubled the bill?

    Alone⏱ TimedHard

    Objective: Remove the idle waste (an unattached volume, an unused Elastic IP, a forgotten server) without touching anything tagged env=prod.

    cloud ce get-cost-and-usage (= aws ce get-cost-and-usage) splits the bill by SERVICE or REGION. SIM: it projects a month of what exists right now; real Cost Explorer reports what you were charged.

    Commands taughtfleet-cost-explorer

    ▶ Play: Who doubled the bill?SOLUTION HIDDEN80 XP
  11. 36

    Level 36: Ship the shop

    Boss⏱ TimedHard

    Objective: Ship shop.fleet.example: two healthy servers behind shop-alb, as ~/fleet/ship/ticket.txt asks.

    Everything at once: two servers in two AZs, a target group, a load balancer behind its own security group, healthy targets, and a DNS name. ~/fleet/ship/ticket.txt has the order.

    ▶ Play: Ship the shopSOLUTION HIDDEN150 XP

World 4Blueprint Forge

13 levels

Stop clicking, start writing: the same VPCs, subnets and buckets, now as code that plans, applies, remembers and heals.

  1. 37

    Level 37: The first blueprint

    GuidedEasy

    Objective: Build the VPC described in ~/forge/vpc/main.tf with tf, reading the plan before you apply it.

    A .tf file describes what should exist; tf init installs the provider, tf plan shows the diff, tf apply makes it real. SIM: tf = terraform, cloud_vpc = aws_vpc.

    Commands taughttftf-inittf-plantf-apply

    ▶ Play: The first blueprintSOLUTION HIDDEN30 XP
  2. 38

    Level 38: Wire it with references

    GuidedEasy

    Objective: Put the subnet in ~/forge/net inside the VPC by replacing the placeholder with a reference, then apply both.

    A reference like cloud_vpc.main.id reads another resource's attribute, even one that doesn't exist yet. It also tells tf the order: the VPC first, then the subnet.

    Commands taughthcl-references

    ▶ Play: Wire it with referencesSOLUTION HIDDEN30 XP
  3. 39

    Level 39: Knobs and readouts

    GuidedEasy

    Objective: Set env to dev in ~/forge/vars with a terraform.tfvars file, apply, and hand Kern the VPC ID from tf output.

    variable blocks are the blueprint's knobs (var.env); terraform.tfvars or -var env=dev sets them. output blocks print values after apply; tf output -raw NAME prints one bare.

    Commands taughttf-variables-outputs

    ▶ Play: Knobs and readoutsSOLUTION HIDDEN35 XP
  4. 40

    Level 40: The forge remembers

    GuidedEasy

    Objective: Use the state of ~/forge/state to tell Kern how many resources tf tracks, then the real ID behind cloud_subnet.app.

    terraform.tfstate maps each address (cloud_subnet.app) to a real ID (subnet-…). hidden shows the addresses, tf state show ADDR one resource. Never edit the file by hand.

    Commands taughttf-state

    ▶ Play: The forge remembersSOLUTION HIDDEN30 XP
  5. 41

    Level 41: Stamp it twice

    GuidedEasy

    Objective: Add a module "prod" in ~/forge/modules/main.tf that stamps out the network as prod-net with 10.20.0.0/16, and apply it next to dev.

    A module is a folder of .tf files you call like a function: module "prod" { source = "./modules/network" … }. After adding a module block, run tf init again.

    Commands taughttf-modules

    ▶ Play: Stamp it twiceSOLUTION HIDDEN35 XP
  6. 42

    Level 42: The haunted port

    AloneMedium

    Objective: Someone opened SSH to the world on the shop-web security group by hand: find the drift in ~/forge/drift and heal it from code.

    Drift: someone changed the cloud by hand, so reality no longer matches code and state. tf plan refreshes, reports "changed outside of Terraform", and tf apply puts the code back.

    Commands taughttf-drift

    ▶ Play: The haunted portSOLUTION HIDDEN45 XP
  7. 43

    Level 43: Adopt a hand-made bucket

    GuidedEasy

    Objective: Two hand-made buckets already have resource blocks in main.tf: adopt one with Kern's example, then the other alone.

    tf import ADDRESS REAL_ID writes an existing cloud object into the state under the name of a resource block you already wrote. Terraform then manages it; tf plan should say there is nothing to change.

    Commands taughttf-import

    ▶ Play: Adopt a hand-made bucketSOLUTION HIDDEN40 XP
  8. 44

    Level 44: Adopt the stray bucket

    AloneMedium

    Objective: Bring the hand-made bucket forge-artifacts-210987 under Terraform in ~/forge/import as cloud_s3_bucket.artifacts, with a clean plan.

    tf import ADDR ID writes an existing object into the state under ADDR; you write its resource block yourself. Done when tf plan shows no changes. (Terraform 1.5+ also has an import {} block.)

    Commands taughttf-import

    ▶ Play: Adopt the stray bucketSOLUTION HIDDEN45 XP
  9. 45

    Level 45: One blueprint, many stages

    GuidedEasy

    Objective: Practise workspaces and var files on a toy blueprint with staging and qa stages.

    A workspace is a separate state for the same code. hidden, new and select manage them, and tf apply -var-file stage.tfvars feeds one set of variables, so each stage gets its own copy.

    Commands taughttf-workspaces

    ▶ Play: One blueprint, many stagesSOLUTION HIDDEN40 XP
  10. 46

    Level 46: PAGE: prod by morning

    Alone⏱ TimedHard

    Objective: Dev already runs from ~/forge/envs: create a prod workspace and build prod from prod.tfvars without touching dev.

    A workspace is a separate state for the same code: hidden, then tf apply -var-file prod.tfvars builds a second copy that dev's state never sees.

    Commands taughttf-workspaces

    ▶ Play: PAGE: prod by morningSOLUTION HIDDEN45 XP
  11. 47

    Level 47: PAGE: burn the sandbox

    Alone⏱ TimedHard

    Objective: Cost alarm: destroy the whole sandbox stack in ~/forge/stacks/sandbox before the bill closes, and keep the data stack alive.

    tf destroy removes everything in ONE state: the folder you run it in. lifecycle { prevent_destroy = true } makes tf refuse any plan that would delete that resource.

    Commands taughttf-destroy

    ▶ Play: PAGE: burn the sandboxSOLUTION HIDDEN60 XP
  12. 48

    Level 48: Plan, save, apply exactly

    GuidedEasy

    Objective: The toy stack has drifted: detect it, save the fix as a plan file, apply exactly that file, and prove it is clean.

    hidden exits 0 when nothing changes and 2 when something would, so scripts can detect drift. tf plan -out=FILE saves exactly what you reviewed, and tf apply FILE applies only that.

    Commands taughttf-saved-plans

    ▶ Play: Plan, save, apply exactlySOLUTION HIDDEN45 XP
  13. 49

    Level 49: BOSS: Drift storm

    Boss⏱ TimedHard

    Objective: Heal ~/forge/storm after a night of console clicking: detect the drift, save the fix as fix.plan, apply exactly that plan, and prove the plan is clean.

    Code says what should exist, state what tf built, the cloud what is really there. plan -detailed-exitcode reports drift as exit code 2; a saved plan (-out) applies exactly what you reviewed.

    Commands taughttf-saved-plans

    ▶ Play: BOSS: Drift stormSOLUTION HIDDEN120 XP

World 5Night Watch

12 levels

The night shift: audit the account like a pro, chase a culprit in CloudTrail, cut the bill, close real tickets, survive the posture review.

  1. 50

    Level 50: Public bucket hunt

    GuidedEasy

    Objective: Find the public bucket, block it, then switch on Block Public Access for the whole account.

    cloud s3api get-bucket-policy-status (real: aws s3api get-bucket-policy-status) says if a bucket's policy makes it public. Block Public Access closes it: per bucket (s3api put-public-access-block) and for the whole account (s3control put-public-access-block).

    Commands taughtposture-checklists3-block-public-access

    ▶ Play: Public bucket huntSOLUTION HIDDEN30 XP
  2. 51

    Level 51: Doors open to the world

    GuidedEasy

    Objective: Close 22 and 3389 to 0.0.0.0/0 in every group and allow them from the bastion 198.51.100.10/32 instead.

    An audit query: --query 'SecurityGroups[?IpPermissions[?IpRanges[?CidrIp==`0.0.0.0/0`]]].GroupName' lists every group with a rule open to the internet (same JMESPath in real aws ec2 describe-security-groups). SSH (22) and RDP (3389) must only come from the bastion.

    Commands taughtsg-audit

    ▶ Play: Doors open to the worldSOLUTION HIDDEN30 XP
  3. 52

    Level 52: Stale keys, missing MFA

    GuidedEasy

    Objective: Read the credential report, name the console user without MFA, and deactivate the access key nobody used for 90+ days.

    The credential report (real: aws iam generate-credential-report / get-credential-report) is one CSV of every user: password, MFA, key age, key last use. Content comes base64-encoded, so pipe it through base64 -d.

    Commands taughtcredential-reportbase64

    ▶ Play: Stale keys, missing MFASOLUTION HIDDEN30 XP
  4. 53

    Level 53: Read the black box

    GuidedEasy

    Objective: Search the trail of a small account: find an event type, trim the answer, then name the culprit of another.

    CloudTrail records every API call: who, what, when, from where. cloud cloudtrail lookup-events (real: aws cloudtrail lookup-events) searches it: --lookup-attributes AttributeKey=EventName,AttributeValue=DeleteBucket picks an event type; --query and --output trim the answer.

    Commands taughtcloudtrail-lookup

    ▶ Play: Read the black boxSOLUTION HIDDEN35 XP
  5. 54

    Level 54: Who opened port 22?

    AloneMedium

    Objective: Find who opened SSH to the world on app-sg last night, close it, and deactivate that user's key.

    CloudTrail logs every API call: who, what, when, from where. cloud cloudtrail lookup-events (real: aws cloudtrail lookup-events) searches it, e.g. --lookup-attributes AttributeKey=EventName,AttributeValue=AuthorizeSecurityGroupIngress.

    Commands taughtcloudtrail-lookup

    ▶ Play: Who opened port 22?SOLUTION HIDDEN40 XP
  6. 55

    Level 55: Two bill tools

    GuidedEasy

    Objective: Practise the two bill commands of the next shift as dry runs: group the cost by team tag, then resize a stopped server.

    Two moves for the cost shift: cloud ce get-cost-and-usage --group-by Type=TAG,Key=team splits the bill per team tag (real: aws ce get-cost-and-usage), and cloud ec2 modify-instance-attribute --instance-type resizes a stopped server (real: aws ec2 modify-instance-attribute).

    ▶ Play: Two bill toolsSOLUTION HIDDEN20 XP
  7. 56

    Level 56: The idle giant

    Alone⏱ TimedHard

    Objective: Tag the untagged instance with its team, find the most expensive team, and right-size batch-01 to m5.large.

    Cost allocation tags (team=…) let Cost Explorer split the bill: cloud ce get-cost-and-usage --group-by Type=TAG,Key=team (real: aws ce get-cost-and-usage). Right-sizing an instance = stop, modify-instance-attribute --instance-type, start.

    Commands taughtcost-tags-rightsizing

    ▶ Play: The idle giantSOLUTION HIDDEN50 XP
  8. 57

    Level 57: TICKET-1042

    Alone⏱ TimedHard

    Objective: Ship TICKET-1042 with tf from ~/watch/infra: private, versioned logs bucket, ci-deployer may only PutObject into it, plan clean.

    A real ticket mixes everything: S3 privacy, versioning, least-privilege IAM, Terraform. cloud_s3_bucket_versioning = aws_s3_bucket_versioning; review the draft, fix it in code, tf apply, and prove it with a clean tf plan.

    Commands taughts3-versioning-tf

    ▶ Play: TICKET-1042SOLUTION HIDDEN60 XP
  9. 58

    Level 58: Is the site answering?

    GuidedEasy

    Objective: Test a DNS name, then remove a broken ACL rule, in a toy network.

    cloud route53 test-dns-answer asks the DNS service what a name resolves to, without leaving the terminal: --hosted-zone-id, --record-name, --record-type. And cloud ec2 delete-network-acl-entry --network-acl-id A --ingress --rule-number N removes one numbered rule.

    Commands taughtnetwork-acl

    ▶ Play: Is the site answering?SOLUTION HIDDEN40 XP
  10. 59

    Level 59: Site down at 04:40

    Alone⏱ TimedHard

    Objective: www.shop.example is down: find who changed what, and get every ALB target healthy again without opening web-sg to the world.

    Incident order: DNS (route53 test-dns-answer) → load balancer → target health (elbv2 describe-target-health) → network (SG, NACL) → what changed (CloudTrail). The Reason of an unhealthy target points at the broken layer.

    Commands taughtincident-chain

    ▶ Play: Site down at 04:40SOLUTION HIDDEN60 XP
  11. 60

    Level 60: Edit only this block

    GuidedEasy

    Objective: Change only one ingress block of a Terraform file with a sed range, without touching its neighbours.

    sed can act on a RANGE of lines: sed -n '3,5p' prints lines 3 to 5; sed '/start/,/end/s/old/new/' applies the s command only from the line matching /start/ to the next line matching /end/. Perfect for one block of a config file.

    ▶ Play: Edit only this blockSOLUTION HIDDEN40 XP
  12. 61

    Level 61: Posture review

    Boss⏱ TimedHard

    Objective: Close the three findings in ~/watch/posture/FINDINGS.txt by changing main.tf, apply, and end with a clean tf plan.

    The final review: three findings in a Terraform stack, each fixed IN CODE, applied, and proven with a clean tf plan. A console fix (cloud … by hand) is drift: the next apply puts the hole back.

    Commands taughtcloud-interview-card

    ▶ Play: Posture reviewSOLUTION HIDDEN150 XP

World 6Open Forge

9 levels

The same blueprints with an open-source tool, OpenTofu: read HCL like a pro, tidy and check it, move a Terraform project over and fix a broken stack.

  1. 62

    Level 62: Same forge, open tool

    GuidedEasy

    Objective: Meet tofu in ~/forge/open/first: check its version, init, look at the files it makes, plan, apply, then count what the state tracks.

    OpenTofu is the open-source fork of Terraform (Linux Foundation, MPL 2.0). The command is tofu instead of terraform; .tf files, terraform.tfstate, .terraform/ and .terraform.lock.hcl stay the same (SIM: tofu is built on the tf SIM of the Blueprint Forge).

    Commands taughttofutofu-vs-terraform

    ▶ Play: Same forge, open toolSOLUTION HIDDEN30 XP
  2. 63

    Level 63: Blocks, labels, braces

    GuidedEasy

    Objective: Write a resource block line by line in ~/forge/open/blocks, check it with hidden, then write a second block alone and apply.

    HCL is made of blocks: the block type (resource), its labels in quotes ("cloud_s3_bucket" "logs"), then { to open the body. Inside, each argument is name = value, a } closes the block, and indentation does not matter to tofu (hidden tidies it later).

    Commands taughthcl-syntaxtofu-validate

    ▶ Play: Blocks, labels, bracesSOLUTION HIDDEN30 XP
  3. 64

    Level 64: Strings, numbers, bools

    GuidedEasy

    Objective: Ask tofu console about each kind of value in ~/forge/open/types, then use a bool and a map in main.tf and apply.

    Every value has a type: a string is text in double quotes ("web"), a number has no quotes (80), a bool is true or false, a list is ["a", "b"], a map is { Team = "forge" }. tofu console evaluates any expression, and type(...) names its type.

    Commands taughthcl-typestofu-console

    ▶ Play: Strings, numbers, boolsSOLUTION HIDDEN30 XP
  4. 65

    Level 65: References and templates

    GuidedEasy

    Objective: In ~/forge/open/refs, look at a reference, the quoted trap and a template in tofu console, then wire subnet.tf to the VPC and apply.

    A reference reads a value from another block: cloud_vpc.main.id (type, name, attribute, no quotes); in quotes it is just text. A template puts a value inside a string: "${cloud_vpc.main.tags.Name}-app".

    Commands taughthcl-templates

    ▶ Play: References and templatesSOLUTION HIDDEN30 XP
  5. 66

    Level 66: Variables, locals, outputs

    GuidedEasy

    Objective: In ~/forge/open/knobs read a variable and a local in tofu console, change the knob with -var, add an output, apply, then add a second output alone.

    A variable block is an input knob, read as var.env. locals { name = ... } names a value you compute once, read as local.name. An output block prints a value after apply; tofu output NAME shows it later. -var env=prod changes a knob for one run.

    Commands taughthcl-variables-localstofu-output

    ▶ Play: Variables, locals, outputsSOLUTION HIDDEN35 XP
  6. 67

    Level 67: Tidy and check

    GuidedEasy

    Objective: In ~/forge/open/tidy, check and preview the formatting, format the files, read the validate error, then fix it alone.

    hidden rewrites files in the standard style: 2-space indent, = signs lined up. -check only reports (exit 3), -diff shows the change. hidden finds real mistakes (syntax, types, references). Read the first error, fix it, run it again.

    Commands taughttofu-fmt

    ▶ Play: Tidy and checkSOLUTION HIDDEN35 XP
  7. 68

    Level 68: Move a project to tofu

    GuidedEasy

    Objective: Move ~/forge/open/legacy, built with tf (Terraform), to tofu: read its lock file, init, prove nothing changes, and count what the state tracks.

    To move a Terraform project: back up the state, hidden (rewrites the lock file for registry.opentofu.org), then hidden must say No changes. OpenTofu-only settings can go in .tofu files: with x.tofu and x.tf, tofu reads x.tofu, terraform x.tf.

    Commands taughttofu-migrate

    ▶ Play: Move a project to tofuSOLUTION HIDDEN40 XP
  8. 69

    Level 69: Forge one alone

    AloneMedium

    Objective: In ~/forge/open/own build a small stack from nothing (the full list is in the concept), keep hidden clean, then init and apply.

    Write: variable env (string, default "dev"); a cloud_vpc 10.95.0.0/16 named "${var.env}-vpc"; a cloud_subnet 10.95.1.0/24 inside it named "${var.env}-app"; an output vpc_id with the VPC's id. provider.tf is already there.

    ▶ Play: Forge one aloneSOLUTION HIDDEN50 XP
  9. 70

    Level 70: The broken forge

    Boss⏱ TimedHard

    Objective: In ~/forge/open/broken the files are broken and a port was opened by hand: make hidden pass, delete nothing, then make the cloud match the code.

    Fix in order: hidden shows one error at a time (syntax first, then types, then references); fix the line it names (or the line just above it), run it again. When the files are valid, hidden shows the drift and tofu apply puts the cloud back to the code.

    ▶ Play: The broken forgeSOLUTION HIDDEN120 XP

World 7Real OpenTofu

6 levels

The Surveyors' Guild: the real tofu binary on a lab machine with real providers, a real container and an encrypted state, no simulator and no internet.

  1. 71

    Level 71: Install tofu by hand

    GuidedEasy

    Objective: Install the real tofu into ~/bin from http://registry.ptr:5000/pkg/tofu, verify it, and write its version number into /root/answer.

    This terminal is a real lab machine with no internet, so tofu comes from the lab's mirror. Download the release and its checksum list, check the sum, unpack the binary into ~/bin and put ~/bin on your PATH.

    Commands taughttofu-real-install

    ▶ Play: Install tofu by handSOLUTION HIDDEN30 XP
  2. 72

    Level 72: Providers without internet

    GuidedEasy

    Objective: In ~/survey/hello, see where providers come from, init and apply a real local_file, then add a second file alone.

    hidden normally downloads providers from registry.opentofu.org. Here ~/.tofurc points provider_installation at a filesystem_mirror folder, so init installs the real hashicorp/local provider offline.

    Commands taughttofu-provider-mirror

    ▶ Play: Providers without internetSOLUTION HIDDEN35 XP
  3. 73

    Level 73: Random names, stable state

    GuidedEasy

    Objective: In ~/survey/camp, init, read the lock file, apply a random_pet, see plans stay quiet, then force a new name and write it into /root/answer.

    hashicorp/random makes random values once and keeps them in the state, so plans stay quiet. The lock file pins each provider's exact version and hash; -replace=ADDRESS forces one resource to be made again.

    Commands taughttofu-lock-replace

    ▶ Play: Random names, stable stateSOLUTION HIDDEN35 XP
  4. 74

    Level 74: Lock the map

    GuidedEasy

    Objective: In ~/survey/vault, find the plain-text password in the state, switch on encryption (a .tofu file), rotate the password, and prove the state is unreadable.

    State files hold secrets in plain text, and OpenTofu (not Terraform) can encrypt the state on your side: an encryption block with a key provider (pbkdf2 from a passphrase) and a method (aes_gcm). A fallback reads the old plain state once.

    Commands taughttofu-state-encryption

    ▶ Play: Lock the mapSOLUTION HIDDEN45 XP
  5. 75

    Level 75: A container from a blueprint

    GuidedEasy

    Objective: In ~/survey/dock, init and apply a real nginx container, check it answers, then move it to port 8081 alone.

    The kreuzwerker/docker provider drives a container engine through its API. Here it talks to this machine's podman socket, so docker_image pulls nginx from the lab registry and docker_container runs it on port 8080.

    Commands taughttofu-docker-provider

    ▶ Play: A container from a blueprintSOLUTION HIDDEN45 XP
  6. 76

    Level 76: The state file storm

    Boss⏱ TimedHard

    Objective: In ~/survey/storm the files are broken and two surveyed files were deleted by hand: fix, read the plan, heal, and keep the same camp name.

    Fix the files until hidden passes, read what hidden wants (the state still lists files someone deleted by hand), then apply until the plan is clean.

    ▶ Play: The state file stormSOLUTION HIDDEN120 XP

For teachers

Use these levels with a class

SOLUTION HIDDEN Teachers see answer keys in the classroom.

For teachers
ROOTSPIRE
DiscsFor teachers
▶ Play freeLibrary 16 discsDiscsFor teachersLog in