agentleFS
naviktnavikt/copilot/skills/repo-baseline-audit/SKILL.md

repo-baseline-audit

Skill65 starsChanged 17 days agoMITView on GitHub

Sjekk om et GitHub-repo i navikt følger grunnkravene og beste praksis fra navikt/offentlig, Golden Path og sikkerhetsplaybooken (sikkerhet.nav.no), og vanlig GitHub-hygiene som .gitignore og innsjekkede env-filer. Bruk når teamet vil vite hva som mangler i oppsettet av et repo, ikke for å lete etter sårbarheter i koden (bruk appsec-advisory) eller sjekke en endring før commit (bruk security-review)

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write the report in the user's language.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Repo baseline audit

Audit one repository against Nav's baseline and return a checklist report: what is met, what is missing, what could not be verified, and the smallest fix for each gap. This is a read-only configuration and practice audit, not a hunt for vulnerabilities in application logic.

Establish scope

  1. Resolve the target: the current git checkout by default, plus its owner/repo slug for GitHub settings. Work from the repository root.
  2. Detect what the repository contains — ecosystems and lockfiles, Dockerfile, .nais/ or nais.yaml, workflows, frontend code. A rule applies only when its Applies when condition holds; otherwise it is N/A.
  3. Note visibility. Public repositories have stricter README contact requirements; non-public repositories must justify being closed.

Collect evidence

Load the rule catalogue and the evidence commands. Each rule names the evidence [section] it needs. Collect those sections from the repository root. The commands never change the repository or its settings, run in bash, zsh and PowerShell, and never print secret values. A 403 or 404 from GitHub, or a missing tool, makes the rules that depend on it Not verifiable.

Then assess every applicable rule. For rules marked judgment, sample the code directly and cite file:line.

Judge the evidence

  • A scanner hit is a lead, not a verdict. Apply the playbook's own exceptions before reporting. GitHub-owned actions (actions/*, github/*) may use tags, so zizmor's unpinned-uses on them is not a gap.
  • Missing access means Not verifiable, never Gap. Branch protection, collaborators, deploy keys and alert lists often need admin rights.
  • Triage secret hits. Public client keys, test fixtures and examples are common false positives. Report rule, file and short commit SHA only, never the value. Treat anything plausibly real as compromised: it is a Must gap whose fix is rotation, because history rewrites do not undo exposure.
  • Use the effective setting. Org defaults, ecosystem defaults (pnpm, Nais) and settings inherited from rulesets count as met when the evidence shows they apply.
  • Leave out rules that do not exist. A per-repo SECURITY.md is not required; the org-wide policy in navikt/.github covers every repository.

Developer-machine settings belong to workstation-security. Process practices (threat modelling, Trygg nok, pentesting, incident readiness) cannot be proven from a repository; list them once under Ask the team.

Statuses

StatusMeaning
MetEvidence shows the rule is satisfied
PartlySatisfied in some places or by an equivalent the source does not name
GapEvidence shows the rule is not satisfied
Not verifiableThe evidence needed was not accessible; say what would settle it
N/AThe rule's Applies when condition does not hold

Report

Write the report in the user's language. Order gaps by tier (Must before Should before Recommended), then by how easy they are to fix.

Repository:  navikt/example-app @ 1a2b3c4 (public, default branch main)
Collected:   zizmor 1.31; gitleaks 8.30; gh as <user> (no admin)
Summary:     Must 1 gap · Should 3 gaps, 1 partly · Recommended 2 gaps · 3 not verifiable

Gaps
| Rule | Tier | Evidence | Fix |
|---|---|---|---|
| REQ-CODEOWNERS | Must | CODEOWNERS:1 `* @jdoe` | `* @navikt/<team>` |
| GP-GITHUB-PIN | Should | build.yml:24 `nais/docker-build-push@main` | Pin to SHA with `# vX` comment; `gh act pin` |
| HYG-GITIGNORE | Recommended | `.env` not ignored | Add `.env` and `.env.*`, keep `!.env.example` |

Partly:          GP-DEPENDABOT — npm has cooldown, github-actions does not
Not verifiable:  PB-BRANCH-PROTECTION — classic protection needs admin; no rulesets visible
Met:             REQ-LICENSE, REQ-README, PB-SECRET-SCANNING, …
N/A:             GP-DISTROLESS (no Dockerfile)
Ask the team:    threat model, Trygg nok, incident plan

Link each fix to the rule's source. Make changes only when the user asks for fixes after the report; repository settings changes need someone with admin rights.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.