narvy-cli 1.3.0__tar.gz → 1.3.2__tar.gz

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 (131) hide show
  1. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/CHANGELOG.md +120 -0
  2. {narvy_cli-1.3.0/narvy_cli.egg-info → narvy_cli-1.3.2}/PKG-INFO +28 -9
  3. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/README.md +27 -8
  4. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/__init__.py +1 -1
  5. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/auth.py +7 -2
  6. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cbom.py +1 -1
  7. narvy_cli-1.3.2/narvy/ci_templates/bitbucket.yml +35 -0
  8. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ci_templates/github.yml +10 -2
  9. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ci_templates/gitlab.yml +7 -2
  10. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/aws_scan.py +51 -22
  11. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ios/binary_analyzer.py +1 -0
  12. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ios/source_analyzer.py +2 -7
  13. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/main.py +292 -38
  14. narvy_cli-1.3.2/narvy/repo_identity.py +128 -0
  15. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sbom.py +1 -1
  16. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/android_deps.py +4 -2
  17. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/ios_deps.py +17 -4
  18. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/osv_client.py +86 -11
  19. narvy_cli-1.3.2/narvy/sca/severity_calibration.py +320 -0
  20. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/web_deps.py +324 -34
  21. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/secret_presentation.py +39 -10
  22. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/semgrep_engine.py +13 -5
  23. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/uploader.py +18 -2
  24. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/web/source_analyzer.py +32 -6
  25. {narvy_cli-1.3.0 → narvy_cli-1.3.2/narvy_cli.egg-info}/PKG-INFO +28 -9
  26. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy_cli.egg-info/SOURCES.txt +2 -0
  27. narvy_cli-1.3.0/narvy/ci_templates/bitbucket.yml +0 -15
  28. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/LICENSE +0 -0
  29. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/MANIFEST.in +0 -0
  30. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/SECURITY.md +0 -0
  31. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/__main__.py +0 -0
  32. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/android/__init__.py +0 -0
  33. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/android/source_analyzer.py +0 -0
  34. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/android/split_bundle.py +0 -0
  35. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/android_rule_context.py +0 -0
  36. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/apk_memory_preflight.py +0 -0
  37. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/__init__.py +0 -0
  38. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/gcp_scan.py +0 -0
  39. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/normalize.py +0 -0
  40. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/rule_severity.py +0 -0
  41. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/severity.py +0 -0
  42. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/cloud/upload.py +0 -0
  43. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/comment_filter.py +0 -0
  44. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/crypto_taint_lite.py +0 -0
  45. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/decompiler.py +0 -0
  46. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/doctor.py +0 -0
  47. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/gitlab_report.py +0 -0
  48. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/__init__.py +0 -0
  49. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/audit.py +0 -0
  50. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/host_knowledge.py +0 -0
  51. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/lynis_bootstrap.py +0 -0
  52. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/lynis_parser.py +0 -0
  53. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/narvy_checks.py +0 -0
  54. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/report.py +0 -0
  55. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/host/ssh_exec.py +0 -0
  56. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ios/__init__.py +0 -0
  57. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ios/plist_checks.py +0 -0
  58. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ios/third_party_filter.py +0 -0
  59. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/ios/trust_all_context.py +0 -0
  60. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/native_hardening.py +0 -0
  61. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/own_reports.py +0 -0
  62. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/pathhint.py +0 -0
  63. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/pathnorm.py +0 -0
  64. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/proc.py +0 -0
  65. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/reporter.py +0 -0
  66. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rule_engine.py +0 -0
  67. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/android/config.yml +0 -0
  68. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/android/crypto.yml +0 -0
  69. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/android/secrets.yml +0 -0
  70. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/android/storage.yml +0 -0
  71. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/android/webview.yml +0 -0
  72. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/android.yml +0 -0
  73. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/ios/objc/crypto.yml +0 -0
  74. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/ios/objc/network.yml +0 -0
  75. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/ios/objc/secrets.yml +0 -0
  76. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/ios/objc/storage.yml +0 -0
  77. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/ios/objc/webview.yml +0 -0
  78. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/ios_swift.yml +0 -0
  79. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/go.yml +0 -0
  80. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/java.yml +0 -0
  81. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/javascript.yml +0 -0
  82. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/kotlin.yml +0 -0
  83. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/php.yml +0 -0
  84. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/python.yml +0 -0
  85. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/ruby.yml +0 -0
  86. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/rust.yml +0 -0
  87. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/secrets.yml +0 -0
  88. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/rules/web/secrets_supplement.yml +0 -0
  89. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/__init__.py +0 -0
  90. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/osv_localdb.py +0 -0
  91. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/sca/osv_semantic.py +0 -0
  92. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/scope_config.py +0 -0
  93. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/secret_output.py +0 -0
  94. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/secret_value_grade.py +0 -0
  95. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/stack_protector_evidence.py +0 -0
  96. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/__init__.py +0 -0
  97. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/__main__.py +0 -0
  98. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/analyze.py +0 -0
  99. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/__init__.py +0 -0
  100. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/arsc.py +0 -0
  101. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/axml.py +0 -0
  102. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/checks.py +0 -0
  103. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/elf.py +0 -0
  104. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/loader.py +0 -0
  105. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/protoxml.py +0 -0
  106. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/android/xmlmodel.py +0 -0
  107. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/archive.py +0 -0
  108. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/cli.py +0 -0
  109. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/data/__init__.py +0 -0
  110. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/data/apple.py +0 -0
  111. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/data/play.py +0 -0
  112. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/ios/__init__.py +0 -0
  113. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/ios/checks.py +0 -0
  114. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/ios/loader.py +0 -0
  115. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/ios/macho.py +0 -0
  116. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/store_check/model.py +0 -0
  117. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/telemetry.py +0 -0
  118. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/third_party_filter.py +0 -0
  119. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/weak_prng_context.py +0 -0
  120. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/web/__init__.py +0 -0
  121. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/web/nuclei_binary.py +0 -0
  122. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/web/scan_blocklist.py +0 -0
  123. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/web/scanner.py +0 -0
  124. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy/web/ssrf_guard.py +0 -0
  125. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy_cli.egg-info/dependency_links.txt +0 -0
  126. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy_cli.egg-info/entry_points.txt +0 -0
  127. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy_cli.egg-info/requires.txt +0 -0
  128. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/narvy_cli.egg-info/top_level.txt +0 -0
  129. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/pyproject.toml +0 -0
  130. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/setup.cfg +0 -0
  131. {narvy_cli-1.3.0 → narvy_cli-1.3.2}/setup.py +0 -0
