sensitive-data-scan

Scan outputs for secrets, personal data, and compensation data before publishing or sharing — patterns plus a full read, triage, masked findings, re-scan. Use before any output leaves the team, on flagged doc pages, or when merging agents' outputs.

O que é sensitive-data-scan?

sensitive-data-scan is a Claude Code agent skill that scan outputs for secrets, personal data, and compensation data before publishing or sharing — patterns plus a full read, triage, masked findings, re-scan. Use before any output leaves the team, on flagged doc pages, or when merging agents' outputs.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ifundeasy/claude-crew/tree/HEAD/skills/sensitive-data-scan

Installed? Explore more Programação e Desenvolvimento skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Sensitive data scan

Rules

  • Repositories, git history, CI logs, images, and build artifacts: secret-scanning.
  • Never echo a value — not in the report, a message, or memory. Report the location (path:line), rule ID, data type, the rule broken, and a mask: for a secret, at most its public type prefix and its length (ghp_… 40 chars); for personal or compensation data, a type label (<email>, <national ID>, <salary, currency>). Never show characters from the secret part, and never a hash of the value: a hash of a short or structured value can be reversed by trying every candidate.
  • Run Grep in files_with_matches or count mode first; open matching lines only to triage them.
  • Allowed locations come from the orchestrator's data rules: path, audience, and data type. Default when none are given: no secrets anywhere; personal data limited to roles, team names, and role mailboxes; no compensation in money (labour as person-days or FTE). Names a template requires (author, approver) need an explicit rule; otherwise ask once.
  • A hit is a finding until triaged as a false positive with a stated reason. An undecidable hit stays a finding for the owner to confirm.
  • Patterns find candidates; reading finds the rest. Names in evaluations, health remarks, and pay mentioned in a sentence are found by reading.
  • Personal data is defined by the applicable law. Most data protection laws define it broadly as information relating to an identified or identifiable natural person, directly or indirectly, including through an identifier such as a name, an identification number, location data, or an online identifier (for example GDPR Art. 4(1)). Most also set stricter rules for special or sensitive categories such as health, biometric, genetic, criminal record, and children's data, and some add financial data (for example GDPR Art. 9(1)). The orchestrator or legal counsel names the applicable law; this scan finds data and never judges whether processing is lawful.
  • Jurisdiction and language are inputs, not assumptions. The orchestrator supplies the jurisdictions in scope (for their identifier, phone, and currency formats) and the languages of the content (for keyword terms). When none are given, run the international and English patterns, state that local formats and terms were not covered, and ask once.
  • A secret in content that was already committed, shared, or published counts as exposed. Deleting it is not the fix; the owner revokes or rotates it first (secrets-management, leak response).

Surfaces

SurfaceHow
Text: Markdown, CSV, JSON, YAML, HTML, SQL, code samplesPattern sets
Hidden text: HTML comments, front matter, alt text, link targets and query strings, notebook outputs, data URIsPattern sets, then read
PDFs and images (screenshots, diagrams)Read and inspect the visible text
Office files, archives, binariesRequest a text export from the orchestrator; NOT RUN until supplied
File and directory namesGlob

Pattern sets

Ripgrep syntax for the Grep tool; no lookaheads. The rule concepts follow gitleaks: one regex per rule, keyword pre-filters, a minimum Shannon entropy for generic matches (3.5 in its generic-api-key rule), and allowlists for paths and stopwords. Grep cannot compute entropy: judge length, character mix, and context, and record high-entropy hits as candidates. Add the formats the orchestrator supplies (internal host names, employee or customer ID formats, national formats for the jurisdictions in scope). Keyword patterns below are English; extend each with the equivalent terms in the content's languages (for example gaji, rekening in Indonesian; salario, cuenta in Spanish; Gehalt, Konto in German).

