narvy-cli 1.3.5__tar.gz → 1.3.8__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 (134) hide show
  1. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/CHANGELOG.md +166 -0
  2. {narvy_cli-1.3.5/narvy_cli.egg-info → narvy_cli-1.3.8}/PKG-INFO +1 -1
  3. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/__init__.py +1 -1
  4. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/android/source_analyzer.py +12 -1
  5. narvy_cli-1.3.8/narvy/app_inventory.py +647 -0
  6. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cbom.py +9 -2
  7. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/aws_scan.py +7 -0
  8. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/gcp_scan.py +3 -1
  9. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/decompiler.py +5 -2
  10. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/lynis_bootstrap.py +3 -1
  11. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ios/source_analyzer.py +4 -0
  12. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/main.py +134 -88
  13. narvy_cli-1.3.8/narvy/production_source.py +489 -0
  14. narvy_cli-1.3.8/narvy/rules/web/secrets_supplement.yml +709 -0
  15. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/ios_deps.py +3 -1
  16. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/secret_output.py +130 -0
  17. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/secret_presentation.py +1555 -69
  18. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/semgrep_engine.py +18 -2
  19. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/telemetry.py +2 -1
  20. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/uploader.py +11 -5
  21. narvy_cli-1.3.8/narvy/useragent.py +22 -0
  22. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/web/nuclei_binary.py +4 -1
  23. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/web/source_analyzer.py +305 -3
  24. {narvy_cli-1.3.5 → narvy_cli-1.3.8/narvy_cli.egg-info}/PKG-INFO +1 -1
  25. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy_cli.egg-info/SOURCES.txt +3 -0
  26. narvy_cli-1.3.5/narvy/rules/web/secrets_supplement.yml +0 -392
  27. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/LICENSE +0 -0
  28. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/MANIFEST.in +0 -0
  29. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/README.md +0 -0
  30. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/SECURITY.md +0 -0
  31. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/__main__.py +0 -0
  32. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/android/__init__.py +0 -0
  33. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/android/split_bundle.py +0 -0
  34. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/android_rule_context.py +0 -0
  35. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/apk_memory_preflight.py +0 -0
  36. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/auth.py +0 -0
  37. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ci_templates/bitbucket.yml +0 -0
  38. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ci_templates/github.yml +0 -0
  39. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ci_templates/gitlab.yml +0 -0
  40. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/__init__.py +0 -0
  41. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/normalize.py +0 -0
  42. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/rule_severity.py +0 -0
  43. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/severity.py +0 -0
  44. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/cloud/upload.py +0 -0
  45. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/comment_filter.py +0 -0
  46. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/crypto_taint_lite.py +0 -0
  47. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/doctor.py +0 -0
  48. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/gitlab_report.py +0 -0
  49. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/__init__.py +0 -0
  50. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/audit.py +0 -0
  51. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/host_knowledge.py +0 -0
  52. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/lynis_parser.py +0 -0
  53. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/narvy_checks.py +0 -0
  54. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/report.py +0 -0
  55. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/host/ssh_exec.py +0 -0
  56. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ios/__init__.py +0 -0
  57. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ios/binary_analyzer.py +0 -0
  58. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ios/plist_checks.py +0 -0
  59. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ios/third_party_filter.py +0 -0
  60. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/ios/trust_all_context.py +0 -0
  61. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/native_hardening.py +0 -0
  62. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/own_reports.py +0 -0
  63. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/pathhint.py +0 -0
  64. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/pathnorm.py +0 -0
  65. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/proc.py +0 -0
  66. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/repo_identity.py +0 -0
  67. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/reporter.py +0 -0
  68. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rule_engine.py +0 -0
  69. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/android/config.yml +0 -0
  70. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/android/crypto.yml +0 -0
  71. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/android/secrets.yml +0 -0
  72. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/android/storage.yml +0 -0
  73. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/android/webview.yml +0 -0
  74. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/android.yml +0 -0
  75. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/ios/objc/crypto.yml +0 -0
  76. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/ios/objc/network.yml +0 -0
  77. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/ios/objc/secrets.yml +0 -0
  78. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/ios/objc/storage.yml +0 -0
  79. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/ios/objc/webview.yml +0 -0
  80. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/ios_swift.yml +0 -0
  81. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/go.yml +0 -0
  82. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/java.yml +0 -0
  83. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/javascript.yml +0 -0
  84. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/kotlin.yml +0 -0
  85. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/php.yml +0 -0
  86. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/python.yml +0 -0
  87. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/ruby.yml +0 -0
  88. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/rust.yml +0 -0
  89. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/rules/web/secrets.yml +0 -0
  90. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sbom.py +0 -0
  91. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/__init__.py +0 -0
  92. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/android_deps.py +0 -0
  93. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/osv_client.py +0 -0
  94. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/osv_localdb.py +0 -0
  95. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/osv_semantic.py +0 -0
  96. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/severity_calibration.py +0 -0
  97. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/sca/web_deps.py +0 -0
  98. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/scope_config.py +0 -0
  99. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/secret_value_grade.py +0 -0
  100. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/stack_protector_evidence.py +0 -0
  101. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/__init__.py +0 -0
  102. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/__main__.py +0 -0
  103. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/analyze.py +0 -0
  104. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/__init__.py +0 -0
  105. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/arsc.py +0 -0
  106. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/axml.py +0 -0
  107. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/checks.py +0 -0
  108. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/elf.py +0 -0
  109. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/loader.py +0 -0
  110. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/protoxml.py +0 -0
  111. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/android/xmlmodel.py +0 -0
  112. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/archive.py +0 -0
  113. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/cli.py +0 -0
  114. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/data/__init__.py +0 -0
  115. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/data/apple.py +0 -0
  116. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/data/play.py +0 -0
  117. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/ios/__init__.py +0 -0
  118. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/ios/checks.py +0 -0
  119. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/ios/loader.py +0 -0
  120. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/ios/macho.py +0 -0
  121. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/store_check/model.py +0 -0
  122. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/third_party_filter.py +0 -0
  123. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/weak_prng_context.py +0 -0
  124. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/web/__init__.py +0 -0
  125. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/web/scan_blocklist.py +0 -0
  126. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/web/scanner.py +0 -0
  127. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy/web/ssrf_guard.py +0 -0
  128. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy_cli.egg-info/dependency_links.txt +0 -0
  129. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy_cli.egg-info/entry_points.txt +0 -0
  130. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy_cli.egg-info/requires.txt +0 -0
  131. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/narvy_cli.egg-info/top_level.txt +0 -0
  132. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/pyproject.toml +0 -0
  133. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/setup.cfg +0 -0
  134. {narvy_cli-1.3.5 → narvy_cli-1.3.8}/setup.py +0 -0
