diff --git a/.github/scripts/Test-RepoSanitized.ps1 b/.github/scripts/Test-RepoSanitized.ps1 index 2edf3de..3efdded 100644 --- a/.github/scripts/Test-RepoSanitized.ps1 +++ b/.github/scripts/Test-RepoSanitized.ps1 @@ -107,11 +107,7 @@ $placeholderDomains = @( ) $placeholderTenantLabels = @( 'contoso', 'fabrikam', 'tenant', 'tenantname', 'yourtenant', 'your-tenant', 'mytenant', - 'example', 'yourorg', 'org', 'company', 'yourcompany', 'tenantid', 'tenant-name' -) -$placeholderLocalParts = @( - 'user', 'username', 'admin', 'someone', 'name', 'upn', 'firstname.lastname', - 'first.last', 'john.doe', 'jane.doe', 'jdoe', 'you', 'me', 'noreply', 'no-reply' + 'example', 'yourorg', 'org', 'company', 'yourcompany', 'tenantid', 'tenant-name', 'label' ) #endregion Configuration @@ -223,7 +219,8 @@ $rules = @( }, @{ Name = 'SecretAssignment' - Pattern = '(?i)\b(?client[_-]?secret|app[_-]?secret|api[_-]?key|access[_-]?token|refresh[_-]?token|sas[_-]?token|account[_-]?key|connection[_-]?string|password|passwd|pwd)\b\s*[:=]\s*["'']?(?[^\s"''`,;]{12,})' + # Matches key = value, key: value and the JSON form "key": "value". + Pattern = '(?i)\b(?client[_-]?secret|app[_-]?secret|api[_-]?key|access[_-]?token|refresh[_-]?token|sas[_-]?token|account[_-]?key|connection[_-]?string|password|passwd|pwd|pre[_-]?shared[_-]?key|shared[_-]?secret|proxy[_-]?password|passphrase|psk)\b["'']?\s*[:=]\s*["'']?(?[^\s"''`,;]{12,})' Scope = $null Message = 'Secret assigned as a literal value. Use a placeholder and document the app registration / Key Vault pattern instead.' Validate = { param($m) -not (Test-IsPlaceholderValue $m.Groups['v'].Value) } @@ -243,26 +240,30 @@ $rules = @( }, @{ Name = 'TenantDomain' - Pattern = '(?i)\b(?