Replace network trust with identity on every request for a fictional freight company's internal services: run a private CA that issues one-hour workload certificates, require mutual TLS through Envoy, sign staff in with Keycloak, MFA and step-up, bind tokens to certificates, decide every call with a tested Rego policy in OPA, log services in to PostgreSQL without passwords, record every decision and rehearse the response to stolen credentials.
Cyber Security Engineer. Advanced.
For engineers who are comfortable in a terminal, with Docker and HTTP, and want to build and verify zero-trust identity for internal services: workload certificates, mutual TLS, single sign-on with MFA and step-up, bound tokens, policy as code and rehearsed revocation.
This project asks you to secure the connections between services and the people who use them: who may call what, how each side proves who it is, how long that proof lasts and what happens when it is stolen. You will configure an identity provider, a certificate authority, proxies and a policy engine, and you will read the code that ties them together. This page lists what you are expected to know already, what the project teaches, and how to check that your machine is ready.
Harrowgate Freight's internal services used to trust the network: if a request arrived from inside, it was believed. In this design nothing is trusted because of where it comes from. Every request has to prove two things before it reaches a service:
Harrowgate's services used to believe a request because of where it came from. Anything inside the network could call the shipments API with the shared key; the billing service trusted every caller on the same network; one database password opened the billing tables. That design has one boundary, and once it is crossed (a laptop with the key, a compromised container, a former contractor's account) everything behind it is open, for as long as nobody notices.
Every workload in the lab proves who it is with a certificate from Harrowgate's own certificate authority. This lesson explains what a certificate actually asserts, how the lab's CA is set up, how a brand-new workload gets its first certificate without ever being given a secret that lasts, how it renews, and how a stolen one is shut out.
Ordinary TLS proves one thing: the server is who it claims to be. The client stays anonymous. Mutual TLS (mTLS) asks the client for a certificate too, so both ends prove their identity before a single byte of the request is read. In this lab every connection to the shipments and billing services is mutual TLS, and an Envoy proxy beside each service enforces it, checks any token, asks the policy, and only then forwards the request.
Workloads prove who they are with certificates. People cannot carry a private key around in the same way, so they sign in to an identity provider, which then vouches for them to the applications they use. In this lab the identity provider is Keycloak, the protocol is OpenID Connect (OIDC), and the application is the staff console. This lesson walks through the sign-in, the tokens it produces and the Keycloak settings behind it.
A password alone is the weakest credential in the lab: people reuse them, type them into the wrong page and share them. Harrowgate's finance and admin users therefore also prove they hold a device that generates one-time passwords. And because the riskiest action, a large billing adjustment, deserves more than "they signed in this morning", the policy asks for a fresh one-time password before allowing it. This lesson covers both: multi-factor authentication (MFA) at sign-in,
Two weaknesses remain after lessons 5 to 7. First, a confidential OIDC client normally proves itself to the identity provider with a client secret, a shared password that lives in a configuration file. Second, an access token is a bearer token: anyone holding a copy can use it until it expires. This lesson removes both, using the console's certificate: the console authenticates to Keycloak with it, and Keycloak binds the tokens it issues to it (RFC 8705).
By the time a request reaches the policy, two facts are established: which workload is calling (its certificate) and, if a person is behind it, who they are and how they signed in (a valid, bound token). Neither fact says whether the request is allowed. That is the policy's job. This lesson shows how the decision is split between Envoy, the authorization adapter and Open Policy Agent (OPA), how the Rego policy is written so that it denies by default, and how it is tested.
Harrowgate's billing service used one database password for two years. It lived in an environment file, in the deployment pipeline and in at least one laptop's shell history. In this lab no workload has a database password at all. Each workload logs in to PostgreSQL with the same one-hour certificate it uses everywhere else, PostgreSQL turns the certificate's name into exactly one role, and each role can touch only its own tables.
Last quarter an auditor asked Harrowgate a simple question: who approved the £4,800 adjustment on a customer's charge, and how did they prove who they were? Nobody could answer. Shared team accounts, a static API key and no record of decisions meant the approval could have come from anyone with network access. Zero trust is not only about refusing the wrong requests; it is about being able to show, afterwards, exactly which requests were allowed, for whom, and why.
"Assume breach" means planning for the day a credential is stolen, and knowing, not hoping, how fast it stops working. This lesson walks through the three drills the lab can run against itself. Each one changes the running lab the way a real response would, then checks that the old credential is refused and that nothing legitimate broke. Each writes a timeline to reports/ that you can attach to an incident record.
This runbook takes you from an empty machine to a running lab in which every request proves who is calling, then through verification, three recovery drills and an access review. Each section says where to run the commands and what a correct result looks like. The build steps in the Step-by-Step Guide link to the matching section.
The lab lives entirely in Docker on your computer: containers, two networks, named volumes (the CA and its keys, every workload's identity, the databases) and two locally built images, plus the secrets/ and reports/ folders in source/. Nothing was created anywhere else.
Before anything runs, you check that Docker has enough room, that the two loopback ports the lab publishes are free, and you generate the lab's secrets on your own machine. Nothing is downloaded from anyone else's account and no secret is typed by hand: the script creates random passwords, one-time password seeds and the CA's key password in a folder Git ignores.
One command starts fourteen containers in order: the certificate authority is created, server certificates and one-time tokens are issued, PostgreSQL, Keycloak and OPA start with their certificates, every workload enrols for its own one-hour certificate, and the proxies come up in front of the services.
Every server in the lab now presents a certificate from Harrowgate's own CA. You list them with the operator tool, look inside one workload certificate (its SPIFFE name, its one-hour validity, its revocation list address), and check that each private key is readable only by its own workload.
You sign in to the console as a dispatcher (password only) and as a finance user (password and one-time password), see what the console knows about each session, and watch the policy keep a dispatcher to their own depot. Marking a shipment delivered shows a service calling another service as itself.
Being inside the lab network is no longer enough. You call the shipments service with no certificate, with a certificate the policy does not allow, with a valid token on the right certificate and with the same token on a different certificate, and you read each decision in the audit table.
A small adjustment is approved at once. A large one, two minutes after signing in, is refused with a step-up challenge: you enter a fresh one-time password and the console finishes the approval. Then the nightly invoicing job runs with its own one-time token, as a workload with no person behind it.
One command checks every control: refusals at the handshake, by the token check and by the policy; sign-ins with right and wrong one-time passwords; depot rules; step-up; database logins; and the audit record. Every row states what it expects before it runs, and the command fails if any row differs.
You treat a finance user's session as stolen: disable the account, end its sessions and watch high-risk calls refused at once and the rest at token expiry. Then you rotate Keycloak's token signing key in stages, without a single valid token being refused, and see tokens signed by the old key rejected.
The last drill plays a thief with a copy of the shipments service's key: you revoke it, watch the copy refused at the handshake and the real service re-enrol with a new key. Then you build the access review an auditor would ask for, and run the unit and policy tests.
You stop and delete every container, network and volume of the lab, including the CA and its keys, remove the two locally built images and the generated secrets, and check that nothing with the lab's label remains.
Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.
No cloud account, licence or spending is needed: the certificate authority, Keycloak, the proxies, OPA, PostgreSQL and the services run as containers on your own computer, with synthetic data and generated credentials for a fictional company. The first build downloads about 1.5 GB of images and packages. GitHub Actions is optional; it is free on public repositories and uses your account's included minutes on private ones. This is a learning lab, not a hosted environment, a security certification or a production-readiness guarantee.
Vectametric Project Source Licence (2026-09-27): lawfully obtained source may be copied, modified and deployed for personal learning and interview preparation, including personal portfolio demonstrations with attribution. These permissions continue after online access expires. Do not resell or redistribute the Source Pack or its original source files, unchanged or modified. Commercial or client production use requires separate written permission. Third-party components, such as Keycloak, step-ca and the step CLI, Envoy, Open Policy Agent, PostgreSQL, FastAPI, Uvicorn, HTTPX, PyJWT, psycopg, cryptography, Jinja2, pytest and ruff, retain their own licences. See LICENSE.txt and the Project Source Licence section of the site Terms for the full rules.
You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.
Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.
No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.
The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.
The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.
Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.
Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy