defaults/mask-rules.psd1
|
@{ # What is replaced in a copy before it is kept. Each rule is a name, a pattern and what stands in its place # (by default [masked:<name>]). A replacement never holds a quote or a backslash, so a line of JSON stays a line of JSON. # Pass your own file to Save-PCContinuity -MaskRules to add to or replace these; the keys are Name, Pattern and Replace. Schema = 'powercraft.continuity.mask-rules/1.0' Rules = @( @{ Name = 'private-key'; Pattern = '-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----' } @{ Name = 'github-token'; Pattern = '\b(?:gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9_]{50,})' } @{ Name = 'anthropic-key'; Pattern = '\bsk-ant-[A-Za-z0-9_-]{20,}' } @{ Name = 'api-key'; Pattern = '\bsk-(?:proj-)?[A-Za-z0-9_-]{32,}' } @{ Name = 'aws-access-key'; Pattern = '\b(?:AKIA|ASIA)[0-9A-Z]{16}\b' } @{ Name = 'slack-token'; Pattern = '\bxox[abprs]-[A-Za-z0-9-]{10,}' } @{ Name = 'google-api-key'; Pattern = '\bAIza[0-9A-Za-z_-]{35}' } @{ Name = 'web-token'; Pattern = '\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}' } @{ Name = 'bearer'; Pattern = '(?i)\b(Bearer\s+)[A-Za-z0-9._~+/-]{20,}=*'; Replace = '$1[masked:bearer]' } @{ Name = 'connection-password'; Pattern = '(?i)([;"'']\s*(?:Password|Pwd)\s*=\s*)[^;"''\\\s\[]{4,}'; Replace = '$1[masked:connection-password]' } @{ Name = 'secret'; Pattern = '(?i)((?:password|passwd|secret|api[_-]?key|access[_-]?key|client[_-]?secret|auth[_-]?token)\\?["'']?\s*[:=]\s*\\?["''])[^"''\\\s\[\]$<>{}()]{6,}'; Replace = '$1[masked:secret]' } ) } |