|
| 1 | + |
| 2 | +# MobSF Configurations |
| 3 | + |
| 4 | +MobSF supports a range of environment variable configurations to customize its behaviour and adapt to various deployment scenarios. |
| 5 | +Here is a list of supported environment variables. |
| 6 | + |
| 7 | +## General |
| 8 | +- **`MOBSF_DEBUG`**: Enables debug mode when set to `1`. |
| 9 | +- **`MOBSF_SECRET_KEY`**: Configure a static django secret. |
| 10 | +- **`MOBSF_USE_X_FORWARDED_HOST`**: Enables `X-Forwarded-Host` header support when set to `1`. |
| 11 | +- **`MOBSF_USE_X_FORWARDED_PORT`**: Enables `X-Forwarded-Port` header support when set to `1`. |
| 12 | +- **`TIME_ZONE`**: Configure a timezone for the server, defaults to `UTC`. |
| 13 | +- **`MOBSF_PLATFORM`**: Specify the operating environment for MobSF, such as `docker`. |
| 14 | +- **`MOBSF_HOME_DIR`**: Specify MobSF home directory to store analysis data, defaults to `~/` or `$HOME`. |
| 15 | + |
| 16 | +## Database Configuration |
| 17 | +PostgreSQL is configured only if the required environment variables are set; otherwise, MobSF defaults to using the sqlite3 database. |
| 18 | +- **`POSTGRES_USER`**: Username for the PostgreSQL database. |
| 19 | +- **`POSTGRES_PASSWORD`**: Password for the PostgreSQL database. |
| 20 | +- **`POSTGRES_PASSWORD_FILE`**: Path to a file containing the PostgreSQL password (docker secrets mount). |
| 21 | +- **`POSTGRES_HOST`**: Hostname or IP address of the PostgreSQL server. |
| 22 | +- **`POSTGRES_PORT`**: Port for connecting to the PostgreSQL server (default: `5432`). |
| 23 | +- **`POSTGRES_DB`**: Name of the PostgreSQL database (default: `mobsf`). |
| 24 | + |
| 25 | +## Asynchronous Scan Queue |
| 26 | +- **`MOBSF_ASYNC_ANALYSIS`**: Enables asynchronous analysis when set to `1`. This is used to support Async task queues with DjangoQ2. |
| 27 | +- **`MOBSF_ASYNC_WORKERS`**: No of asynchronous scans supported at a time, default to 3 workers. |
| 28 | +- **`MOBSF_MULTIPROCESSING`**: Specifies multiprocessing mode (`billiard`, `thread`, `default`). |
| 29 | + |
| 30 | +## Tool Timeouts |
| 31 | +- **`MOBSF_JADX_TIMEOUT`**: Timeout in seconds for JADX operations (default: `1000`). |
| 32 | +- **`MOBSF_SAST_TIMEOUT`**: Timeout in seconds for static analysis (default: `1000`). |
| 33 | +- **`MOBSF_BINARY_ANALYSIS_TIMEOUT`**: Timeout in seconds for binary analysis (default: `600`). |
| 34 | + |
| 35 | +## Authentication and Rate Limiting |
| 36 | +- **`MOBSF_DISABLE_AUTHENTICATION`**: Disables authentication when set. |
| 37 | +- **`MOBSF_RATELIMIT`**: Rate limit for API requests (default: `7/m`). |
| 38 | +- **`MOBSF_API_ONLY`**: Enables REST API-only mode when set to `1`. The Web UI endpoints will be disabled. |
| 39 | +- **`MOBSF_API_KEY`**: Set a custom static authentication key for MobSF REST APIs. |
| 40 | +- **`MOBSF_API_KEY_FILE`**: Read REST API authentication key from a file (docker secrets mount). |
| 41 | + |
| 42 | +## Proxy Configuration |
| 43 | +- **`MOBSF_PROXY_IP`**: IP address for the HTTPS proxy run by MobSF(httptools) (default: `127.0.0.1`). |
| 44 | +- **`MOBSF_PROXY_PORT`**: Port for the HTTPS proxy run by MobSF(httptools) (default: `1337`). |
| 45 | + |
| 46 | +## Upstream Proxy Settings |
| 47 | +- **`MOBSF_UPSTREAM_PROXY_ENABLED`**: Enables upstream proxy support when set to `1`. |
| 48 | +- **`MOBSF_UPSTREAM_PROXY_SSL_VERIFY`**: Verifies SSL for upstream proxy when set to `1`. |
| 49 | +- **`MOBSF_UPSTREAM_PROXY_TYPE`**: Type of upstream proxy (default: `http`). |
| 50 | +- **`MOBSF_UPSTREAM_PROXY_IP`**: IP address for the upstream proxy (default: `127.0.0.1`). |
| 51 | +- **`MOBSF_UPSTREAM_PROXY_PORT`**: Port for the upstream proxy (default: `3128`). |
| 52 | +- **`MOBSF_UPSTREAM_PROXY_USERNAME`**: Username for upstream proxy authentication. |
| 53 | +- **`MOBSF_UPSTREAM_PROXY_PASSWORD`**: Password for upstream proxy authentication. |
| 54 | + |
| 55 | +## Static Analysis Configuration |
| 56 | +- **`MOBSF_DOMAIN_MALWARE_SCAN`**: Enables domain malware scan, defaults to `1`. |
| 57 | +- **`MOBSF_APKID_ENABLED`**: Enables APKiD scan, defaults to `1`. |
| 58 | +- **`MOBSF_DYLIB_ANALYSIS_ENABLED`**: Enables dylib analysis, defaults to `1`. |
| 59 | +- **`MOBSF_SO_ANALYSIS_ENABLED`**: Enables shared object analysis, defaults to `1`. |
| 60 | +- **`MOBSF_DEX2SMALI_ENABLED`**: Enables dex to smali conversion for Android binaries, defaults to `1`. |
| 61 | +- **`MOBSF_PERM_MAPPING_ENABLED`**: Enables permission to code mapping for Android scans, defaults to `1`. |
| 62 | +- **`MOBSF_NIAP_ENABLED`**: Enables NIAP scan when set to `1`. This is disabled by default. |
| 63 | +- **`MOBSF_CVSS_SCORE_ENABLED`**: Show CVSSV2 scores when set to `1`. This is disabled by default. |
| 64 | + |
| 65 | +## Dynamic Analysis Configuration |
| 66 | +- **`MOBSF_ANALYZER_IDENTIFIER`**: Android Debug Bridge (adb) compatible device identifier. |
| 67 | +- **`MOBSF_FRIDA_TIMEOUT`**: Frida connection timeout, defaults to `4` seconds. |
| 68 | +- **`MOBSF_ACTIVITY_TESTER_SLEEP`**: Wait defined seconds before invoking an activity, defaults to `4` seconds. This is used by Activity tester. |
| 69 | +- **`MOBSF_ADB`**: Specify the path to the `adb` binary that MobSF should use for Android dynamic analysis. |
| 70 | + |
| 71 | +## VirusTotal Integration |
| 72 | +- **`MOBSF_VT_ENABLED`**: Enables VirusTotal integration when set to `1`. |
| 73 | +- **`MOBSF_VT_API_KEY`**: API key for VirusTotal integration. |
| 74 | +- **`MOBSF_VT_UPLOAD`**: Enables file uploads to VirusTotal when set to `1`. Otherwise, only hash values are sent to VirusTotal. |
| 75 | + |
| 76 | +## Corellium Integration |
| 77 | +- **`MOBSF_CORELLIUM_API_DOMAIN`**: API domain for Corellium integration. |
| 78 | +- **`MOBSF_CORELLIUM_API_KEY`**: API key for Corellium integration. |
| 79 | +- **`MOBSF_CORELLIUM_PROJECT_ID`**: Project ID for Corellium integration (optional). |
| 80 | + |
| 81 | +## AppMonsta Integration |
| 82 | +- **`MOBSF_APPMONSTA_API`**: AppMonsta API key to fetch package details |
| 83 | + |
| 84 | +## SAML SSO Integration |
| 85 | +- **`MOBSF_IDP_METADATA_URL`**: Metadata URL for SAML IdP. |
| 86 | +- **`MOBSF_IDP_ENTITY_ID`**: Entity ID for SAML IdP. |
| 87 | +- **`MOBSF_IDP_SSO_URL`**: Single Sign-On (SSO) URL for SAML IdP. |
| 88 | +- **`MOBSF_IDP_X509CERT`**: X.509 certificate for SAML IdP. |
| 89 | +- **`MOBSF_IDP_IS_ADFS`**: Set ADFS as IdP when set to `1`. |
| 90 | +- **`MOBSF_SP_HOST`**: Hostname for SAML Service Provider (SP). |
| 91 | +- **`MOBSF_SP_ALLOW_PASSWORD`**: Enables password-based login for SAML SP when set to `1`. |
| 92 | + |
| 93 | +## Misc |
| 94 | +- **`EFR_01`**: Enables a custom enterprise feature request when set to `1`. |
| 95 | + |
| 96 | +This documentation provides a concise overview of all environment variables available for configuring MobSF. |
0 commit comments