@@ -5,6 +5,126 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.2]
9
+
10
+ ### Changed
11
+
12
+ - `scan --upload --fail-on`: findings your team dismissed in Narvy (false
13
+ positive, accepted risk, won't fix) no longer fail the build. The CLI
14
+ reads them from the `dismissed` field of the upload response and prints
15
+ how many it left out. Without `--upload`, or when the server does not
16
+ send that field, the gate uses every local finding as before. A failed
17
+ upload still exits 4 before the gate runs. Reports and the upload itself
18
+ keep every finding.
19
+ - Dependency findings of a source scan get the same severity as on
20
+ narvy.io: the platform's calibration is ported as is
21
+ (`narvy/sca/severity_calibration.py`). A CVE fixed by a release that the
22
+ declared range already admits does not set the severity, and a package
23
+ whose CVEs are all in that case is Low (morgan@1.9.0 with `^1.9.0`: Low,
24
+ was Critical). Also ported: the GitHub-reviewed advisory rating, the
25
+ local or physical attack vector cap (Medium), dev-only dependencies
26
+ (Low) and Go packages whose affected import path is not imported (Low).
27
+ Not ported: the build-only scope (lockfile graph) and the advisory
28
+ preconditions (proxy-addr, ws, nanoid). The advisory's own rating is kept
29
+ in `severity_advisory`, the reasons in `severity_calibration`.
30
+ - `init-ci` templates install `narvy-cli>=1.3.2`. The Bitbucket template
31
+ also runs on pull requests (`pull-requests: '**'`, same step), and
32
+ `init-ci` says when each template runs.
33
+
34
+ ## [1.3.1]
35
+
36
+ ### Added
37
+
38
+ - `scan --upload --app NAME_OR_ID`: adds the results to an existing app.
39
+ Without it, the upload sends the git remote (credentials stripped) and
40
+ branch of the scanned folder when it is the root of a checkout, and the
41
+ platform matches the app on the remote, then on the folder name with and
42
+ without an archive suffix (`-main`, `-<sha>`...).
43
+ - `scans`: App ID column.
44
+ - `scan --upload` prints the app ID and how the platform matched it (package
45
+ id, repository, name, cloud account, `--app`, or new app); no qualifier
46
+ when the platform does not say.
47
+ - `scan app.apk|app.aab|app.ipa --upload` sends the package name from the
48
+ decoded manifest, or CFBundleIdentifier from Info.plist, as `package_id`,
49
+ so the server can match the results to an app with the same package id.
50
+ Source scans send no `package_id`.
51
+ - Dependency findings (SCA) carry `version_source`: `lockfile`,
52
+ `declared_exact` (exact pin in a manifest) or `declared_range` (lower bound
53
+ of a range such as `^0.4.0` in package.json, composer.json or Cargo.toml).
54
+ A `declared_range` finding says the installed version may be newer. The
55
+ platform applies the same default view as for its own scans.
56
+ - Source-scan dependency findings name their manifest or lockfile by its
57
+ path relative to the scanned folder (`backend/package.json`, was
58
+ `package.json`), with `/` separators, never absolute.
59
+ - `scan --upload` sends the dependency check status as
60
+ `summary.sca_coverage` (`complete`, `partial`, `degraded` or `none`).
61
+ The platform closes dependency findings missing from an upload only when
62
+ it is `complete`; no earlier CLI sent it.
63
+ - `NARVY_API_TOKEN` is read as an alias of `NARVY_TOKEN` (used when
64
+ `NARVY_TOKEN` is not set).
65
+ - `init-ci` templates (GitHub, GitLab, Bitbucket): the scan adds `--upload`
66
+ when a `NARVY_TOKEN` secret or variable is set. The comments say that
67
+ `--upload` needs a paid plan. The GitLab template installs `narvy-cli>=1.3.1`. The Bitbucket template
68
+ now caches the OSV database.
69
+
70
+ ### Fixed
71
+
72
+ - A package version declared in several manifests is reported once, on the
73
+ manifest the platform's own scan picks: the first one in a top-down walk
74
+ (the root before its subfolders), unless another one has a stronger
75
+ version proof (lockfile, then exact pin, then range). A lockfile drops
76
+ the manifest versions of its directory and the ones below it that it
77
+ locks, and any declared range there (`package.json`, `composer.json`,
78
+ `Gemfile`), as the platform does.
79
+ - SCA coverage is `degraded` (was `partial`) when results came from a
80
+ stale vulnerability database copy.
81
+ - `scan . --upload` sent "." as the app name; it now sends the directory
82
+ name. The SBOM and CBOM component name had the same issue.
83
+ - `scan --upload` from the root of a git checkout with a remote sends the
84
+ repository name (last path segment of the remote, without `.git`) as the
85
+ app name, not the clone directory: Bitbucket (`build`), Azure Pipelines
86
+ (`s`) and CircleCI (`project`) sent the same name for every repository.
87
+ - A local-path remote (`C:/...`, `\\server\...`, `/srv/...`) or a `file://`
88
+ remote is no longer sent as `git_remote`.
89
+ - `scan --upload` checks the token before the scan: a rejected token
90
+ (401), an account the server refuses (403, with the server's reason,
91
+ for example an expired subscription), a missing login or an unreachable
92
+ server exits 4 before scanning instead of after.
93
+ - After a local scan, a logged-in user is told to add `--upload`, not to
94
+ run `narvy login`.
95
+
96
+ - `cloud-scan` (AWS): a WAF error (regional or global), an S3 bucket ACL
97
+ error, an IAM login profile error, a CIS 1.2 MFA error or a CIS 1.3
98
+ credential report error was logged and dropped, and the scan reported
99
+ `coverage: complete, checks_skipped: 0`. Each one now counts in
100
+ `checks_skipped` with its reason in `coverage.errors`, coverage is
101
+ `partial`, and `--fail-on` exits 2 when nothing else breached.
102
+ - Upload "asset limit reached" (402): says which app it looked for and how to
103
+ target one with `--app`.
104
+ - SCA summary: one count, distinct advisories.
105
+
106
+ ### Changed
107
+
108
+ - Vulnerable-dependency findings name CWE-1395 (Dependency on Vulnerable
109
+ Third-Party Component), with CWE-1035 as secondary, as narvy.io does (was
110
+ CWE-1104). An iOS advisory's own CWE (curated list, GitHub) is kept in
111
+ `sca.advisory_cwe`.
112
+ - Code findings use the same severity mapping as narvy.io: a Semgrep rule
113
+ of severity ERROR is reported HIGH (was CRITICAL), WARNING is MEDIUM (was
114
+ HIGH), INFO is LOW (was MEDIUM). A `--fail-on` threshold therefore trips
115
+ on fewer structural findings than in 1.3.0. Pattern rules and SCA keep
116
+ their own severities.
117
+ - `login`, `scans` and the upload line show the plan by its public name
118
+ (`Pro`, not `titan`).
119
+ - SETUP.md: PyPI install (`pipx install narvy-cli`), `narvy-cli[...]`
120
+ extras, Python 3.10+, `scans` documented as available, exit codes 3 and
121
+ 4, `NARVY_TOKEN` for CI. README: `NARVY_TOKEN` and the OSV cache
122
+ directory (`XDG_CACHE_HOME`, `NARVY_OSV_DB_DIR`).
123
+ - Secret masking, same as the platform: a value of 8 to 19 characters shows
124
+ its first 2 and last 2 characters and the description gives its length
125
+ (fully masked before). Below 8 characters the value stays fully masked;
126
+ from 20 characters, first 4 and last 4 as before.
127
+
8
128
  ## [1.3.0]
9
129
 
10
130
  1.2.2 was not published on its own; its changes ship in 1.3.0.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: narvy-cli
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: Local static security scanner for Android and iOS apps and source code, with offline Google Play and App Store upload checks.
5
5
  Author: Narvy
6
6
  License: Apache-2.0
@@ -116,15 +116,15 @@ Found 19 potential issues:
116
116
  │ HIGH │ Hardcoded Cryptographic IV │ sources/com/android/insecurebankv2/… │ 26, 34 │ 2 │ MEDIUM │
117
117
  │ │ (indirect) │ │ │ │ │
118
118
  │ HIGH │ Application Data Backup is Enabled │ resources/AndroidManifest.xml │ 33 │ 1 │ HIGH │
119
- │ HIGH │ Logging a value that looks like a │ sources/com/android/insecurebankv2/… │ 117 │ 1 │ MEDIUM │
119
+ │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 163, 181 │ 2 │ LOW │
120
+ │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 25, 29 │ 2 │ LOW │
121
+ │ MEDIUM │ Logging a value that looks like a │ sources/com/android/insecurebankv2/… │ 117 │ 1 │ MEDIUM │
120
122
  │ │ credential/token/secret - readable │ │ │ │ │
121
123
  │ │ via adb/crash reporters on many │ │ │ │ │
122
124
  │ │ devices. │ │ │ │ │
123
- │ HIGH │ JavaScript enabled in WebView - can │ sources/com/android/insecurebankv2/… │ 30 │ 1 │ MEDIUM │
125
+ │ MEDIUM │ JavaScript enabled in WebView - can │ sources/com/android/insecurebankv2/… │ 30 │ 1 │ MEDIUM │
124
126
  │ │ enable XSS if untrusted content is │ │ │ │ │
125
127
  │ │ loaded. │ │ │ │ │
126
- │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 163, 181 │ 2 │ LOW │
127
- │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 25, 29 │ 2 │ LOW │
128
128
  └──────────┴──────────────────────────────────────┴──────────────────────────────────────┴─────────────────────┴──────┴────────────┘
129
129
  Scanned the decompiled app with 48 local rules (28 pattern, 2 taint, 18 structural); 9 of them produced findings.
130
130
  ```
@@ -172,7 +172,12 @@ Three other commands work on targets you own, without an app file:
172
172
  | iOS library names | only with `NARVY_GITHUB_ADVISORIES=1` (never with `--offline`) | api.github.com |
173
173
  | JRE and jadx downloads | first APK scan, only if Java 11+ or jadx is missing | api.adoptium.net, github.com |
174
174
  | One anonymous usage event per command (fields listed in [Telemetry](#telemetry)) | every command except `store-check` and `telemetry`, on by default | narvy.io |
175
- | Findings, never code or binary | only with `--upload` (needs `narvy login`) | your Narvy account |
175
+ | Your API token only, to check it (`/api/v1/whoami`) | `scan --upload`, before the scan starts; `narvy login` | narvy.io (or `NARVY_URL`) |
176
+ | Findings, never code or binary | only with `--upload` (needs `narvy login` or `NARVY_TOKEN`) | your Narvy account |
177
+ | With the findings: the app name (the repository name from the git remote, else the folder or file name), the git remote URL with any user, password or token removed (the host is kept), and the branch, when the scanned folder is the root of a git checkout; a local-path or `file://` remote is never sent | only with `scan --upload`, unless `--app` is given | your Narvy account |
178
+ | With the findings of an APK, AAB or IPA: its package id (manifest package or CFBundleIdentifier) | only with `scan --upload` | your Narvy account |
179
+ | With a dependency finding of a source scan: the path of its manifest or lockfile relative to the scanned folder (e.g. `backend/package.json`), never an absolute path | only with `scan --upload` | your Narvy account |
180
+ | With the findings: the dependency check status, one word (`complete`, `partial`, `degraded` or `none`) | only with `scan --upload` | your Narvy account |
176
181
 
177
182
  `scan --offline` sends nothing: no database or tool download, no usage
178
183
  event, no GitHub advisory lookup. If jadx or Java is missing for an APK scan,
@@ -340,10 +345,16 @@ thread), then the scan fails with the numbers. `--force` runs exactly
340
345
  send its results (the findings, never your code or binary) to your account,
