narvy-cli 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. narvy/__init__.py +3 -0
  2. narvy/android/__init__.py +0 -0
  3. narvy/android/source_analyzer.py +268 -0
  4. narvy/android/split_bundle.py +475 -0
  5. narvy/android_rule_context.py +196 -0
  6. narvy/apk_memory_preflight.py +248 -0
  7. narvy/auth.py +40 -0
  8. narvy/ci_templates/bitbucket.yml +25 -0
  9. narvy/ci_templates/github.yml +60 -0
  10. narvy/ci_templates/gitlab.yml +32 -0
  11. narvy/cloud/__init__.py +0 -0
  12. narvy/cloud/aws_scan.py +1188 -0
  13. narvy/comment_filter.py +134 -0
  14. narvy/crypto_taint_lite.py +82 -0
  15. narvy/decompiler.py +337 -0
  16. narvy/doctor.py +244 -0
  17. narvy/host/__init__.py +0 -0
  18. narvy/host/audit.py +157 -0
  19. narvy/host/host_knowledge.py +982 -0
  20. narvy/host/lynis_bootstrap.py +400 -0
  21. narvy/host/lynis_parser.py +358 -0
  22. narvy/host/narvy_checks.py +789 -0
  23. narvy/host/report.py +69 -0
  24. narvy/host/ssh_exec.py +219 -0
  25. narvy/ios/__init__.py +0 -0
  26. narvy/ios/binary_analyzer.py +1201 -0
  27. narvy/ios/plist_checks.py +249 -0
  28. narvy/ios/source_analyzer.py +301 -0
  29. narvy/ios/third_party_filter.py +242 -0
  30. narvy/ios/trust_all_context.py +66 -0
  31. narvy/main.py +1983 -0
  32. narvy/native_hardening.py +503 -0
  33. narvy/reporter.py +151 -0
  34. narvy/rule_engine.py +57 -0
  35. narvy/rules/android/config.yml +77 -0
  36. narvy/rules/android/crypto.yml +34 -0
  37. narvy/rules/android/secrets.yml +161 -0
  38. narvy/rules/android/storage.yml +24 -0
  39. narvy/rules/android/webview.yml +23 -0
  40. narvy/rules/android.yml +219 -0
  41. narvy/rules/ios/objc/crypto.yml +56 -0
  42. narvy/rules/ios/objc/network.yml +67 -0
  43. narvy/rules/ios/objc/secrets.yml +79 -0
  44. narvy/rules/ios/objc/storage.yml +45 -0
  45. narvy/rules/ios/objc/webview.yml +45 -0
  46. narvy/rules/ios_swift.yml +327 -0
  47. narvy/rules/web/go.yml +2837 -0
  48. narvy/rules/web/java.yml +1576 -0
  49. narvy/rules/web/javascript.yml +3683 -0
  50. narvy/rules/web/kotlin.yml +413 -0
  51. narvy/rules/web/local/csharp_narvy/config.yml +61 -0
  52. narvy/rules/web/local/csharp_narvy/crypto.yml +64 -0
  53. narvy/rules/web/local/csharp_narvy/deserialization.yml +59 -0
  54. narvy/rules/web/local/csharp_narvy/injection.yml +122 -0
  55. narvy/rules/web/local/csharp_narvy/xxe.yml +48 -0
  56. narvy/rules/web/local/java_narvy/auth_jwt.yml +134 -0
  57. narvy/rules/web/local/java_narvy/deserialization.yml +108 -0
  58. narvy/rules/web/local/java_narvy/mybatis.yml +39 -0
  59. narvy/rules/web/local/java_narvy/snakeyaml.yml +34 -0
  60. narvy/rules/web/local/java_narvy/spring_authz.yml +32 -0
  61. narvy/rules/web/local/java_narvy/spring_config.yml +67 -0
  62. narvy/rules/web/local/java_narvy/spring_hardening.yml +291 -0
  63. narvy/rules/web/local/java_narvy/sqli.yml +235 -0
  64. narvy/rules/web/local/java_narvy/xxe.yml +212 -0
  65. narvy/rules/web/php.yml +1644 -0
  66. narvy/rules/web/python.yml +3967 -0
  67. narvy/rules/web/ruby.yml +703 -0
  68. narvy/rules/web/rust.yml +258 -0
  69. narvy/rules/web/secrets.yml +1420 -0
  70. narvy/rules/web/secrets_supplement.yml +383 -0
  71. narvy/sca/__init__.py +1 -0
  72. narvy/sca/android_deps.py +349 -0
  73. narvy/sca/ios_deps.py +578 -0
  74. narvy/sca/osv_client.py +617 -0
  75. narvy/sca/web_deps.py +955 -0
  76. narvy/scope_config.py +195 -0
  77. narvy/semgrep_engine.py +219 -0
  78. narvy/stack_protector_evidence.py +96 -0
  79. narvy/third_party_filter.py +211 -0
  80. narvy/uploader.py +92 -0
  81. narvy/weak_prng_context.py +270 -0
  82. narvy/web/__init__.py +0 -0
  83. narvy/web/nuclei_binary.py +105 -0
  84. narvy/web/scan_blocklist.py +96 -0
  85. narvy/web/scanner.py +842 -0
  86. narvy/web/source_analyzer.py +714 -0
  87. narvy/web/ssrf_guard.py +374 -0
  88. narvy_cli-1.0.0.dist-info/METADATA +165 -0
  89. narvy_cli-1.0.0.dist-info/RECORD +93 -0
  90. narvy_cli-1.0.0.dist-info/WHEEL +5 -0
  91. narvy_cli-1.0.0.dist-info/entry_points.txt +2 -0
  92. narvy_cli-1.0.0.dist-info/licenses/LICENSE +202 -0
  93. narvy_cli-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,383 @@
