feat(mobile): legacy Android and Unity builds flagged, not resolved; Android found everywhere #466

Merged
sharang merged 1 commits from fix/unity-android-sbom into main 2026-10-05 21:17:53 +00:00
Owner

From the first pilot scan on prod (an Android + Unity repository, findings relayed by the platform session):

  • the two Android apps were not recognised;
  • Unity became a desktop app;
  • the SBOM was empty with no reason given.

It follows the user's decision: end-of-life build systems are flagged, not supported.

Changes

  1. Android detection (classify/language.rs):

    • Every AndroidManifest.xml outside test folders is an Android module: Gradle src/main, the root of an Eclipse/ADT project, and a Unity project's Assets/Plugins/Android.
    • #449 only counted src/main and the repo root. That missed the ADT apps (manifest at <App>/AndroidManifest.xml), and with #458 the target would have become desktop_app.
  2. New build-lifecycle (pipeline/build_lifecycle.rs, modelled on dotnet-lifecycle; CWE-1104, medium):

    Rule When Remedy CRA
    legacy-build-system-no-sbom ADT (default.properties/project.properties next to the manifest, no Gradle); Unity without Packages/manifest.json migrate to Gradle + AGP, or to a current Unity LTS with UPM cra-ai-23
    android-sdk-end-of-support target=android-N (or Google Inc.:Google APIs:N) with N < 29 raise the target/min API cra-ai-22
    unity-editor-end-of-support Unity before 2021, and the tech streams of 2021–2023, judged conservatively upgrade to a supported LTS cra-ai-22
    • These builds also record a skipped sbom_dependencies stage, so the CRA SBOM requirements show "Nicht bewertet" instead of looking clean.
    • Auto-resolve (#443) counts the scanner as completed.
    • Dropped: ADT dependency resolution, and inferring UPM packages from csproj names.
  3. Unity SBOM (sbom/unity.rs): the editor version as a component, plus for modern projects the packages from Packages/packages-lock.json (registry and git), otherwise manifest.json. Marked "not matched" for CVEs, since no advisory database covers Unity.

  4. syft failure no longer silent: a skipped stage sbom (tool syft, so CRA SBOM shows "Nicht bewertet"). The timeout is now 10 minutes.

  5. Dashboard: labels for build-lifecycle and the stage sbom. Docs: sbom.md.

Fixture mobile-legacy-adt-unity (in the pilot's shape)

Two ADT apps (target=android-8 and Google APIs:11), plus Unity 2019.2.4f1 without Packages/. Result:

  • the 3 build-lifecycle rules;
  • the Unity editor in the SBOM;
  • sbom_dependencies + cve_lookup skips;
  • the mobsfscan manifest findings.

Checks

  • fmt, plus clippy with the CI flags (agent, control-map).
  • Agent lib tests: 600, including new tests for ADT/Unity classification, build-lifecycle (pilot shape, modern builds without findings, Unity support rules, both target forms) and the Unity SBOM. control-map: 13.
  • Local nightly, all targets: both bless and compare pass. Only the new baseline was added. The four py baselines only differ by a newly published OSV advisory and were left out.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

From the first pilot scan on prod (an Android + Unity repository, findings relayed by the platform session): - the two Android apps **were not recognised**; - Unity became a **desktop app**; - the **SBOM was empty with no reason given**. It follows the user's decision: **end-of-life build systems are flagged, not supported.** ## Changes 1. **Android detection** (`classify/language.rs`): - Every `AndroidManifest.xml` outside test folders is an Android module: Gradle `src/main`, the root of an Eclipse/ADT project, and a Unity project's `Assets/Plugins/Android`. - #449 only counted `src/main` and the repo root. That missed the ADT apps (manifest at `<App>/AndroidManifest.xml`), and with #458 the target would have become `desktop_app`. 2. **New `build-lifecycle`** (`pipeline/build_lifecycle.rs`, modelled on `dotnet-lifecycle`; CWE-1104, medium): | Rule | When | Remedy | CRA | |---|---|---|---| | `legacy-build-system-no-sbom` | ADT (`default.properties`/`project.properties` next to the manifest, no Gradle); Unity without `Packages/manifest.json` | migrate to Gradle + AGP, or to a current Unity LTS with UPM | cra-ai-23 | | `android-sdk-end-of-support` | `target=android-N` (or `Google Inc.:Google APIs:N`) with N < 29 | raise the target/min API | cra-ai-22 | | `unity-editor-end-of-support` | Unity before 2021, and the tech streams of 2021–2023, judged conservatively | upgrade to a supported LTS | cra-ai-22 | - These builds also record a skipped `sbom_dependencies` stage, so the CRA SBOM requirements show "Nicht bewertet" instead of looking clean. - Auto-resolve (#443) counts the scanner as completed. - **Dropped:** ADT dependency resolution, and inferring UPM packages from csproj names. 3. **Unity SBOM** (`sbom/unity.rs`): the editor version as a component, plus for modern projects the packages from `Packages/packages-lock.json` (registry and git), otherwise `manifest.json`. Marked "not matched" for CVEs, since no advisory database covers Unity. 4. **syft failure no longer silent:** a skipped stage `sbom` (tool syft, so CRA SBOM shows "Nicht bewertet"). The timeout is now 10 minutes. 5. **Dashboard:** labels for `build-lifecycle` and the stage `sbom`. Docs: `sbom.md`. ## Fixture `mobile-legacy-adt-unity` (in the pilot's shape) Two ADT apps (`target=android-8` and `Google APIs:11`), plus Unity 2019.2.4f1 without `Packages/`. Result: - the 3 `build-lifecycle` rules; - the Unity editor in the SBOM; - `sbom_dependencies` + `cve_lookup` skips; - the mobsfscan manifest findings. ## Checks - fmt, plus clippy with the CI flags (agent, control-map). - Agent lib tests: 600, including new tests for ADT/Unity classification, build-lifecycle (pilot shape, modern builds without findings, Unity support rules, both target forms) and the Unity SBOM. control-map: 13. - **Local nightly, all targets:** both bless and compare pass. Only the new baseline was added. The four py baselines only differ by a newly published OSV advisory and were left out. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-10-05 21:09:50 +00:00
feat(mobile): legacy Android and Unity builds flagged, not resolved; Android found everywhere
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m43s
5a71bc2ea2
The first pilot scan of an Android + Unity repository on prod showed:
the two Android apps were not recognised, Unity was typed as a desktop
app, and the SBOM was empty without saying why.

- Classification: every AndroidManifest.xml outside test folders is an
  Android module: Gradle's src/main, an Eclipse/ADT project's root, a
  Unity project's Assets/Plugins/Android. #449 counted only src/main and
  the repository root, so the ADT apps (and with #458 the target type)
  were missed.
- build-lifecycle (new, like dotnet-lifecycle; CWE-1104, medium):
  - legacy-build-system-no-sbom for an ADT project (properties file, no
    Gradle) and a Unity project without Packages/manifest.json; the
    remedy is migrating the build. Bound to cra-ai-23.
  - android-sdk-end-of-support for target=android-N below 29.
  - unity-editor-end-of-support, judged conservatively (before 2021, and
    the 2021-2023 tech streams). Both bound to cra-ai-22.
  Such builds are not resolved (decided: flag, do not support); they also
  record a skipped sbom_dependencies stage, so the SBOM requirements read
  "Nicht bewertet" instead of clean.
- Unity SBOM: the editor version, and for modern projects the packages
  in Packages/packages-lock.json (else manifest.json); listed as not
  matched for CVEs (no advisory database covers Unity).
- A syft failure is no longer silent: a skipped `sbom` stage (tool syft),
  so the SBOM requirements are not assessed; syft gets 10 minutes.

Nightly fixture mobile-legacy-adt-unity in the pilot's shape.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit 04b4f32807 into main 2026-10-05 21:17:53 +00:00
Sign in to join this conversation.