security-review
Skill54 starsChanged 3 months agoMITView on GitHub
Bruk før commit, push eller pull request for å sjekke at koden er trygg å merge
187 other projects use a version of this.
Adopted by
Most recently taken up by
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- CaseyLabs/kc-secure-repo-templatetheir own version, first seen Oct 4, 2026
- HMBSbige/skillstheir own version, first seen Oct 3, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- hahuyhungdev/ai-coding-configtheir own version, first seen Oct 2, 2026
Used with
Projects with it also use kotlin-testing, configure-ecc and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tpavanipradeepSkillkotlin-testing
Kotlin testing patterns with Kotest, MockK, coroutine testing, property-based testing, and Kover coverage. Follows TDD methodology with idiomatic Kotlin practices.
Also in 6 projects that use this
saxon-ySkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 12 projects that use this
InfopibeSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 12 projects that use this
InfopibeSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 10 projects that use this
mryeastcodeSkillpytorch-patterns
PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading.
Also in 9 projects that use this
berntpoppSkilldependency-cve-sweep
Use when handling Dependabot PRs, CodeQL/Trivy alerts, or doing a routine dependency/CVE sweep for this repo.
Also in 5 projects that use this
Other versions187 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 187
- github/awesome-copilot★ 40ksame name
- WorldFlowAI/everything-claude-code★ 4ksame name
- compozy/compozy★ 2.8ksame name
- getsentry/sentry-python★ 2.2ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- codeaholicguy/ai-devkit★ 1.6ksame name
- getsentry/skills★ 1ksame name
- microsoft/power-platform-skills★ 961same name
- thesongzhu/Friday★ 837same name
- ktnyt/cclsp★ 675same name
177 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- ai-news-researchSkill
- aksel-builderSkill
- aksel-spacingSkill
- api-designSkill
- conventional-commitSkill
- deliberate-ai-useSkill
- flyway-migrationSkill
- jackson-3-migrationSkill
- java-to-kotlinSkill
- kafkaSkill
- klarsprakSkill
- kotlin-app-configSkill
- ktor-scaffoldSkill
- naisSkill
- nav-architecture-reviewSkill
- nav-authSkill
- nav-deep-interviewSkill
- nav-dekoratorenSkill
- nav-planSkill
- nav-troubleshootSkill
- observability-debuggingSkill
- observability-setupSkill
- playwright-testingSkill
- postgresql-reviewSkill
- readme-reviewSkill
- rust-developmentSkill
- security-owaspSkill
- spring-boot-scaffoldSkill
- terse-modeSkill
- threat-modelSkill
- tokenx-authSkill
- web-design-reviewerSkill
- workstation-securitySkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 78
Only expose what must be exposed:
“Common” is measured: kept by at least 6 in 10 of the 165 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Review Skill
This skill provides pre-commit and pre-PR security checks for Nav applications. Covers secret scanning, vulnerability scanning, and Nav-specific requirements.
For architecture questions, threat modeling, or compliance decisions, use @security-champion instead.
Automated Scans
Run with run_in_terminal:
# Scan repo for known vulnerabilities and secrets
trivy repo .
# Scan Docker image for HIGH/CRITICAL CVEs
trivy image <image-name> --severity HIGH,CRITICAL
# Scan GitHub Actions workflows for insecure patterns
zizmor .github/workflows/
# Quick search for secrets in git history
git log -p --all -S 'password' -- '*.kt' '*.ts' | head -100
git log -p --all -S 'secret' -- '*.kt' '*.ts' | head -100Parameterized SQL (Never Concatenate)
// ✅ Correct – parameterized query
fun findBruker(fnr: String): Bruker? =
jdbcTemplate.queryForObject(
"SELECT * FROM bruker WHERE fnr = ?",
brukerRowMapper,
fnr
)
// ❌ Wrong – SQL injection risk
fun findBrukerUnsafe(fnr: String): Bruker? =
jdbcTemplate.queryForObject(
"SELECT * FROM bruker WHERE fnr = '$fnr'",
brukerRowMapper
)No PII in Logs
// ✅ Correct – log correlation ID, not PII
log.info("Behandler sak for bruker", kv("sakId", sak.id), kv("tema", sak.tema))
// ❌ Wrong – never log FNR, name, or other PII
log.info("Behandler sak for bruker ${bruker.fnr}") // GDPR violation
log.info("Navn: ${bruker.navn}") // GDPR violationSecrets from Environment, Never Hardcoded
// ✅ Correct – read from environment (Nais injects via Secret)
val dbPassword = System.getenv("DB_PASSWORD")
?: throw IllegalStateException("DB_PASSWORD mangler")
// ❌ Wrong – hardcoded secret
val dbPassword = "supersecret123"Network Policy (Nais)
Only expose what must be exposed:
spec:
accessPolicy:
inbound:
rules:
- application: frontend-app # only explicitly named callers
outbound:
rules:
- application: pdl-api
namespace: pdl
cluster: prod-gcp
external:
- host: api.external-service.no # only if strictly necessaryOWASP Top 10 Checks
A01: Broken Access Control
// ✅ Correct — check that user has access to the resource
@GetMapping("/api/vedtak/{id}")
fun getVedtak(@PathVariable id: UUID): ResponseEntity<VedtakDTO> {
val bruker = hentInnloggetBruker()
val vedtak = vedtakService.findById(id)
if (vedtak.brukerId != bruker.id) {
return ResponseEntity.status(HttpStatus.FORBIDDEN).build()
}
return ResponseEntity.ok(vedtak.toDTO())
}
// ❌ Wrong — no access control (IDOR)
@GetMapping("/api/vedtak/{id}")
fun getVedtak(@PathVariable id: UUID) = vedtakService.findById(id)A03: Injection
// ✅ Correct — parameterized query
jdbcTemplate.query("SELECT * FROM bruker WHERE fnr = ?", mapper, fnr)
// ❌ Wrong — string concatenation
jdbcTemplate.query("SELECT * FROM bruker WHERE fnr = '$fnr'", mapper)A05: Security Misconfiguration
// ✅ Correct — CORS only for known domains
@Bean
fun corsFilter() = CorsFilter(CorsConfiguration().apply {
allowedOrigins = listOf("https://my-app.intern.nav.no")
allowedMethods = listOf("GET", "POST")
allowedHeaders = listOf("Authorization", "Content-Type")
})
// ❌ Wrong — open CORS
allowedOrigins = listOf("*")A07: Cross-Site Scripting (XSS)
// ✅ Correct — React escapes automatically
<BodyShort>{bruker.navn}</BodyShort>
// ❌ Wrong — raw HTML injection
<div dangerouslySetInnerHTML={{ __html: userInput }} />A08: Insecure Deserialization
// ✅ Correct — validate input after deserialization
@PostMapping("/api/vedtak")
fun create(@RequestBody @Valid request: CreateVedtakRequest): ResponseEntity<VedtakDTO>
// ✅ Limit Jackson to known types
objectMapper.apply {
activateDefaultTyping(
polymorphicTypeValidator,
ObjectMapper.DefaultTyping.NON_FINAL
)
}A09: Logging & Monitoring
// ✅ Correct — structured logging with correlation ID, no PII
log.info("Vedtak opprettet", kv("vedtakId", vedtak.id), kv("sakId", sak.id))
// ❌ Wrong — PII in logs
log.info("Vedtak for bruker ${bruker.fnr} opprettet")File Upload Security
// ✅ Correct — validate file type, size, and magic bytes
fun validateUpload(file: MultipartFile) {
require(file.size <= 10 * 1024 * 1024) { "File too large (max 10 MB)" }
require(file.contentType in ALLOWED_TYPES) { "Invalid file type" }
val bytes = file.bytes.take(8).toByteArray()
require(verifyMagicBytes(bytes, file.contentType!!)) { "File content does not match type" }
}
private val ALLOWED_TYPES = setOf("application/pdf", "image/png", "image/jpeg")Dependency Management
// build.gradle.kts — pin versions, use BOM
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.1")
}
}
// Check vulnerable dependencies
// ./gradlew dependencyCheckAnalyze
// trivy repo .Expanded Checklist
- SQL queries are parameterized (no string concatenation)
- No PII in logs (fnr, name, address)
- Secrets only from environment/secrets
- Nais accessPolicy is explicit (no open inbound)
- CORS is restricted to known domains
- Input is validated and sanitized
- Access control checks ownership (not just auth)
- File upload validates type, size, and content
- Dependencies are up to date and vulnerability-scanned
- No
dangerouslySetInnerHTMLwithout sanitization
Dependency Management
# Kotlin – check for outdated/vulnerable dependencies
./gradlew dependencyUpdates
./gradlew dependencyCheckAnalyze # OWASP check
# Node/TypeScript
npm audit
npm audit fixSecurity Checklist
- No secrets, tokens, or API keys hardcoded in source
- No PII (FNR, name, address) in log statements
- All SQL queries use parameterized statements
- Nais
accessPolicylimits inbound/outbound to only what is needed - Token validation on all protected endpoints (see
@security-champion) - M2M tokens validate
azpagainstAZURE_APP_PRE_AUTHORIZED_APPS - Auth code matches
.nais/accessPolicy inbound rules (no dead code or missing rules) trivy repo .passes without HIGH/CRITICAL findingszizmorpasses on all GitHub Actions workflows- Git history clean of committed secrets (
git logscan above) - HTTPS enforced – no plain HTTP calls to external services
- Dependencies up to date (
dependencyUpdates/npm audit)
Related
| Resource | Use For |
@security-champion | Threat modeling, compliance questions, Nav security architecture |
$nav-auth | JWT validation, TokenX, ID-porten, Maskinporten |
$nais | Nais manifest, accessPolicy, secrets setup |
| sikkerhet.nav.no | Nav Golden Path, authoritative security guidance |
Review contract
Axes: the Expanded Checklist and the Security Checklist above, plus whatever the automated scans returned.
The review ends here, in this shape. A review with no output section has not run.
Judge primary evidence. The diff, the file, the EXPLAIN output, the rendered page — never your own summary of the change, and never your memory of what you meant to write. Resolve the base first, then cover committed, staged, unstaged and untracked changes. Read untracked files in full: diff output omits them.
Every axis reports. Each axis produces at least one finding, or one line saying what it inspected and what that evidence does not prove. An axis that says nothing has not looked.
Report what you inspected. "No findings in the two files I opened" and "no findings in the change" are different claims, and only the first one is ever true.
Inspected: <files, queries, URLs, viewports actually opened>
Not inspected: <in scope, not examined, and why>
Findings: <n blocking, n concerns>
Verdict: BLOCK | CONCERNS | CLEANBLOCK— at least one finding that, shipped as written, risks data loss, a security or privacy breach, a production incident, or a wrong answer to a user.CONCERNS— no blocking finding, but at least one a maintainer should fix or answer first.CLEAN— every axis inspected against primary evidence, nothing at either bar.CLEANclaims only the axes above and the files on theInspectedline, and it is wrong if a defect is later found in them.
Not a review: LGTM; restating what the change does; cosmetic findings only; reading the changed lines without the code they call.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