341
346
  where they are de-duplicated, false-positive filtered and kept in the
342
347
  dashboard history; the CLI prints a direct link to the scan. This needs a
343
- paid plan (Starter and up) and is never on by default. `narvy upload-all
348
+ paid plan (Solo and up) and is never on by default. `narvy upload-all
344
349
  <directory>` does the same for every binary target found in a folder in one
345
350
  command. `narvy scans` lists recent scans on your account from the terminal.
346
351
 
352
+ In CI, set the token in the `NARVY_TOKEN` environment variable instead of
353
+ running `narvy login` (narvy.io > Profile > API Credentials). It takes
354
+ precedence over a stored login. `NARVY_API_TOKEN` is read as an alias when
355
+ `NARVY_TOKEN` is not set. With `--upload`, the token is checked before the
356
+ scan starts: a rejected token or an unreachable server exits 4 right away.
357
+
347
358
  ### Exit codes
348
359
 
349
360
  | Code | Meaning |
@@ -355,6 +366,11 @@ command. `narvy scans` lists recent scans on your account from the terminal.
355
366
  | 4 | The scan, login, upload or report write failed |
356
367
  | 130 | Interrupted (Ctrl-C, SIGTERM) |
357
368
 
369
+ With `--upload`, `--fail-on` leaves out the findings your team dismissed in
370
+ Narvy (false positive, accepted risk, won't fix), as listed in the upload
371
+ response, and says how many. Without `--upload`, or when the server does
372
+ not return that list, every local finding counts.
373
+
358
374
  `narvy doctor` exits 0 when every required check passes and 1 when one fails.
359
375
  Missing optional tools are shown as INFO and do not change its exit code.
360
376
 
@@ -423,7 +439,8 @@ crates.io, NuGet, SwiftURL), the CLI downloads
423
439
  `https://osv-vulnerabilities.storage.googleapis.com/<ecosystem>/all.zip`.
