|
7 | 7 | "allowRules": [ |
8 | 8 | { |
9 | 9 | "description": "Avoiding TF resource access", |
10 | | - "regex": "(?i)['\"]?password['\"]?\\s*=\\s*(([a-zA-z_]+(.))?[a-zA-z_]+\\s*(.)\\s*[a-zA-z_]+(.)[a-zA-z_]+)?(\\s*:\\s*null|null)$" |
| 10 | + "regex": "(?i)['\"]?password['\"]?\\s*[:=]\\s*(([a-zA-Z_]+(\\[([a-zA-Z_]+\\.[a-zA-Z_]+.*|\\d+)\\])?\\.[a-zA-Z_]+(\\[([a-zA-Z_]+\\.[a-zA-Z_]+.*|\\d+)\\])?)\\s*([\\[\\.\\)\\]\\}\\$]|(:\\s*null))|null)" |
11 | 11 | }, |
12 | 12 | { |
13 | 13 | "description": "Avoiding description field", |
14 | 14 | "regex": "(?i)['\"]?description['\"]?\\s*=\\s*['\"].*['\"]" |
15 | 15 | }, |
16 | 16 | { |
17 | 17 | "description": "Avoiding Terraform 'optional' statement", |
18 | | - "regex": "(?i)['\"]?password['\"]?\\s*=\\s*optional\\((string|number|sensitive\\(string\\)|map\\(string\\)|set\\(string\\)|any)\\)$" |
| 18 | + "regex": "(?i)['\"]?password['\"]?\\s*=\\s*optional\\((string|number|sensitive\\(string\\)|map\\(string\\)|set\\(string\\)|any)\\)$" |
19 | 19 | }, |
20 | 20 | { |
21 | 21 | "description": "Avoiding Terraform 'try' statement", |
|
29 | 29 | "description": "Avoiding Ansible playbook update_password", |
30 | 30 | "regex": "['\"]?update_password['\"]?\\s*[:=]\\s*['\"]?([A-Za-z0-9/~^_!@&%()=?*+-.]{4,})['\"]?" |
31 | 31 | }, |
32 | | - { |
33 | | - "description": "Allow passwords retrieved from Terraform data sources", |
34 | | - "regex": "(?i)['\"]?password['\"]?\\s*=\\s*data\\.azurerm_key_vault_secret\\.[A-Za-z0-9_]+\\.value" |
35 | | - }, |
36 | | - { |
37 | | - "description": "Allow passwords retrieved from AWS KMS Secrets", |
38 | | - "regex": "(?i)['\"]?password['\"]?\\s*=\\s*data\\.aws_kms_secrets\\.[A-Za-z0-9_]+\\.plaintext\\[\"[A-Za-z0-9_]+\"\\]" |
39 | | - }, |
40 | 32 | { |
41 | 33 | "description": "Allow placeholders", |
42 | 34 | "regex": "(?i)['\"]?password['\"]?\\s*[:=]\\s*['\"](\\$\\(|\\$?\\{\\{)\\s*\\w+\\s*(\\)|\\}\\})['\"]" |
|
70 | 62 | }, |
71 | 63 | { |
72 | 64 | "description": "Avoiding TF resource access", |
73 | | - "regex": "(?i)['\"]?secret[_]?(key)?['\"]?\\s*=\\s*([a-zA-z_]+(.))?[a-zA-z_]+(.)[a-zA-z_]+(.)[a-zA-z_]+" |
| 65 | + "regex": "(?i)['\"]?secret[_]?(key)?['\"]?\\s*[:=]\\s*(([a-zA-Z_]+(\\[([a-zA-Z_]+\\.[a-zA-Z_]+.*|\\d+)\\])?\\.[a-zA-Z_]+(\\[([a-zA-Z_]+\\.[a-zA-Z_]+.*|\\d+)\\])?)\\s*([\\.\\)\\]\\$]|(:\\s*null))|null)" |
74 | 66 | }, |
75 | 67 | { |
76 | 68 | "description": "Avoiding Secrets Manager arn", |
|
83 | 75 | { |
84 | 76 | "description": "Avoiding Secrets from Azure Key Vault", |
85 | 77 | "regex": "(?i)['\"]?secret[_]?(key)?['\"]?\\s*(:|=)\\s*['\"]?[${]+[A-Za-z0-9/~^_!@&%()=?*+-]+}?" |
86 | | - }, |
| 78 | + }, |
87 | 79 | { |
88 | 80 | "description": "Allow secret retrieved from ARM parameters", |
89 | 81 | "regex": "(?i)['\"]?secret[_]?(key)?['\"]?\\s*[:=]\\s*['\"]?\\[\\s*parameters\\(['\"][a-zA-Z][a-zA-Z0-9_-]*['\"]\\s*\\)\\s*\\]" |
90 | | - }, |
| 82 | + }, |
91 | 83 | { |
92 | 84 | "description": "Allow secrets retrieved from Bicep getSecret built in function", |
93 | 85 | "regex": "(?i)['\"]?secret[_]?(key|value)?['\"]?\\s*(:|=)\\s*[a-zA-Z]*\\.getSecret\\(\\s*[\"']([A-Za-z0-9/~^_!@#&%(){};=?*+-<>,:;[\\]%$]+)[\"']\\)" |
|
0 commit comments