1
+ # Additional credential patterns not covered by secrets.yml.
2
+ # Loaded for every stack.
3
+
4
+ rules:
5
+
6
+ - id: narvy.secrets.github-pat-classic
7
+ pattern-regex: \bghp_[A-Za-z0-9]{36,}\b
8
+ languages:
9
+ - regex
10
+ message: >
11
+ GitHub Classic Personal Access Token detected (ghp_...). This token grants
12
+ direct API access to GitHub repositories and should never be hardcoded.
13
+ Rotate it immediately and store in an environment variable or secret manager.
14
+ severity: ERROR
15
+ metadata:
16
+ cwe:
17
+ - 'CWE-798: Use of Hard-coded Credentials'
18
+ owasp:
19
+ - A07:2021 - Identification and Authentication Failures
20
+ - A07:2025 - Authentication Failures
21
+ category: security
22
+ technology:
23
+ - secrets
24
+ - github
25
+ confidence: HIGH
26
+ subcategory:
27
+ - vuln
28
+ likelihood: HIGH
29
+ impact: HIGH
30
+ vulnerability_class:
31
+ - Hard-coded Secrets
32
+ source: narvy-local
33
+ paths:
34
+ exclude:
35
+ - '*.svg'
36
+ - '*go.sum'
37
+ - '*package-lock.json'
38
+ - '*yarn.lock'
39
+ - '*Podfile.lock'
40
+ - '*cargo.lock'
41
+ - '*pnpm-lock*'
42
+
43
+ - id: narvy.secrets.github-pat-fine-grained
44
+ pattern-regex: \bgithub_pat_[A-Za-z0-9_]{59,}\b
45
+ languages:
46
+ - regex
47
+ message: >
48
+ GitHub Fine-Grained Personal Access Token detected (github_pat_...).
49
+ This modern PAT format grants scoped repository access. Rotate immediately
50
+ and use environment variables or a secret manager.
51
+ severity: ERROR
52
+ metadata:
53
+ cwe:
54
+ - 'CWE-798: Use of Hard-coded Credentials'
55
+ owasp:
56
+ - A07:2021 - Identification and Authentication Failures
57
+ - A07:2025 - Authentication Failures
58
+ category: security
59
+ technology:
60
+ - secrets
61
+ - github
62
+ confidence: HIGH
63
+ subcategory:
64
+ - vuln
65
+ likelihood: HIGH
66
+ impact: HIGH
67
+ vulnerability_class:
68
+ - Hard-coded Secrets
69
+ source: narvy-local
70
+
71
+ - id: narvy.secrets.github-oauth-token
72
+ pattern-regex: \bgho_[A-Za-z0-9]{36,}\b
73
+ languages:
74
+ - regex
75
+ message: >
76
+ GitHub OAuth Access Token detected (gho_...). This token provides OAuth
77
+ app access to GitHub. Rotate it immediately and store securely.
78
+ severity: ERROR
79
+ metadata:
80
+ cwe:
81
+ - 'CWE-798: Use of Hard-coded Credentials'
82
+ owasp:
83
+ - A07:2021 - Identification and Authentication Failures
84
+ - A07:2025 - Authentication Failures
85
+ category: security
86
+ technology:
87
+ - secrets
88
+ - github
89
+ confidence: HIGH
90
+ subcategory:
91
+ - vuln
92
+ likelihood: HIGH
93
+ impact: HIGH
94
+ vulnerability_class:
95
+ - Hard-coded Secrets
96
+ source: narvy-local
97
+ paths:
98
+ exclude:
99
+ - '*.svg'
100
+ - '*go.sum'
101
+ - '*package-lock.json'
102
+ - '*yarn.lock'
103
+ - '*Podfile.lock'
104
+ - '*cargo.lock'
105
+
106
+ - id: narvy.secrets.github-app-tokens
107
+ pattern-either:
108
+ - pattern-regex: \bghu_[A-Za-z0-9]{36,}\b
109
+ - pattern-regex: \bghs_[A-Za-z0-9]{36,}\b
110
+ - pattern-regex: \bghr_[A-Za-z0-9]{36,}\b
111
+ languages:
112
+ - regex
113
+ message: >
114
+ GitHub App token detected (ghu_/ghs_/ghr_ prefix). These tokens are issued
115
+ by GitHub Apps for user-to-server, server-to-server, or refresh flows.
116
+ They must not appear in source code. Rotate immediately.
117
+ severity: ERROR
118
+ metadata:
119
+ cwe:
120
+ - 'CWE-798: Use of Hard-coded Credentials'
121
+ owasp:
122
+ - A07:2021 - Identification and Authentication Failures
123
+ - A07:2025 - Authentication Failures
124
+ category: security
125
+ technology:
126
+ - secrets
127
+ - github
128
+ confidence: HIGH
129
+ subcategory:
130
+ - vuln
131
+ likelihood: HIGH
132
+ impact: HIGH
133
+ vulnerability_class:
134
+ - Hard-coded Secrets
135
+ source: narvy-local
136
+ paths:
137
+ exclude:
138
+ - '*.svg'
139
+ - '*go.sum'
140
+ - '*package-lock.json'
141
+ - '*yarn.lock'
142
+ - '*Podfile.lock'
143
+ - '*cargo.lock'
144
+
145
+ - id: narvy.secrets.gitlab-pat
146
+ pattern-regex: \bglpat-[A-Za-z0-9_-]{20,}\b
147
+ languages:
148
+ - regex
149
+ message: >
150
+ GitLab Personal Access Token detected (glpat-...). This token grants API
151
+ access to GitLab projects. Rotate immediately and store in an environment
152
+ variable or secret manager.
153
+ severity: ERROR
154
+ metadata:
155
+ cwe:
156
+ - 'CWE-798: Use of Hard-coded Credentials'
157
+ owasp:
158
+ - A07:2021 - Identification and Authentication Failures
159
+ - A07:2025 - Authentication Failures
160
+ category: security
161
+ technology:
162
+ - secrets
163
+ - gitlab
164
+ confidence: HIGH
165
+ subcategory:
166
+ - vuln
167
+ likelihood: HIGH
168
+ impact: HIGH
169
+ vulnerability_class:
170
+ - Hard-coded Secrets
171
+ source: narvy-local
172
+ paths:
173
+ exclude:
174
+ - '*.svg'
175
+ - '*go.sum'
176
+ - '*package-lock.json'
177
+ - '*yarn.lock'
178
+ - '*Podfile.lock'
179
+ - '*cargo.lock'
180
+
181
+ - id: narvy.secrets.openai-api-key
182
+ pattern-either:
183
+ - pattern-regex: \bsk-[A-Za-z0-9]{32,}\b
184
+ - pattern-regex: \bsk-proj-[A-Za-z0-9]{32,}\b
185
+ languages:
186
+ - regex
187
+ message: >
188
+ OpenAI API Key detected (sk-... or sk-proj-...). This key allows billing
189
+ charges and access to OpenAI models. Rotate immediately via the OpenAI
190
+ dashboard and store in an environment variable.
191
+ severity: ERROR
192
+ metadata:
193
+ cwe:
194
+ - 'CWE-798: Use of Hard-coded Credentials'
195
+ owasp:
196
+ - A07:2021 - Identification and Authentication Failures
197
+ - A07:2025 - Authentication Failures
198
+ category: security
199
+ technology:
200
+ - secrets
201
+ - openai
202
+ confidence: HIGH
203
+ subcategory:
204
+ - vuln
205
+ likelihood: HIGH
206
+ impact: HIGH
207
+ vulnerability_class:
208
+ - Hard-coded Secrets
209
+ source: narvy-local
210
+ paths:
211
+ exclude:
212
+ - '*.svg'
213
+ - '*go.sum'
214
+ - '*package-lock.json'
215
+ - '*yarn.lock'
216
+ - '*Podfile.lock'
217
+ - '*cargo.lock'
218
+ - '*.test.*'
219
+ - '*_test.*'
220
+ - '*test_*'
221
+
222
+ - id: narvy.secrets.npm-access-token
223
+ pattern-regex: \bnpm_[A-Za-z0-9]{36,}\b
224
+ languages:
225
+ - regex
226
+ message: >
227
+ npm Access Token detected (npm_...). This token allows publishing packages
228
+ to the npm registry under your account. Rotate immediately and store in
229
+ CI/CD secrets or environment variables.
230
+ severity: ERROR
231
+ metadata:
232
+ cwe:
233
+ - 'CWE-798: Use of Hard-coded Credentials'
234
+ owasp:
235
+ - A07:2021 - Identification and Authentication Failures
236
+ - A07:2025 - Authentication Failures
237
+ category: security
238
+ technology:
239
+ - secrets
240
+ - npm
241
+ confidence: HIGH
242
+ subcategory:
243
+ - vuln
244
+ likelihood: HIGH
245
+ impact: HIGH
246
+ vulnerability_class:
247
+ - Hard-coded Secrets
248
+ source: narvy-local
249
+ paths:
250
+ exclude:
251
+ - '*.svg'
252
+ - '*go.sum'
253
+ - '*package-lock.json'
254
+ - '*yarn.lock'
255
+ - '*Podfile.lock'
256
+ - '*cargo.lock'
257
+
258
+ - id: narvy.secrets.sendgrid-api-key
259
+ pattern-regex: \bSG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}\b
260
+ languages:
261
+ - regex
262
+ message: >
263
+ SendGrid API Key detected (SG.<22>.<43>). This key allows sending emails
264
+ from your SendGrid account. Rotate immediately via the SendGrid dashboard.
265
+ severity: ERROR
266
+ metadata:
267
+ cwe:
268
+ - 'CWE-798: Use of Hard-coded Credentials'
269
+ owasp:
270
+ - A07:2021 - Identification and Authentication Failures
271
+ - A07:2025 - Authentication Failures
272
+ category: security
273
+ technology:
274
+ - secrets
275
+ - sendgrid
276
+ confidence: HIGH
277
+ subcategory:
278
+ - vuln
279
+ likelihood: HIGH
280
+ impact: HIGH
281
+ vulnerability_class:
282
+ - Hard-coded Secrets
283
+ source: narvy-local
284
+ paths:
285
+ exclude:
286
+ - '*.svg'
287
+ - '*go.sum'
288
+ - '*package-lock.json'
289
+ - '*yarn.lock'
290
+ - '*Podfile.lock'
291
+ - '*cargo.lock'
292
+
293
+ - id: narvy.secrets.google-api-key
294
+ pattern-regex: \bAIza[0-9A-Za-z_-]{35}\b
295
+ languages:
296
+ - regex
297
+ message: >
298
+ Google API Key detected (AIza...). This key may enable access to Google
299
+ Maps, Firebase, Cloud APIs, or other Google services. Restrict it in the
300
+ Google Cloud Console and store in environment variables.
301
+ severity: ERROR
302
+ metadata:
303
+ cwe:
304
+ - 'CWE-798: Use of Hard-coded Credentials'
305
+ owasp:
306
+ - A07:2021 - Identification and Authentication Failures
307
+ - A07:2025 - Authentication Failures
308
+ category: security
309
+ technology:
310
+ - secrets
311
+ - google
312
+ - firebase
313
+ confidence: HIGH
314
+ subcategory:
315
+ - vuln
316
+ likelihood: HIGH
317
+ impact: HIGH
318
+ vulnerability_class:
319
+ - Hard-coded Secrets
320
+ source: narvy-local
321
+ paths:
322
+ exclude:
323
+ - '*.svg'
324
+ - '*go.sum'
325
+ - '*package-lock.json'
326
+ - '*yarn.lock'
327
+ - '*Podfile.lock'
328
+ - '*cargo.lock'
329
+ - '*.xcscmblueprint'
330
+
331
+ - id: narvy.secrets.generic-high-entropy-assignment
332
+ patterns:
333
+ - pattern-regex: (?i)(?:(?:api_?|secret_?|private_?|client_?|auth_?|access_?)?(?:key|secret|token|password|passwd))\s*[=:]\s*["'`](?P<SECRET>[A-Za-z0-9+/=_\-]{20,})["'`]
334
+ - pattern-not-regex: (?i)(?:example|sample|test|fake|placeholder|dummy|changeme|your_|replace|xxxx|todo|fixme|\$\{|\$\(|%[A-Z])
335
+ - pattern-not-regex: (?i)(?:https?://|jdbc:|mongodb://|redis://|postgres://)
336
+ - pattern-not-regex: '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'
337
+ - metavariable-analysis:
338
+ analyzer: entropy
339
+ metavariable: $SECRET
340
+ languages:
341
+ - regex
342
+ message: >
343
+ High-entropy value assigned to a sensitive variable name detected. This
344
+ pattern matches hardcoded secrets (API keys, passwords, tokens) based on
345
+ both variable naming context and Shannon entropy of the value. Review and
346
+ move this secret to an environment variable or secret manager.
347
+ severity: WARNING
348
+ metadata:
349
+ cwe:
350
+ - 'CWE-798: Use of Hard-coded Credentials'
351
+ - 'CWE-321: Use of Hard-coded Cryptographic Key'
352
+ owasp:
353
+ - A07:2021 - Identification and Authentication Failures
354
+ - A07:2025 - Authentication Failures
355
+ category: security
356
+ technology:
357
+ - secrets
358
+ confidence: MEDIUM
359
+ subcategory:
360
+ - audit
361
+ likelihood: MEDIUM
362
+ impact: HIGH
363
+ vulnerability_class:
364
+ - Hard-coded Secrets
365
+ source: narvy-local
366
+ paths:
367
+ exclude:
368
+ - '*.svg'
369
+ - '*go.sum'
370
+ - '*package-lock.json'
371
+ - '*yarn.lock'
372
+ - '*Podfile.lock'
373
+ - '*cargo.lock'
374
+ - '*pnpm-lock*'
375
+ - '*.xcscmblueprint'
376
+ - '*.min.js'
377
+ - '*bundle.js'
378
+ - '*vendor/*'
379
+ - '*node_modules/*'
380
+ - '*test*'
381
+ - '*spec*'
382
+ - '*mock*'
383
+ - '*fixture*'
narvy/sca/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Software Composition Analysis: third-party dependency CVE scanning."""