The Mobile Security DevOps API can be used to upload pre-production and enterprise (internal) mobile binaries directly to Data Theorem for scanning.
This pages provides detailed documentation about how to use this API in order to upload mobile app binaries to Data Theorem. If you are trying to integrate Data Theorem scans into your existing CI/CD pipeline, a quickstart guide is available here – we may already have an integration that works with your CI/CD pipeline.
Uploading a mobile app binary is a two-step process:
The upload process can be initialized by calling this method.
Authentication is done by passing your organization’s Upload API key as part of the Authorization
header:
1 | Authorization: APIKey 1234567890abcdefgh |
The Upload API key can be retrieved by users in the Data Theorem portal by navigating to https://www.securetheorem.com/devsecops/scancicd
See API Conventions – Authentication and Authorization for more information.
POST /apis/mobile_security/devops/v1/upload_init
For example, this method can be called via curl using:
1 | curl -X POST -H "Authorization: APIKey AAAABBBBCCCCAJ82/iNaIQ==" --data "" https://api.securetheorem.com/apis/mobile_security/devops/v1/upload_init |
1 | { |
The response contains the upload_url
, to be used for uploading the mobile binary. This URL will only be valid for 10
minutes.
After retrieving the upload_url
, the mobile app binary should be sent as a multipart/form-data
request to upload the
file with the following arguments:
file
(file upload, required):release_type
(optional, but strongly encouraged):PRE_PROD
or ENTERPRISE
, depending on whether the app being uploaded is a pre-production
app (or a “test” app) or an enterprise (internal) app (an internal-only production app that will not be published to
one of the app stores).ENTERPRISE
or
PRE_PROD
apps. If there is no matching app, then it will default to PRE_PROD
.username
(optional):password
(optional):comments
(optional):release_id
(optional):release_id
.platform_variant
(optional):IOS_ON_MAC
: Scan an iOS build on an Apple Silicon Mac instead of on an iOS device, in order to exercise code
paths that are specific to Macs.WATCHOS
: Scan a watchOS build.VISIONOS
: Scan a visionOS build.external_id
(optional):external_id
field represents your organization’s custom identifier for the app, if any.sourcemap
(file upload, optional):mapping.txt
file for deobfuscating Android binaries.PRE_PROD
or ENTERPRISE
Android app, future uploads of the same
app will also require a mapping file. See How To Enable De-obfuscation of Android Scan Results Using A Mapping
File for more information.is_enterprise_internal
(optional, deprecated):release_type
of ENTERPRISE. It is ignored if release_type
is
specified.Since the upload_url
is unique for each upload, there is no need to authenticate with the Upload API Key.
POST {upload_url}
The request must be a standard multipart file upload, the mobile app binary is expected in the file
field.
For example, this method can be called via curl using:
1 | curl \ |
Note: Pay special attention to the @
character. It needs to be put in front of the file’s name for curl to upload
the file.
If you need to submit a sourcemap
file, it should also be provided as a file upload:
1 | curl \ |
A successful upload returns a status code 200 and status text ok
.
1 | { |
The mobile_app_id
and scan_id
fields contain identifiers that can later be used to query the state of the scan started for the uploaded app build.
Errors are also usually JSON formatted.
1 | { |
200
/ok
: upload succeed401
/unauthorized
: unauthorized (bad credentials or the url may have expired)403
/mobile_app_has_no_subscription
: this mobile app has no active subscription, please contact Data Theorem415
/unauthorized_package_extension
: unauthorized extension, must be ipa
/apk
/xap
/appx
/aab
, case-insensitive422
/package_corrupted
: package corrupted500
/error
: internal server error