navikt/copilot/threat-model
Claude Code and agent skill by navikt/copilot
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
STRIDE-A trusselmodellering for Nais-mikrotjenester — dataflyt, tillitsgrenser og risikovurdering
Install
npx vskill@latest install navikt/copilot/threat-modelSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as navikt/copilot/threat-model.
Threat Model — STRIDE-A Analysis
Systematic threat identification for NAIS microservices using the STRIDE-A methodology. Produces a data flow diagram, structured threats table, prioritized mitigations, and residual risk summary.
When to Use
- Before launching a new service
- Major architecture changes (new data stores, auth mechanism changes)
- New data flows (especially involving PII)
- External integrations (partner APIs, third-party services)
- API exposure (new public or internal endpoints)
- Regulatory or compliance reviews
- Post-incident analysis to update existing threat models
Step 1: Define Scope
Start by answering these questions to establish the threat model boundary:
Service Identity
- What does the service do? (one sentence — e.g., "Processes dagpenger applications")
- What team owns it?
- What cluster and namespace does it run in? (dev-gcp, prod-gcp)
Data Classification
- What data does the service process?
- PII classification level:
- Strengt fortrolig — FNR, health data, criminal records
- Fortrolig — name, address, phone, email
- Intern — case IDs, team metadata
- Åpen — public statistics, documentation
Consumers and Dependencies
- Who consumes this service? (end users, other services, external partners)
- What does this service depend on? (databases, Kafka topics, upstream APIs)
- What auth mechanisms are in play? (ID-porten, Entra ID, TokenX, Maskinporten)
Deployment Context
- Nais cluster: dev-gcp / prod-gcp
- Ingress type: intern.nav.no (internal) / nav.no (public) / none
- Has egress to external services? Which ones?
Step 2: Data Flow Diagram (DFD)
Map the system using these element types:
Element Types
| Symbol | Element | Example | |
|---|---|---|---|
[External Entity] | User or external system | [Citizen Browser], [Partner API] | |
(Process) | Your service or component | (dp-soknad), (dp-behandling) | |
{Data Store} | Database, topic, bucket | {PostgreSQL}, {kafka: dp.soknad.v1}, {GCS Bucket} | |
--> | Data flow | [User] --> (API) | |
== boundary == | Trust boundary | == Internet/Ingress == |
Example DFD
Nav-Specific Trust Boundaries
Identify these trust boundaries in every Nav threat model:
| Boundary | Transition | Security Mechanism | |
|---|---|---|---|
| Internet → Ingress | External user to Nais | Wonderwall + ID-porten / Entra ID | |
| Ingress → Application | Sidecar to app container | Token validation (JWT claims) | |
| Application → Application | Service-to-service | TokenX token exchange / Entra ID M2M | |
| Application → Kafka | App to message broker | mTLS (Nais-managed certs), schema validation | |
| Application → Database | App to PostgreSQL | Nais-injected credentials, connection pooling | |
| Application → External API | App to outside Nais | Egress policy, mutual TLS, API keys | |
| GCP → On-prem | Cloud to legacy systems | NAV VPN / Private Service Connect |
Step 3: STRIDE-A per Element
Analyze each element and data flow against all seven threat categories.
Threat Categories
S — Spoofing (Identity Forgery)
Can an attacker impersonate a legitimate user or service?
Nav-specific threats:
- Stolen or leaked JWT tokens used to access APIs
- Missing
azp(authorized party) validation on M2M tokens - ID-porten session fixation or token replay
- Forged
subclaim in test environments leaking to prod - Missing
issandaudvalidation
Detection patterns:
T — Tampering (Data Modification)
Can an attacker modify data in transit or at rest?
Nav-specific threats:
- Unsigned Kafka messages allowing message injection
- Unvalidated request bodies (missing schema validation)
- Missing HMAC on webhook payloads
- SQL injection through unparameterized queries
- Tampered idempotency keys causing duplicate processing
Detection patterns:
R — Repudiation (Deniability)
Can an actor deny performing an action?
Nav-specific threats:
- Missing audit logs for vedtak (legally required)
- No correlation IDs across service calls (cannot trace actions)
- No user action trails for saksbehandling
- Overwritten audit entries in mutable logs
- Missing timestamps or actor identity in log entries
Detection patterns:
I — Information Disclosure (Data Leaks)
Can an attacker access data they should not see?
Nav-specific threats:
- PII in logs (FNR, name, address) — GDPR violation
- Overly broad API responses returning more fields than needed
- Kafka topic access too permissive (team-wide instead of app-specific)
- Stack traces in error responses exposing internal details
- PII in Prometheus metric labels
- Unencrypted data in GCS buckets
Detection patterns:
D — Denial of Service (Availability)
Can an attacker degrade or disable the service?
Nav-specific threats:
- Missing rate limiting on public-facing endpoints
- No circuit breakers for downstream service calls
- Unbounded database queries (missing LIMIT/pagination)
- Kafka consumer lag causing cascading delays
- Large payload attacks (unbounded request body size)
- Resource exhaustion from missing Nais resource limits
Detection patterns:
E — Elevation of Privilege (Unauthorized Access)
Can an attacker gain access they should not have?
Nav-specific threats:
- IDOR — accessing another user's vedtak by guessing ID
- Missing resource-level access checks (only checks authentication, not authorization)
- Admin/saksbehandler endpoints without RBAC
- Horizontal privilege escalation between NAV offices
- Service account with overly broad GCP IAM roles
Detection patterns:
A — Abuse (Business Logic Exploitation)
Can an attacker misuse legitimate functionality?
Nav-specific threats:
- Duplicate søknad submissions (missing idempotency)
- Bypassing validation flows by calling downstream APIs directly
- Automated scraping of public-facing APIs
- Manipulating sequential workflow steps (skipping required stages)
- Mass data harvesting through enumeration attacks
Detection patterns:
Step 4: Risk Assessment
Rate each identified threat using severity levels:
| Severity | Description | Criteria | |
|---|---|---|---|
| Critical | Immediate exploitation risk | PII breach, auth bypass, data corruption at scale | |
| High | Significant impact if exploited | IDOR, missing access control, unvalidated input on sensitive endpoints | |
| Medium | Moderate impact, requires conditions | Missing rate limiting, verbose error messages, broad Kafka ACLs | |
| Low | Minimal impact or unlikely | Missing HSTS headers, informational log leakage |
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/threat-model/SKILL.md
Popularity
- Repository stars
- 53
- Repository forks
- 13
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/navikt/copilot/threat-model)