424
440
  The request names the ecosystem and nothing else: no package name, no code,
425
441
  no path. The file is checked (size, md5, zip integrity), stored as SQLite in
426
- `~/.cache/narvy/osv/` (`NARVY_OSV_DB_DIR` to change it) with a sha256
442
+ `~/.cache/narvy/osv/` (`$XDG_CACHE_HOME/narvy/osv/` when `XDG_CACHE_HOME` is
443
+ set, `NARVY_OSV_DB_DIR` to choose another directory) with a sha256
427
444
  checked on each use, and downloaded again when older than 24 hours.
428
445
 
429
446
  ```bash
@@ -458,7 +475,9 @@ library with no known source repository URL) are counted as unverified.
458
475
  ### CI
459
476
 
460
477
  Cache `~/.cache/narvy/osv` between runs, or every run downloads the
461
- database again. `narvy init-ci --github` and `--gitlab` write this for you.
478
+ database again. `narvy init-ci --github`, `--gitlab` and `--bitbucket` write
479
+ this for you, and add `--upload` to the scan when a `NARVY_TOKEN` secret or
480
+ variable is set (without one the scan stays local).
462
481
 
463
482
  GitHub Actions, one key per UTC day:
464
483
 
@@ -77,15 +77,15 @@ Found 19 potential issues:
77
77
  │ HIGH │ Hardcoded Cryptographic IV │ sources/com/android/insecurebankv2/… │ 26, 34 │ 2 │ MEDIUM │
78
78
  │ │ (indirect) │ │ │ │ │
79
79
  │ HIGH │ Application Data Backup is Enabled │ resources/AndroidManifest.xml │ 33 │ 1 │ HIGH │
80
- │ HIGH │ Logging a value that looks like a │ sources/com/android/insecurebankv2/… │ 117 │ 1 │ MEDIUM │
80
+ │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 163, 181 │ 2 │ LOW │
81
+ │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 25, 29 │ 2 │ LOW │
82
+ │ MEDIUM │ Logging a value that looks like a │ sources/com/android/insecurebankv2/… │ 117 │ 1 │ MEDIUM │
81
83
  │ │ credential/token/secret - readable │ │ │ │ │
82
84
  │ │ via adb/crash reporters on many │ │ │ │ │
83
85
  │ │ devices. │ │ │ │ │
84
- │ HIGH │ JavaScript enabled in WebView - can │ sources/com/android/insecurebankv2/… │ 30 │ 1 │ MEDIUM │
86
+ │ MEDIUM │ JavaScript enabled in WebView - can │ sources/com/android/insecurebankv2/… │ 30 │ 1 │ MEDIUM │
85
87
  │ │ enable XSS if untrusted content is │ │ │ │ │
86
88
  │ │ loaded. │ │ │ │ │
87
- │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 163, 181 │ 2 │ LOW │
88
- │ MEDIUM │ Write to Unscoped External Storage │ sources/com/android/insecurebankv2/… │ 25, 29 │ 2 │ LOW │
89
89
  └──────────┴──────────────────────────────────────┴──────────────────────────────────────┴─────────────────────┴──────┴────────────┘
90
90
  Scanned the decompiled app with 48 local rules (28 pattern, 2 taint, 18 structural); 9 of them produced findings.
91
91
  ```
