mobsfscan is a static analysis tool that can find insecure code patterns in your Android and iOS source code. Supports Java, Kotlin, Swift, and Objective C Code
mobsfscan is a static analysis tool that can find insecure code patterns in your Android and iOS source code. Supports Java, Kotlin, Swift, and Objective C Code
mobsfscan is a static analysis tool that can find insecure code patterns in your Android and iOS source code. Supports Java, Kotlin, Android XML, iOS Info.plist, Swift and Objective C Code. mobsfscan uses MobSF static analysis rules and is powered by semgrep and libsast pattern matcher.
If you liked mobsfscan and find it useful, please consider donating.
Automated Mobile Application Security Assessment with MobSF -MAS
Android Security Tools Expert -ATX
pip install mobsfscan
Requires Python 3.10–3.14
………A .mobsf file in the root of the source code directory allows you to configure mobsfscan. You can also use a custom .mobsf file using --config argument.
---
- ignore-filenames:
- skip.java
ignore-paths:
- __MACOSX
- skip_dir
ignore-rules:
- android_kotlin_logging
- android_safetynet_api
- android_prevent_screenshot
- android_detect_tapjacking
- android_certificate_pinning
- android_root_detection
- android_certificate_transparency
severity-filter:
- WARNING
- ERROR
severity-overrides:
ios_log: ERROR
android_logging: WARNINGseverity-overrides changes the reported severity for specific rule IDs (INFO, WARNING, or ERROR). Overrides are applied before severity-filter and affect CLI output, exit codes, and report formats (SARIF, SonarQube, GitLab SAST).
You can suppress findings from source files by adding the comment // mobsf-ignore: rule_id1, rule_id2 on the line that triggers the finding. Only that match is suppressed; other matches of the same rule in the file still report.
Example:
String password = "strong password"; // mobsf-ignore: hardcoded_passwordYou can enable mobsfscan in your CI/CD or DevSecOps pipelines.
Add the following to the file .github/workflows/mobsfscan.yml.
name: mobsfscan
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: mobsfscan
uses: MobSF/mobsfscan@main
with:
args: '. --json'Example: pivaa with mobsfscan github action
Add the following to the file .github/workflows/mobsfscan_sarif.yml.
…Add the following to the file .gitlab-ci.yml.
stages:
- test
mobsfscan:
image: python:3.12
stage: test
before_script:
- pip3 install --upgrade mobsfscan
script:
- mobsfscan . --gitlab-sast -o gl-sast-report.json
artifacts:
reports:
sast: gl-sast-report.jsonExample command (local):
mobsfscan . --gitlab-sast -o gl-sast-report.jsonThis writes a native GitLab SAST report so findings appear in the Vulnerability Report / MR security widget without a SARIF converter.
--sonarqube writes the generic issue format (SonarQube 10.3+ / SonarCloud), with separate rules and issues arrays:
mobsfscan . --sonarqube -o mobsfscan-sonar.jsonImport with sonar.externalIssuesReportPaths=mobsfscan-sonar.json.
Add the following to the file .travis.yml.
language: python
install:
- pip3 install --upgrade mobsfscan
script:
- mobsfscan .Add the following to the file .circleci/config.yaml
version: 2.1
jobs:
mobsfscan:
docker:
- image: cimg/python:3.12
steps:
- checkout
- run:
name: Install mobsfscan
command: pip install --upgrade mobsfscan
- run:
name: mobsfscan check
command: mobsfscan .Add the following to the file bitrise.yml
security_audit:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- mobsfscan@1: {}
- deploy-to-bitrise-io@2: {}docker pull opensecurity/mobsfscan
docker run -v /path-to-source-dir:/src opensecurity/mobsfscan /srcdocker build -t mobsfscan .
docker run -v /path-to-source-dir:/src mobsfscan /srcNo open issues yet, or sync has not completed.