Blog

Mobile Security Findings in CI: Gating Builds with SARIF

A security gate that fails on every scanner signal gets switched off. A useful one blocks on proven issues and still shows everything else.

Why mobile CI gates break

A scan of an APK produces many signals: a weak hash call, a third-party host, an exported component. Most are worth a look, few are proven vulnerabilities. If the pipeline fails on all of them, developers learn to bypass the gate, and the issues that matter are lost with the noise.

What SARIF gives you

SARIF (Static Analysis Results Interchange Format) is an OASIS standard JSON format for analysis results. GitHub code scanning and many other tools can read it, so findings appear where developers already review code. Each result has a level: error, warning or note.

The level is a policy decision. Mapping every result to error recreates the noisy gate; mapping everything to note makes the gate meaningless.

A gate that holds up

  • Block only on confirmed findings at or above a severity threshold you choose, such as high.
  • Report candidates as notes. They stay visible for review without stopping delivery.
  • Treat "not tested" as its own result. If the scan could not be admitted, uploaded or completed, the job should say so with a distinct exit code, never pass silently.
  • Use a release mode that records results without blocking, for builds you ship regardless.

Do not invent source locations

Code-scanning views like results attached to a file and line. A compiled APK has no reliable mapping back to your source tree, so a scanner that guesses a path produces misleading annotations. It is better to attach results to the artifact and include the evidence, MASVS category and remediation in the result text.

Keep the pipeline safe

The scan needs an API token and an authorization for the app. Store both as protected, masked secrets, run scans only from trusted branches, and do not expose the secrets to pull requests from forks. Reference the scanner by a full reviewed commit SHA rather than a branch, so the code that runs with your secrets cannot change underneath you.

How we approach it

AppBreach CI scans write the full report as JSON and the findings as SARIF, fail pull-request builds only on confirmed findings at the threshold, and return a separate exit code when the scan could not run. See the CI/CD integration documentation and confirmed vs candidate findings.

Related reading