Secrets:

  • S1 Private key — BEGIN [A-Z0-9 _-]*PRIVATE KEY — FP: truncated examples in documentation with no key body.
  • S2 Cloud access key ID — \b(AKIA|ASIA|ABIA|ACCA|A3T[A-Z0-9])[A-Z2-7]{16}\b — FP: vendor documentation examples ending in EXAMPLE.
  • S3 Code host token — \b(gh[pousr]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,}) — FP: masked samples such as ghp_xxxx….
  • S4 Chat token or webhook — \bxox[abeoprs]-[A-Za-z0-9-]{10,}|\bxapp-[0-9]-[A-Za-z0-9-]+|hooks\.slack\.com/(services|workflows|triggers)/ — FP: xoxb-your-token style placeholders.
  • S5 JSON Web Token — \bey[A-Za-z0-9_-]{17,}\.ey[A-Za-z0-9_-]{17,}\. — FP: public sample tokens copied from tutorials.
  • S6 Credentials in a URL or connection string — [A-Za-z][A-Za-z0-9+.-]*://[^/\s:@]+:[^/\s@]+@ and (?i)\b(password|pwd)=[^;&\s]+ — FP: placeholders (user:password@, <password>, ${DB_PASSWORD}).
  • S7 Token in a query string or signed URL — (?i)(\?|&)(access_token|token|api_?key|sig|signature|x-amz-signature|x-amz-credential)=[^&\s]{8,} — FP: placeholder values.
  • S8 Keyword assignment — (?i)(passw(or)?d|pwd|secret|token|api[_-]?key|access[_-]?key|client[_-]?secret)["']?\s*[:=]\s*["']?[^"'\s,;]{8,} — FP: references to a secret store (${{ secrets.NAME }}, environment lookups, vault paths), placeholders (changeme, <...>, ***), prose that names a field.
  • S9 Authorization header — (?i)authorization:\s*(bearer|basic|token)\s+[A-Za-z0-9._~+/=-]{12,} — FP: none common; Bearer <token> does not match.
  • S10 High-entropy candidate — [A-Za-z0-9+/_=-]{32,} — FP: checksums in SHA256SUMS and the sources register (source-provenance), commit SHAs, lockfile integrity hashes, UUIDs, long slugs and file names, data URIs, minified code. Noisy by design: run it only on files to publish and triage by context (a keyword nearby, an assignment, a configuration file).

Personal data:

  • P1 Email address — [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,} — FP: reserved example domains (example.com, .example, .test; RFC 2606), SSH remotes ([email protected]), role mailboxes the rules allow.
  • P2 Phone number — international \+[1-9][0-9 ().-]{7,18}[0-9] (E.164 allows at most 15 digits), plus the national formats of the jurisdictions in scope; examples: North America \(?\b[2-9][0-9]{2}\)?[ .-]?[2-9][0-9]{2}[ .-]?[0-9]{4}\b, UK mobile \b07[0-9]{3} ?[0-9]{6}\b, India mobile \b[6-9][0-9]{9}\b, Indonesia mobile \b08[1-9][0-9]{7,11}\b — FP: IDs, version strings, amounts, timestamps, a company switchboard the rules allow.
  • P3 National identity or social security number — the formats of the jurisdictions in scope; examples: US SSN \b[0-9]{3}-[0-9]{2}-[0-9]{4}\b, UK National Insurance number \b[A-Z]{2} ?[0-9]{2} ?[0-9]{2} ?[0-9]{2} ?[A-D]\b, Brazil CPF \b[0-9]{3}\.[0-9]{3}\.[0-9]{3}-[0-9]{2}\b, India Aadhaar \b[2-9][0-9]{3} ?[0-9]{4} ?[0-9]{4}\b, Indonesia NIK \b[0-9]{16}\b — FP: card numbers, order and account IDs, phone numbers, timestamps; confirm with the format's check digit where it has one (CPF check digits, Aadhaar Verhoeff). These example patterns are candidates; confirm each format with the issuing authority's documentation.
  • P4 Payment card number — \b[0-9]{4}[ -]?[0-9]{4}[ -]?[0-9]{4}[ -]?[0-9]{1,7}\b — FP: IDs and long numbers; confirm by length (13–19 digits), issuer prefix, and Luhn check.
  • P5 Bank, tax, or passport identifier — (?i)\b(account (no|number)|iban|swift|bic|routing number|sort code|tax (id|identification number)|vat (id|number)|passport (no|number))\b plus local-language terms, then read the line for a value — FP: field labels in an empty form.
  • P6 Online identifier — \b([0-9]{1,3}\.){3}[0-9]{1,3}\b, plus device, advertising, and cookie IDs the orchestrator names — FP: version numbers; private (RFC 1918) and documentation (RFC 5737) ranges are not personal data but may be infrastructure detail the audience rule excludes.
  • P7 Names of individuals — read: evaluations, per-person tables, assignee and owner columns, transcripts, screenshots, document properties — replace with roles or pseudonymous IDs.
  • P8 Special or sensitive categories — (?i)\b(diagnos\w*|sick leave|medical|disabilit\w*|pregnan\w*|biometric|criminal record|religion|ethnic\w*|trade union|sexual orientation)\b plus local-language terms, then read — FP: technical and product terms (a medical product domain, a key fingerprint).

