Sitemap
Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

Member-only story

Android Security: mobsfscan

--

Press enter or click to view image in full size

Not a medium member? “Read for free”

One way to help ensure we write secure apps is to use static analysis tools to find insecure code patterns in our source code. What better tool to do this than the free and open-source mobsfscan?

mobsfscan is based on the Mobile Security Framework (MobSF) rules and supports Java, Kotlin, Swift, and Objective-C code. The Python-based tools’ rules use semgrep and libsast pattern matchers.

Enabling mobsfscan

As shown in the documentation, there are many different ways of running mobsfscan, such as installing locally with pip, running in CI/CD, or using a Docker image.

For our purposes, I will talk about setting up using GitHub Actions, as we can add the results directly to the Security tab inside GitHub.

Press enter or click to view image in full size
GitHub code scanning vulnerability alerts

To use GitHub’s security tab, we need the output from mobsfscan to be in the Static Analysis Results Interchange Format (SARIF). We then upload the results using the github/codeql-action/upload-sarif action. You might notice that the upload-sarif action is part of CodeQL, a semantic code analysis engine that looks for vulnerabilities, which I will write…

--

--

Matthew Dolan
Matthew Dolan

Written by Matthew Dolan

Matt Dolan has been eating doughnuts and developing with Android since the dark days of v1.6.

Stackademic
Stackademic

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.