@@ -5,6 +5,172 @@ 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.8]
9
+
10
+ ### Added
11
+
12
+ - `--upload` sends the CLI version: the `/api/v1/ingest` body carries
13
+ `cli_version` (the installed narvy-cli version), so the uploaded scan states
14
+ which CLI produced it. Earlier versions sent nothing and their uploads state
15
+ no engine version.
16
+
17
+ ### Fixed
18
+
19
+ - Source scans: a package of the app named `test`, `tests`, `vendor`,
20
+ `build` or `dist` under a production source root
21
+ (`src/main/java/com/acme/app/test/`, `src/main/kotlin/...`, SwiftPM
22
+ `Sources/<Target>/`) is the app's own code. A finding there was missing
23
+ (semgrep's default ignore list drops those folder names at any depth, and
24
+ the web pass excluded `vendor` / `build` by bare name), and one in a
25
+ package named `fixtures` or `mocks` was lowered to LOW as test code. Real
26
+ test source sets (`src/test`, `src/androidTest`), a root `build/` or
27
+ `vendor/`, Go and PHP `vendor/` and vendored C under a SwiftPM target stay
28
+ excluded. A production flavor or build type (`src/release/java`,
29
+ `src/dev/java`) is read like `src/main`; a `<name>Test` source set
30
+ declared as a flavor or build type in a `build.gradle(.kts)` (`abTest`)
31
+ is production code. Known test source sets (`androidTest`, `testDebug`,
32
+ `integrationTest`...) and an undeclared `<name>Test` set are lowered to
33
+ LOW like test code, never removed (`testDebug` and `integrationTest` were
34
+ reported at full severity). APK / AAB scans: every package
35
+ of the decompiled app is scanned, `test` and `vendor` included (an APK
36
+ has no test source set). A project with its own `.semgrepignore` keeps it. Needs the
37
+ pinned semgrep 1.152; with another semgrep version the scan behaves as in
38
+ 1.3.7.
39
+
40
+ ### Changed
41
+
42
+ - Every request the CLI makes on its own behalf goes out with the User-Agent
43
+ `narvy-cli/<version>` (was `python-requests/<x.y.z>`): Narvy API (whoami,
44
+ upload, ingest, scans), usage telemetry, jadx / JRE / nuclei downloads,
45
+ GitHub advisory lookups, Lynis download, GCP and AWS API calls (AWS:
46
+ appended to the boto3 User-Agent). The OSV client already did. Requests to
47
+ a web target being scanned keep the browser User-Agent.
48
+
49
+ ## [1.3.7]
50
+
51
+ ### Fixed
52
+
53
+ - App inventory (one scan = one app):
54
+ - An Xcode project whose targets cannot be read, or an XcodeGen spec
55
+ (`project.yml` with `targets:` or `include:`) with no `.xcodeproj`, is an
56
+ app identified by its folder. It gets the "another app" note when it is
57
+ not the scanned app. Both were not counted, so their findings went into
58
+ the scanned app with no note. A project whose targets are all frameworks,
59
+ libraries or legacy / aggregate targets is not an app, and a
60
+ `project.yml` that is not an XcodeGen spec (spaCy, CI tooling) is not an
61
+ Xcode project.
62
+ - Test-host, demo and sample apps are recognised by their last word, not
63
+ by substrings: Test, Tests, Tester, Demo, Sample, Example, Playground,
64
+ Host... (after App, UI, iOS). `Contest`, `Latest`, `Attestation` and
65
+ `TestFlight` are app names. An app with an applicationId or bundle id is
66
+ auxiliary only when its name AND its id say so (the id judged the same
67
+ way on its last word, without Example): a `rider` module shipping
68
+ `com.acme.rider.demo` and a `DriverDemo` target shipping `com.acme.driver`
69
+ are apps, `com.example.shop` and `com.withsecure.example.sieve` are apps,
70
+ a `RiderDemo` module shipping `com.acme.rider.demo` is a demo. A name
71
+ that starts with Sample, Demo, Example or Test as a whole word
72
+ (`SampleBrowser`, `DemoShop`) is auxiliary too; `TestFlight` is not.
73
+ - The scanned app is the main one, not the first in path order: the app
74
+ with the most source files, then one with a readable bundle id or
75
+ applicationId, then one with no auxiliary word, then path order. A sample
76
+ app placed before the product (`SampleBrowser/` next to `firefox-ios/`)
77
+ no longer takes its place.
78
+ - A folder named like build output (`www/`, `build/`, `dist/`, `target/`,
79
+ `out/`, `coverage/`, `platforms/`, `plugins/`, `fastlane/`) is read when it
80
+ holds an app identity up to 3 levels down (300 folders read): an Android
81
+ applicationId, an Xcode or XcodeGen app, or a web app's `package.json`.
82
+ An app kept there is another app with its note, and is never analysed
83
+ ahead of an app at a regular place. Without such an identity the folder is
84
+ still skipped. `node_modules/`, `Pods/`, `Carthage/`, `vendor/`,
85
+ `DerivedData/` and virtualenvs are always skipped.
86
+ - A cross-platform app owns its `android/`, `ios/`, `www/`, `build/`,
87
+ `dist/`, `platforms/` and `plugins/` folders: Cordova's generated
88
+ `platforms/ios` and `platforms/android`, a Capacitor `www/package.json`
89
+ copy and a Flutter `build/ios` copy are the same app, not other apps.
90
+ - Android and iOS source scans, config-secret pass:
91
+ - A configuration file that is a symbolic link made semgrep reject the
92
+ whole batch of 400 files: 0 findings and a clean result. Links are not
93
+ handed to semgrep (the file they point to is read where it lives, under
94
+ the scan root), and any semgrep error in that pass makes the scan
95
+ degraded (coverage notice, `--fail-on` exit 2), never clean.
96
+ - The pass reads what the whole-tree pass read: the root `.semgrepignore`
97
+ is applied, `test/` and `tests/` are skipped (semgrep's default), and the
98
+ files of a folder named `.env/` (`.env/local`) are read.
99
+
100
+ ### Changed
101
+
102
+ - Android and iOS source scans: the config-secret pass reads only the
103
+ configuration files (`.env`, YAML, `.properties`, INI / conf) instead of
104
+ the whole tree. Findings are unchanged on the repositories measured; the
105
+ pass took 19 to 69 s and now takes 3 to 7 s. A whole Android or iOS source
106
+ scan is back to its 1.3.5 duration (37 to 46 s on the three repositories
107
+ measured; 1.3.6 took 51 to 80 s).
108
+ - `narvy/secret_presentation.py` follows narvy.io again: the config-line
109
+ masking of 1.3.6, the masking of credential assignments in stored HTTP
110
+ responses, and Discord webhook URLs recognised as a secret format (the whole
111
+ URL is masked). `narvy web-scan` masks the bodies it reports with that same
112
+ HTTP masking (a key in a query string inside code, `password=...` with
113
+ punctuation), then with its own config-file forms; an INI value ends at
114
+ `; ` or an inline comment.
115
+
116
+ ## [1.3.6]
117
+
118
+ ### Security
119
+
120
+ - Secret values in configuration lines are masked whole, as on narvy.io: a
121
+ value starting with `#` or `##` (`API_SECRET=#...`), a base64 key starting
122
+ with `/`, and a value containing `***` or `...`. The description used to
123
+ name only the part before `#` (wrong length and fingerprint), or no value.
124
+ - `narvy web-scan`: credentials a site exposes are masked in the JSON report,
125
+ in the response body and in the extracted results nuclei copies into a
126
+ finding. They were in clear. This covers `.env`, `.properties` and INI
127
+ `key = value` lines (AWS credentials, `config.ini`), credential assignments
128
+ anywhere in a body (`DB_PASSWORD=...`, `"auth_token": "..."`), npm registry
129
+ tokens (`//host/:_authToken=`), PHP `define('DB_PASSWORD', '...')` /
130
+ `AUTH_KEY` / salts (`wp-config.php`) and the user and password of a URL
131
+ (`https://user:password@host`). For a template that exposes credentials,
132
+ each extracted result is masked whole.
133
+
134
+ ### Added
135
+
136
+ - Secrets in repository configuration files, the narvy.io rules: `.env`
137
+ (`dotenv-credential`, including a value that starts with `#` and a base64
138
+ `SESSION_KEY`), YAML (`yaml-config-credential`), `.properties`
139
+ (`properties-credential`), INI / conf (`ini-config-secret`) and compose
140
+ `environment:` entries (`compose-env-secret`). Placeholders, variable
141
+ references, comments, URLs and template files (`.env.example`...) are not
142
+ reported. They run on web, Android and iOS source scans.
143
+
144
+ ### Fixed
145
+
146
+ - An iOS repository with a `Gemfile` or `package.json` that only pins build
147
+ tooling (fastlane, CocoaPods) at the root and its Xcode projects in
148
+ sub-folders (up to 4 levels) is scanned as iOS. It was scanned as web
149
+ source. A real web app at the root (Rails routes or `config.ru`, Express,
150
+ Django...) stays web.
151
+ - React Native, Capacitor and Flutter apps: the `android/` shell is scanned
152
+ with the JavaScript code and `ios/` (it only got a note). The app is
153
+ uploaded as one app.
154
+ - Generated React Native bundles (`index.android.bundle`, `main.jsbundle`,
155
+ Hermes `.hbc`) are no longer read. In a minified JavaScript file (most lines
156
+ of 2000+ characters, or at least 5 lines and 10 KB with a median line over
157
+ 200 characters) only code-pattern findings are left out, with a note giving
158
+ their number; a secret there is still reported.
159
+
160
+ ### Changed
161
+
162
+ - One scan analyses one app, as on narvy.io. Apps are told apart by their
163
+ identity: Android applicationId, iOS bundle id of an application target, web
164
+ app folder (package name). Two Android apps of one Gradle build, two iOS
165
+ apps, two web apps, a web app and an iOS app, a native app and a React
166
+ Native app: the scan analyses one, reports nothing located in the others,
167
+ and a note names each of them with the `narvy scan` command for it. Phone
168
+ and Wear modules sharing an applicationId are one app; library, framework,
169
+ test-host, demo and sample targets are not apps; `examples/` and `samples/`
170
+ folders are ignored. The whole tree is searched (up to 50,000 folders; past
171
+ that bound a note says the search stopped). 1.1.0 scanned a nested iOS
172
+ project as a second surface and uploaded it as a second app.
173
+
8
174
  ## [1.3.5]
9
175
 
10
176
  ### Security
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: narvy-cli
3
- Version: 1.3.5
3
+ Version: 1.3.8
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
@@ -1,3 +1,3 @@
1
1
  """Narvy CLI - free, local SAST for Android, iOS and polyglot source."""
2
2
 
3
- __version__ = "1.3.5"
3
+ __version__ = "1.3.8"
@@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional, Tuple
7
7
 
8
8
  from narvy.rule_engine import load_rules_from_dir, run_rules_on_file
9
9
  from narvy.pathnorm import canonical_path
10
+ from narvy.production_source import register_gradle_variants, scope_view, source_set_of
10
11
  from narvy import semgrep_engine
11
12
  from narvy import crypto_taint_lite
12
13
  from narvy.scope_config import ScopeConfig
@@ -105,7 +106,14 @@ def _drop_prefkey_echo_secrets(source_dir: str, findings: List[Dict[str, Any]])
105
106
 
106
107
 
107
108
  def _is_test_path(rel_path: str) -> bool:
108
- p = "/" + rel_path.replace("\\", "/").lstrip("/")
109
+ # Read without the app's own package folders below a production source
110
+ # root: com/acme/test/ and com/acme/fixtures/ are packages; src/test/ and
111
+ # src/androidTest/ still match (narvy/production_source).
112
+ # A known test source set or an undeclared <x>Test set (src/loadTest/
113
+ # with no such flavor / build type) is lowered, never removed.
114
+ if source_set_of(rel_path) in ("test", "hidden"):
115
+ return True
116
+ p = "/" + scope_view(rel_path).replace("\\", "/").lstrip("/")
109
117
  if any(frag in p.lower() for frag in _TEST_PATH_FRAGMENTS):
110
118
  return True
111
119
  return bool(_TEST_FILE_RE.search(p.rsplit("/", 1)[-1]))
@@ -269,6 +277,9 @@ def analyze_source(source_dir: str, override_config: Optional[ScopeConfig] = Non
269
277
  source_dir = canonical_path(source_dir)
270
278
  notes: List[str] = []
271
279
  all_findings: List[Dict[str, Any]] = []
280
+ # The project's flavor / build-type names: an "abTest" flavor is
281
+ # production code, not a test source set.
282
+ register_gradle_variants(source_dir)
272
283
 
273
284
  manifest_paths = sorted(find_android_manifests(source_dir))
274
285
  own_roots = get_own_package_roots_gradle(manifest_paths)