@@ -133,7 +133,12 @@ Three other commands work on targets you own, without an app file:
133
133
  | iOS library names | only with `NARVY_GITHUB_ADVISORIES=1` (never with `--offline`) | api.github.com |
134
134
  | JRE and jadx downloads | first APK scan, only if Java 11+ or jadx is missing | api.adoptium.net, github.com |
135
135
  | One anonymous usage event per command (fields listed in [Telemetry](#telemetry)) | every command except `store-check` and `telemetry`, on by default | narvy.io |
136
- | Findings, never code or binary | only with `--upload` (needs `narvy login`) | your Narvy account |
136
+ | Your API token only, to check it (`/api/v1/whoami`) | `scan --upload`, before the scan starts; `narvy login` | narvy.io (or `NARVY_URL`) |
137
+ | Findings, never code or binary | only with `--upload` (needs `narvy login` or `NARVY_TOKEN`) | your Narvy account |
138
+ | With the findings: the app name (the repository name from the git remote, else the folder or file name), the git remote URL with any user, password or token removed (the host is kept), and the branch, when the scanned folder is the root of a git checkout; a local-path or `file://` remote is never sent | only with `scan --upload`, unless `--app` is given | your Narvy account |
139
+ | With the findings of an APK, AAB or IPA: its package id (manifest package or CFBundleIdentifier) | only with `scan --upload` | your Narvy account |
140
+ | With a dependency finding of a source scan: the path of its manifest or lockfile relative to the scanned folder (e.g. `backend/package.json`), never an absolute path | only with `scan --upload` | your Narvy account |
141
+ | With the findings: the dependency check status, one word (`complete`, `partial`, `degraded` or `none`) | only with `scan --upload` | your Narvy account |
137
142
 
138
143
  `scan --offline` sends nothing: no database or tool download, no usage
139
144
  event, no GitHub advisory lookup. If jadx or Java is missing for an APK scan,
@@ -301,10 +306,16 @@ thread), then the scan fails with the numbers. `--force` runs exactly
301
306
  send its results (the findings, never your code or binary) to your account,
302
307
  where they are de-duplicated, false-positive filtered and kept in the
303
308
  dashboard history; the CLI prints a direct link to the scan. This needs a
304
- paid plan (Starter and up) and is never on by default. `narvy upload-all
309
+ paid plan (Solo and up) and is never on by default. `narvy upload-all
305
310
  <directory>` does the same for every binary target found in a folder in one
306
311
  command. `narvy scans` lists recent scans on your account from the terminal.
307
312
 
313
+ In CI, set the token in the `NARVY_TOKEN` environment variable instead of
314
+ running `narvy login` (narvy.io > Profile > API Credentials). It takes
315
+ precedence over a stored login. `NARVY_API_TOKEN` is read as an alias when
316
+ `NARVY_TOKEN` is not set. With `--upload`, the token is checked before the
317
+ scan starts: a rejected token or an unreachable server exits 4 right away.
318
+
308
319
  ### Exit codes
309
320
 
310
321
  | Code | Meaning |
@@ -316,6 +327,11 @@ command. `narvy scans` lists recent scans on your account from the terminal.
316
327
  | 4 | The scan, login, upload or report write failed |
317
328
  | 130 | Interrupted (Ctrl-C, SIGTERM) |
318
329
 
330
+ With `--upload`, `--fail-on` leaves out the findings your team dismissed in
331
+ Narvy (false positive, accepted risk, won't fix), as listed in the upload
332
+ response, and says how many. Without `--upload`, or when the server does
333
+ not return that list, every local finding counts.
334
+
319
335
  `narvy doctor` exits 0 when every required check passes and 1 when one fails.
320
336
  Missing optional tools are shown as INFO and do not change its exit code.
321
337
 
@@ -384,7 +400,8 @@ crates.io, NuGet, SwiftURL), the CLI downloads
384
400
  `https://osv-vulnerabilities.storage.googleapis.com/<ecosystem>/all.zip`.
385
401
  The request names the ecosystem and nothing else: no package name, no code,
386
402
  no path. The file is checked (size, md5, zip integrity), stored as SQLite in
387
- `~/.cache/narvy/osv/` (`NARVY_OSV_DB_DIR` to change it) with a sha256
403
+ `~/.cache/narvy/osv/` (`$XDG_CACHE_HOME/narvy/osv/` when `XDG_CACHE_HOME` is
404
+ set, `NARVY_OSV_DB_DIR` to choose another directory) with a sha256
388
405
  checked on each use, and downloaded again when older than 24 hours.
389
406
 
390
407
  ```bash
@@ -419,7 +436,9 @@ library with no known source repository URL) are counted as unverified.
419
436
  ### CI
420
437
 
421
438
  Cache `~/.cache/narvy/osv` between runs, or every run downloads the
422
- database again. `narvy init-ci --github` and `--gitlab` write this for you.
439
+ database again. `narvy init-ci --github`, `--gitlab` and `--bitbucket` write
440
+ this for you, and add `--upload` to the scan when a `NARVY_TOKEN` secret or
441
+ variable is set (without one the scan stays local).
423
442
 
424
443
  GitHub Actions, one key per UTC day:
425
444
 
@@ -1,3 +1,3 @@
1
1
  """Narvy CLI - free, local SAST for Android, iOS and polyglot source."""
2
2
 
3
- __version__ = "1.3.0"
3
+ __version__ = "1.3.2"
@@ -20,9 +20,14 @@ def _env(name):
20
20
  return os.environ.get(f"NARVY_{name}", "").strip()
21
21
 
22
22
 
23
+ def token_from_env():
24
+ """The CI token: NARVY_TOKEN, or NARVY_API_TOKEN (the name the narvy.io cli.sh script reads) as an alias."""
25
+ return _env("TOKEN") or _env("API_TOKEN")
26
+
27
+
23
28
  def load_credentials():
24
- # NARVY_TOKEN overrides the stored file for CI / parallel use.
25
- env_token = _env("TOKEN")
29
+ # NARVY_TOKEN (alias NARVY_API_TOKEN) overrides the stored file for CI / parallel use.
30
+ env_token = token_from_env()
26
31
  if env_token:
27
32
  return {
28
33
  "token": env_token,
@@ -420,7 +420,7 @@ def build_cbom(target: str) -> Tuple[Dict[str, Any], Dict[str, Any]]:
420
420
  "metadata": {
421
421
  "timestamp": _dt.datetime.now(_dt.timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z"),
422
422
  "tools": {"components": [{"type": "application", "name": "narvy-cli", "version": __version__}]},
423
- "component": {"type": "application", "name": os.path.basename(os.path.normpath(target)) or target,
423
+ "component": {"type": "application", "name": os.path.basename(os.path.abspath(target)) or target,
424
424
  "bom-ref": "target"},
425
425
  "properties": meta_props,
426
426
  },
@@ -0,0 +1,35 @@
1
+ # Narvy SAST for Bitbucket Pipelines. Written by `narvy init-ci --bitbucket`; edit freely.
2
+ # Already have a bitbucket-pipelines.yml? Copy the step and the cache definition below into it instead of overwriting.
3
+ # SARIF is kept as a build artifact (not Code Insights); --fail-on still fails the build.
4
+ # With a secured NARVY_TOKEN repository variable (narvy.io > Profile > API Credentials),
5
+ # --upload also sends the findings (never code) to your Narvy dashboard. Without it,
6
+ # the scan stays local. --upload needs a paid plan (Solo and up): on Community it
7
+ # fails the build (exit 4, HTTP 403), so set NARVY_TOKEN only on a paid account.
8
+ # The dependency check downloads the OSV database (npm alone is about 220 MB) into
9
+ # ~/.cache/narvy/osv, cached as narvy-osv. Bitbucket keeps a cache 7 days and does not
10
+ # replace it before then, and saves it only when the step succeeds: the CLI downloads a newer copy when the cached one is older
11
+ # than 24 h, and uses the cached copy if that download fails.
12
+ image: python:3.11
13
+
14
+ definitions:
15
+ caches:
16
+ narvy-osv: ~/.cache/narvy/osv
17
+ steps:
18
+ - step: &narvy-sast
19
+ name: Narvy SAST
20
+ caches:
21
+ - narvy-osv
22
+ script:
23
+ - pip install --upgrade pip
24
+ - pip install "narvy-cli>=1.3.2"
25
+ - narvy scan . --output sarif --file narvy-results.sarif --fail-on high ${NARVY_TOKEN:+--upload}
26
+ artifacts:
27
+ - narvy-results.sarif
28
+
29
+ # Every push, and every pull request (same step).
30
+ pipelines:
31
+ default:
32
+ - step: *narvy-sast
33
+ pull-requests:
34
+ '**':
35
+ - step: *narvy-sast
@@ -25,7 +25,7 @@ jobs:
25
25
  - name: Install Narvy CLI
26
26
  run: |
27
27
  python -m pip install --upgrade pip
28
- pip install narvy-cli
28
+ pip install "narvy-cli>=1.3.2"
29
29
 
30
30
  # The dependency check downloads the OSV database (npm alone is about 220 MB).
31
31
  # Kept in the Actions cache, one key per UTC day; the CLI refreshes a copy older than 24 h.
@@ -42,11 +42,19 @@ jobs:
42
42
 
43
43
  - name: Run Narvy scan
44
44
  # SARIF is written before the --fail-on gate, so the Security tab fills even on a failing build.
45
+ # With a NARVY_TOKEN repository secret (narvy.io > Profile > API Credentials), --upload also
46
+ # sends the findings (never code) to your Narvy dashboard. Without it, the scan stays local.
47
+ # --upload needs a paid plan (Solo and up): on Community it fails the build (exit 4, HTTP 403),
48
+ # so set NARVY_TOKEN only on a paid account.
49
+ # Secrets are not passed to pull requests from forks: those runs stay local.
50
+ env:
51
+ NARVY_TOKEN: ${{ secrets.NARVY_TOKEN }}
45
52
  run: |
46
53
  narvy scan . \
47
54
  --output sarif \
48
55
  --file narvy-results.sarif \
49
- --fail-on high
56
+ --fail-on high \
57
+ ${NARVY_TOKEN:+--upload}
50
58
 
51
59
  - name: Save the OSV database cache
52
60
  if: always() # also when --fail-on failed the build
@@ -10,6 +10,11 @@
10
10
  # folders are not scanned). GitLab has no date variable for a cache key: the key
11
11
  # is fixed and the CLI itself refreshes a copy older than 24 h, which this job
12
12
  # then saves back (when: always).
13
+ # With a masked NARVY_TOKEN CI/CD variable (narvy.io > Profile > API Credentials),
14
+ # --upload also sends the findings (never code) to your Narvy dashboard. Without
15
+ # it, the scan stays local. --upload needs a paid plan (Solo and up): on
16
+ # Community it fails the pipeline (exit 4, HTTP 403), so set NARVY_TOKEN only on
17
+ # a paid account.
13
18
  stages:
14
19
  - test
15
20
 
@@ -25,9 +30,9 @@ narvy_sast:
25
30
  when: always
26
31
  before_script:
27
32
  - pip install --upgrade pip
28
- - pip install "narvy-cli>=1.3.0"
33
+ - pip install "narvy-cli>=1.3.2"
29
34
  script:
30
- - narvy scan . --output gitlab --file gl-sast-report.json --fail-on high || echo $? > narvy-exit-code
35
+ - narvy scan . --output gitlab --file gl-sast-report.json ${NARVY_TOKEN:+--upload} --fail-on high || echo $? > narvy-exit-code
31
36
  artifacts:
32
37
  when: always
33
38
  reports:
@@ -7,6 +7,7 @@ never sends one anywhere.
7
7
  """
8
8
  import boto3
9
9
  from botocore.exceptions import ClientError, NoCredentialsError, EndpointConnectionError
10
+ import contextvars
10
11
  import json
11
12
  from datetime import datetime
12
13
  import time
@@ -17,6 +18,19 @@ from .rule_severity import stamp_items as _stamp_rule_severity
17
18
 
18
19
  logger = logging.getLogger(__name__)
19
20
 
21
+ # Checks that errored inside an analyzer which keeps going (one bucket, one
22
+ # user, one WAF scope). analyze_aws_security reads them into coverage, so a
23
+ # check that did not run is a gap, never a pass.
24
+ _partial_errors = contextvars.ContextVar("narvy_aws_partial_errors", default=None)
25
+
26
+
27
+ def _note_skip(label, err):
28
+ """Record that `label` could not be checked (coverage becomes partial)."""
29
+ logger.error(f"{label}: {err}")
30
+ sink = _partial_errors.get()
31
+ if sink is not None:
32
+ sink.append(f"{label}: {err}")
33
+
20
34
  class CustomJSONEncoder(json.JSONEncoder):
21
35
  def default(self, obj):
22
36
  if isinstance(obj, datetime):
@@ -221,7 +235,7 @@ def analyze_s3_buckets(endpoint_url=None):
221
235
  })
222
236
  break
223
237
  except ClientError as e:
224
- logger.error(f"Error checking ACL for bucket {bucket['Name']}: {str(e)}")
238
+ _note_skip(f"s3_buckets/{bucket['Name']} acl", e)
225
239
 
226
240
  return vulnerable_buckets
227
241
 
@@ -239,8 +253,9 @@ def _has_console_access(iam, user_name):
239
253
  if e.response['Error']['Code'] == 'NoSuchEntity':
240
254
  return False
241
255
  # On any other error, be conservative and treat as console user so we
242
- # don't silently drop a real human; the MFA finding stays MEDIUM.
243
- logger.error(f"login-profile check failed for {user_name}: {e}")
256
+ # don't silently drop a real human; the MFA finding stays MEDIUM. The
257
+ # check is still a gap: console access was not read.
258
+ _note_skip(f"iam_users/{user_name} login profile", e)
244
259
  return True
245
260
 
246
261
 
@@ -700,7 +715,7 @@ def check_cis_compliance(endpoint_url=None):
700
715
  })
701
716
  except ClientError as e:
702
717
  if e.response['Error']['Code'] != 'NoSuchEntity':
703
- logger.error(f"Error checking MFA for user {user['UserName']}: {str(e)}")
718
+ _note_skip(f"cis_compliance/CIS 1.2 {user['UserName']}", e)
704
719
 
705
720
  # Check 1.3: Ensure credentials unused for 90 days or greater are disabled
706
721
  try:
@@ -718,7 +733,8 @@ def check_cis_compliance(endpoint_url=None):
718
733
  raise
719
734
 
720
735
  if credential_report is None:
721
- logger.error("Failed to generate or retrieve credential report after multiple attempts.")
736
+ _note_skip("cis_compliance/CIS 1.3 credential report",
737
+ "not generated after 5 attempts")
722
738
  return compliance_issues
723
739
 
724
740
  credential_report = credential_report.decode('utf-8').split('\n')
@@ -746,7 +762,7 @@ def check_cis_compliance(endpoint_url=None):
746
762
  })
747
763
 
748
764
  except Exception as e:
749
- logger.error(f"Error processing credential report: {str(e)}")
765
+ _note_skip("cis_compliance/CIS 1.3 credential report", e)
750
766
 
751
767
  return compliance_issues
752
768
 
@@ -1048,10 +1064,7 @@ def analyze_waf(region, endpoint_url=None):
1048
1064
  'Recommendation': 'Add rules to the regional Web ACL to protect against common web exploits.'
1049
1065
  })
1050
1066
  except ClientError as e:
1051
- if e.response['Error']['Code'] == 'AccessDeniedException':
1052
- logger.error(f"No access to WAF in region {region}. Skipping.")
1053
- else:
1054
- logger.error(f"Error accessing regional WAF in {region}: {str(e)}")
1067
+ _note_skip(f"{region}/waf_regional", e)
1055
1068
 
1056
1069
  # Analyse WAF global (CloudFront)
1057
1070
  try:
@@ -1067,7 +1080,7 @@ def analyze_waf(region, endpoint_url=None):
1067
1080
  'Recommendation': 'Add rules to the global Web ACL to protect against common web exploits.'
1068
1081
  })
1069
1082
  except ClientError as e:
1070
- logger.error(f"Error accessing global WAF: {str(e)}")
1083
+ _note_skip("waf_global", e)
1071
1084
 
1072
1085
  return issues
1073
1086
 
@@ -1168,6 +1181,32 @@ def analyze_aws_security(credentials=None, region=None, endpoint_url=None):
1168
1181
  # Analyzers that couldn't finish (AccessDenied, throttling), so a blind scan
1169
1182
  # shows up as a coverage gap instead of a clean pass.
1170
1183
  coverage_errors = []
1184
+ partial_errors = []
1185
+ partial_token = _partial_errors.set(partial_errors)
1186
+ try:
1187
+ report, regions = _run_aws_checks(region, endpoint_url, coverage_errors)
1188
+ finally:
1189
+ _partial_errors.reset(partial_token)
1190
+ # The global WAF scope is read once per region: one gap, not N.
1191
+ for err in partial_errors:
1192
+ if err not in coverage_errors:
1193
+ coverage_errors.append(err)
1194
+
1195
+ # Coverage: a scan that could not read some services/regions is NOT a clean 0.
1196
+ report["account_id"] = account_id
1197
+ report["coverage"] = {
1198
+ "status": "partial" if coverage_errors else "complete",
1199
+ "regions_scanned": len(regions),
1200
+ "checks_skipped": len(coverage_errors),
1201
+ "errors": coverage_errors,
1202
+ }
1203
+
1204
+ logger.info("AWS security analysis complete")
1205
+ return report
1206
+
1207
+
1208
+ def _run_aws_checks(region, endpoint_url, coverage_errors):
1209
+ """(report, regions): every analyzer, each isolated; failures go to coverage_errors."""
1171
1210
 
1172
1211
  def _collect(dest, label, fn):
1173
1212
  try:
@@ -1268,14 +1307,4 @@ def analyze_aws_security(credentials=None, region=None, endpoint_url=None):
1268
1307
  all_vulnerable_kms_keys, all_config_issues, all_cloudtrail_issues, all_cloudwatch_issues
1269
1308
  )
1270
1309
 
1271
- # Coverage: a scan that could not read some services/regions is NOT a clean 0.
1272
- report["account_id"] = account_id
1273
- report["coverage"] = {
1274
- "status": "partial" if coverage_errors else "complete",
1275
- "regions_scanned": len(regions),
1276
- "checks_skipped": len(coverage_errors),
1277
- "errors": coverage_errors,
1278
- }
1279
-
1280
- logger.info("AWS security analysis complete")
1281
- return report
1310
+ return report, regions
@@ -981,6 +981,7 @@ def analyze_ipa(ipa_path: str, override_config: Optional[ScopeConfig] = None) ->
981
981
  return result
982
982
 
983
983
  app_bundle_id = get_own_bundle_id(plist)
984
+ result["bundle_id"] = app_bundle_id
984
985
 
985
986
  exe_name = plist.get("CFBundleExecutable")
986
987
  if not exe_name:
@@ -31,11 +31,6 @@ _EXTRA_SKIP_DIR_NAMES = frozenset({"node_modules", ".git"})
31
31
  # Suffix match: Xcode names test folders <TargetName>Tests / <TargetName>UITests.
32
32
  _TEST_DIR_SUFFIXES = ("Tests", "UITests")
33
33
 
34
- _SEMGREP_SEVERITY_MAP = {
35
- "ERROR": "CRITICAL",
36
- "WARNING": "HIGH",
37
- "INFO": "MEDIUM",
38
- }
39
34
 
40
35
 
41
36
  def _is_test_dir_name(name: str) -> bool:
@@ -107,7 +102,7 @@ def _load_swift_semgrep_rule_defs() -> List[Dict[str, Any]]:
107
102
  defs.append({
108
103
  "id": rule["id"],
109
104
  "name": rule.get("message", rule["id"])[:120],
110
- "severity": _SEMGREP_SEVERITY_MAP.get(rule.get("severity", "INFO"), "MEDIUM"),
105
+ "severity": semgrep_engine.map_severity(rule.get("severity")),
111
106
  "details": {
112
107
  "cwe": meta.get("cwe", ""),
113
108
  "masvs": meta.get("masvs", ""),
@@ -202,7 +197,7 @@ def _run_swift_semgrep(source_dir: str,
202
197
  ):
203
198
  continue
204
199
 
205
- severity = _SEMGREP_SEVERITY_MAP.get(extra.get("severity", "INFO"), "MEDIUM")
200
+ severity = semgrep_engine.map_severity(extra.get("severity"))
206
201
  message = extra.get("message", "")
207
202
 
208
203
  # Downgrade trust-all-certs when guarded by a per-request opt-in flag.