# azure-security-lab-terraform

azure-security-lab-terraform guides an agent through deploying a Terraform lab in Azure: hub-spoke VNets, Azure Firewall Basic, NSGs and Key Vault. Useful when you want real network controls to practise on without wiring them by hand.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 134 installs · ★ 13 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/security-skills/tree/HEAD/skills/azure-security-lab-terraform/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/azure-security-lab-terraform

## What it does

The skill takes an agent through standing up the Azure Security Lab with Terraform: a hub VNet at `10.20.0.0/16` holding Azure Firewall Basic, a test spoke at `10.23.0.0/16` with an untrusted client, and a protected spoke at `10.22.0.0/16` running an IIS VM without a public address. NSGs guard each subnet, route tables push traffic into the firewall. Key Vault, Log Analytics and Azure Policy are variable toggles; `deploy_bastion` trades public RDP for private access.

Triggers cover the messy part too, like a failed apply or checking that firewall rules and logging behave. Settings live in `terraform.tfvars` or a file under `environments/`; then it is `terraform plan -var-file="terraform.tfvars"` and `terraform apply`. Outputs hand you connection details, such as `terraform output test_client` or the password from `terraform output -raw windows_admin_password`.

You need Terraform 1.9.0 or newer, the Azure CLI, and a subscription where you hold Contributor. `admin_source_ip_cidr` must carry your own address as a `/32`; without it RDP to the test client is not opened. Azure Firewall Basic runs at roughly 0.40 USD per hour, so tear the lab down with `terraform destroy -var-file="terraform.tfvars"` when the session ends. `deploy_firewall = false` drops the inspection step.

## Requirements
- Works with: Azure, Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill azure-security-lab-terraform -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/azure-security-lab-terraform/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/azure-security-lab-terraform/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill azure-security-lab-terraform -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/azure-security-lab-terraform/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill azure-security-lab-terraform -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/azure-security-lab-terraform/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/security-skills skills/azure-security-lab-terraform
```

2. **Manually: put the files in place**
- File: `.github/skills/azure-security-lab-terraform/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill azure-security-lab-terraform -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/security-skills --path skills/azure-security-lab-terraform
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/azure-security-lab-terraform/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill azure-security-lab-terraform -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/security-skills/tree/HEAD/skills/azure-security-lab-terraform/SKILL.md

## When to use it
- stand up a hub-spoke network with a firewall between spokes
- check how NSGs and route tables block traffic between subnets
- spin up a Windows client with RDP limited to one IP
- deploy Key Vault, Log Analytics and Azure Policy in a single apply
- debug a failed Terraform apply in the lab

## Example prompts
- Deploy the Azure security lab from `terraform.tfvars` with Azure Firewall Basic and both spokes.
- Why did `terraform apply` fail on the firewall module? Walk through the deployment and fix it.
- Tear down the lab: `terraform destroy -var-file="terraform.tfvars"`.

## Similar
- [azure-copilot](https://affpapa.org/en/nevibecode/skills/azure-copilot.md) — skill · 180 installs
- [terraform-azure](https://affpapa.org/en/nevibecode/rules/terraform-azure.md) — rule · ★ 41430 repo stars
- [generate-modern-terraform-code-for-azure](https://affpapa.org/en/nevibecode/rules/generate-modern-terraform-code-for-azure.md) — rule · ★ 41430 repo stars
- [azure-key-vault](https://affpapa.org/en/nevibecode/skills/azure-key-vault.md) — skill · 333 installs
- [terraform-tasks](https://affpapa.org/en/nevibecode/skills/terraform-tasks.md) — skill · 155 installs
- [terraform-engineer](https://affpapa.org/en/nevibecode/agents/terraform-engineer.md) — subagent · 328 installs

From the same set: [reason-machines/security-skills](https://affpapa.org/en/nevibecode/by/reason-machines/security-skills.md) — 129 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