Compensation:

  • C1 Pay terms — (?i)\b(salar(y|ies)|wages?|payroll|remuneration|compensation|bonus(es)?|take-home|allowance|honorarium)\b plus local-language terms — FP: compensating transactions in software, product bonus features, payroll as a system name without amounts.
  • C2 Rates — (?i)\b(hourly|daily|day|monthly|man-?day|person-?day)\s+(rate|cost)s?\b|\brate card\b|\bcost per (fte|head|hour|day)\b — FP: "daily rate limit".
  • C3 Money next to people — (?i)(\b(USD|EUR|GBP|JPY|CNY|INR|IDR|SGD|AUD|BRL)\b|[$€£¥₹]|\bRp\.?|R\$)\s?[0-9][0-9.,]*, extended with the currencies of the jurisdictions in scope, then read for a person, role, headcount, or FTE in the same row or sentence — FP: cloud costs, prices, budgets, and invoices, which are not compensation.

Triage

OutcomeMeaningRecord
True positiveA real value outside an allowed locationFinding, Critical
AllowedA real value in a location the data rules allowThe rule that allows it; not a finding
False positiveNot a real valueThe reason: example value, placeholder, hash, reference to a store
UndeterminedCannot tell from the contentFinding, Critical, until the owner confirms

Procedure

  1. Scope. Files to publish and their revision; audience and channel; data rules with allowed locations; the applicable law the orchestrator names. For a documentation-audit hand-off, the flagged pages and the kind of data flagged. For DPIA data discovery, the scope comes from privacy-impact-assessment step 3 (schemas, exports, logs, analytics).
  2. Surfaces. Map every file to a row of the surfaces table; request exports for what cannot be read.
  3. Patterns. Run S, P, and C over the scope, plus supplied formats; then open matching lines in the matching files only.
  4. Read. Read every file in scope in full for P7, P8, and C3. For a large estate, read flagged pages in full and state the sample size and selection for the rest.
  5. Triage every hit with the table above.
  6. Report masked findings, each with the rule broken and a proposed fix: remove, replace with a role or pseudonymous ID, aggregate, move to an allowed location, or express labour as person-days or FTE.
  7. Route through the orchestrator: secrets to the secret owner and security; personal data to the data owner, and to legal counsel for specific or special categories or external exposure; compensation to the producer and the finance or HR owner.
  8. Re-scan the fixed revision with the same pattern sets and record the result.

Output

Verdict: PASS (every surface scanned, no finding) | PASS WITH NOTES (no finding; unscanned surfaces accepted by the orchestrator, or allowed data present) | FAIL (any finding, or an unscanned surface not accepted) · Scope and revision · Data rules and their source · Date:

#Location (path:line)RuleData typeMaskRule brokenProposed fixOwner (role)

Coverage: surface | files | method (pattern set, read, export) | result. False positives: location | rule | reason.

Sources: gitleaks README and default configuration (github.com/gitleaks/gitleaks; the README states the project is feature complete and receives security patches only); GitHub token formats (docs.github.com, "About authentication to GitHub"); GDPR Art. 4(1) and 9(1) (gdpr-info.eu) — all accessed 2026-11-28. National identifier and phone patterns are format examples, not verified against each issuing authority.

Quality checklist

  • Every surface in scope was scanned, or is NOT RUN with what unblocks it.
  • All pattern sets and the supplied formats ran; every file was read in full or the sample is stated.
  • Every hit is triaged; every false positive and allowed hit has its reason or rule.
  • No value, partial value, or hash of a value appears in the report, messages, or memory.
  • Every exposed secret is routed for revocation or rotation, not only removal.
  • The fixed revision was re-scanned and the result recorded.

Pitfalls

  • Quoting the secret or the personal data in the finding, so the review report becomes the second leak.
  • Treating a clean pattern run as clean: names in prose, screenshots, and pay mentioned in a sentence need reading.
  • Deleting a committed or shared secret from the file and calling it fixed without revocation or rotation.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

Habilidades Relacionadas