# Security kit workflows

The Security kit finds vulnerabilities early in systems and software that you
own or have written permission to test, and reports them so they get fixed.
It covers threat models, application security in depth (sign-in, cryptography,
browser code, apps built on language models, fuzzing), code and supply-chain
review, cloud, hosts, identity and mail domains, authorized testing with the
tools you already use (the Kali Linux toolset, OWASP ZAP, Burp Suite, Ghidra,
radare2 and similar), detection, forensics, reports, retests, incident response,
and risk, compliance and policy work.

You use it by typing skills in your coding agent. Each recipe below lists the
skills in order, what each step produces and where it lands, and a prompt you
can copy. The prompts use the Claude Code form, a slash and the skill's name;
other runtimes start skills their own way.

New to ezi? Start with [Getting started](https://ezikit.dev/docs/getting-started/). When no recipe
fits, ask `/ezi-guide` which skill does.

## Only what you are authorized to test

The kit is for authorized work only. Before anything is scanned, captured or
reverse engineered, you record the scope: who authorized the work, the
reference (a contract, a ticket or written permission), the end date, and each
host, address range, URL, file or app you may test. The scope lives in
`.ezi/security/scope.yaml` in the project, and only `/ezi-security-scope`
writes it, after you confirm each entry.

A kit hook, the scope guard, then checks every recognized security or
reverse-engineering tool the agent runs from the shell:

- no scope, an expired scope or a target outside it: the run is denied;
- a target inside the scope: you are asked to approve that one run, with the
  tool and the target shown;
- a target the guard cannot read from the command: you are asked, never
  silently allowed;
- tools that build payloads or attack infrastructure: denied in every scope;
- a version or help lookup (`nmap --version`, `httpx -h`): passes, it reaches
  nothing.

Each decision is recorded in `.ezi/security/activity.log` on your machine,
with the time, the tool and the targets but never the full command. Nothing
is sent anywhere.

At the start of each session the kit tells the agent what the scope file
says: who authorized the work, until when, and which targets, or that no
scope is recorded yet. The agent then knows the work is authorized and
defensive before it reads any tool name or vulnerability report.

The guard is a guardrail for a cooperative agent, not a sandbox. `curl`,
`wget`, `openssl` and netcat are not gated, so everyday work is not
interrupted; a run of one that reaches an in-scope target is logged as
`observe`. The guard does not see a script the agent wrote. The kit's rules
apply the same scope and approval to those, and forbid working around the
guard. Only Claude Code shows the guard's approval prompt; on every other
runtime, in-scope runs are denied with the command for you to run yourself.

Reading your own code, configuration and dependency files in the project is
review, not testing, and needs no scope entry.

The kit does not install any security tool. `/ezi-security-toolbox` checks
which ones you have, on your machine or in a Kali virtual machine or
container you run, and explains how to add the rest.

## Start an assessment

| Step | Skill | What you get |
|---|---|---|
| 1 | `/ezi-security-scope` | `.ezi/security/scope.yaml`, each entry confirmed by you |
| 2 | `/ezi-pentest-plan` | Rules of engagement and a test plan per in-scope asset (OWASP WSTG, PTES) |
| 3 | `/ezi-security-toolbox` | Which tools are available and how to install the missing ones |
| 4 | `/ezi-threat-model` | `docs/security/threat-model.md`: a STRIDE model with ranked risks and mitigations |

```text
/ezi-security-scope
```

`/ezi-security-scope show` prints the current scope and the recent activity;
the same skill extends, narrows or ends it, again entry by entry.

## Review before it is built

| Step | Skill | What you get |
|---|---|---|
| 1 | `/ezi-threat-model` | The ranked threats of the system you describe |
| 2 | `/ezi-secure-design-review` | Design flaws and the changes that remove them, before code is written |
| 3 | `/ezi-business-logic-review` | Abuse cases per workflow: tampered prices, races, skipped steps, refunds |

```text
/ezi-secure-design-review docs/architecture.md
```

## Review code, dependencies and the pipeline

| Step | Skill | What you get |
|---|---|---|
| 1 | `/ezi-code-security-review` | Vulnerabilities traced from input to use, each with proof and a fix |
| 2 | `/ezi-dependency-audit` | A software bill of materials under `.ezi/security/sbom/` and the known-vulnerable packages that are actually reachable |
| 3 | `/ezi-secrets-scan` | Leaked keys in the code and its history, with a rotation plan |
| 4 | `/ezi-supply-chain-review` | Tampering risks in the build, CI and package publishing |
| 5 | `/ezi-devsecops-pipeline` | SAST, dependency, secret, IaC and image scans as CI gates that start green |

```text
/ezi-code-security-review src/api/
```

With the Development kit installed too, its `/ezi-security-audit` is a quick
pass over a whole codebase; `/ezi-code-security-review` goes deep on one area.

## Go deep on one part of the application

| Skill | What you get |
|---|---|
| `/ezi-auth-review` | Sign-up, sign-in, MFA, password reset, sessions, OAuth and OIDC, SAML and JWT checked against OWASP ASVS |
| `/ezi-crypto-review` | Algorithms, key handling, randomness, password hashing and TLS settings, with each misuse and its fix |
| `/ezi-client-side-security` | DOM XSS, a Content Security Policy rolled out in report-only mode first, third-party scripts and browser storage |
| `/ezi-ai-app-security` | Your LLM or agent app against the OWASP Top 10 for LLM Applications, with harmless canary prompts in scope |
| `/ezi-variant-analysis` | Semgrep or CodeQL rules from one confirmed bug, a sweep for its siblings, and the rule added to CI |
| `/ezi-fuzzing` | A fuzz harness for your own code, crash triage, and each crash turned into a regression test |

```text
/ezi-auth-review src/auth/
```

## Review cloud, hosts and identity

| Step | Skill | What you get |
|---|---|---|
| 1 | `/ezi-cloud-config-review` | Cloud and infrastructure-as-code settings checked against published benchmarks |
| 2 | `/ezi-container-security` | Findings in images, Dockerfiles and Kubernetes manifests |
| 3 | `/ezi-host-hardening` | Linux, macOS and Windows hosts checked against CIS Benchmarks, with the fixes |
| 4 | `/ezi-identity-review` | Risky settings and privilege-escalation paths in Active Directory, Entra ID and cloud IAM, from read-only collection in scope |
| 5 | `/ezi-network-segmentation-review` | Firewall rules, zones, VPN and zero-trust access reviewed |
| 6 | `/ezi-email-domain-security` | SPF, DKIM, DMARC, MTA-STS, DNSSEC and takeover candidates on your domains |
| 7 | `/ezi-ransomware-readiness` | Backups, restore tests and recovery runbook scored, with a fix plan |

```text
/ezi-cloud-config-review infra/terraform/
```

## Test what is in scope

| Skill | What it tests |
|---|---|
| `/ezi-attack-surface` | Your organization's internet-facing assets, from passive sources first, as an asset register for the scope |
| `/ezi-web-app-assessment` | A web application, least intrusive checks first, mapped to the OWASP testing guide |
| `/ezi-api-security-test` | An API's access control, authentication and input handling, mapped to the OWASP API Top 10 |
| `/ezi-network-assessment` | Exposed services and TLS on in-scope hosts, from a gentle scan up |
| `/ezi-wireless-assessment` | An authorized Wi-Fi network: encryption, protected management frames, rogue access points and guest isolation |
| `/ezi-binary-analysis` | Your own executables and firmware, for memory-safety, hardening and logic flaws |
| `/ezi-mobile-app-security` | Your own Android and iOS apps against OWASP MASVS, statically and on a test device |

```text
/ezi-web-app-assessment https://staging.example.com
```

Before each run the agent shows the exact command, the target and its scope
entry, what it sends and how noisy it is; then the scope guard asks you.
Proof stops at the minimum that convinces the owner: a test account, a crash,
a single response. Findings land under `.ezi/security/findings/` and raw
output under `.ezi/security/evidence/`.

## Detect and investigate

| Skill | What you get |
|---|---|
| `/ezi-detection-engineering` | Log coverage mapped to MITRE ATT&CK, Sigma detections, and a check that each alert fires |
| `/ezi-threat-hunting` | Hunts through your own logs, each with its hypothesis, queries and result |
| `/ezi-digital-forensics` | A timeline from disk, memory and logs, worked on copies with hashes and chain of custody |
| `/ezi-malware-triage` | A suspicious file from your systems triaged safely, with YARA rules and indicators to find other copies |

```text
/ezi-detection-engineering Our CloudTrail and Okta logs in the SIEM
```

## Report, fix and verify

| Step | Skill | What you get |
|---|---|---|
| 1 | `/ezi-vulnerability-report` | A report under `plans/reports/`: summary, scope and method, findings by severity with evidence and remediation |
| 2 | `/ezi-vulnerability-triage` | Findings and advisories ordered by CVSS, EPSS, CISA KEV and exposure, with fix deadlines |
| 3 | The engineering fix | `/ezi-plan` and `/ezi-fix` change the code and add a test that fails before the fix |
| 4 | `/ezi-remediation-verify` | A retest of each fixed finding in scope, with its closure recorded |

```text
/ezi-vulnerability-report
```

Every finding uses one format: an ID (`SEC-001`), a title, a severity with
its CVSS vector, the CWE, the affected asset, redacted evidence, steps the
owner can follow to reproduce it, the remediation and a status.

## When something is happening now

| Step | Skill | What you get |
|---|---|---|
| 1 | `/ezi-incident-response` | A playbook run: triage, containment, evidence preservation, recovery and a post-incident review |
| 2 | `/ezi-digital-forensics` | The evidence questions answered: what happened, when, and what was touched |

Before anything happens, `/ezi-tabletop-exercise` runs a drill with your team
on a scenario such as ransomware or leaked cloud keys, and records the gaps.

```text
/ezi-incident-response Unknown logins on the admin panel since 02:00
```

Evidence is preserved before anything is changed, and the playbook says when
to bring in your legal or management contacts.

## Risk, compliance and policy

| Skill | What you get |
|---|---|
| `/ezi-compliance-mapping` | A control matrix against OWASP ASVS, ISO/IEC 27001:2022, SOC 2, PCI DSS v4.0, NIST CSF 2.0 and CIS Controls, with gaps and the evidence to collect. It prepares an audit; it does not certify. |
| `/ezi-risk-register` | Risks rated by likelihood and impact, with treatment, owner and due date |
| `/ezi-privacy-review` | A personal-data map, retention and deletion, and GDPR technical controls; legal questions are flagged for your counsel |
| `/ezi-vendor-risk-review` | Vendors tiered by the data and access they hold, and their security evidence reviewed |
| `/ezi-security-policy` | SECURITY.md, a disclosure policy and security.txt, and triage of reports from researchers |

## Keep the Security kit in its own project

Initialize the Security kit in a project of its own, separate from your other
kits, so its scope, evidence and approvals stay apart from everyday work:

```bash
mkdir security-assessment && cd security-assessment
ezi kit install security --yes
```

Point the skills at the code or systems under review from there. If you do
add it next to another kit, install it as a Claude Code plugin with
`--switch-to-plugin`, as for any second kit.
