The Data Theorem Mobile App Security Plugin can be used to upload PreProd mobile binaries directly to Data Theorem for scanning during your CI/CD Jenkins pipeline.
Overview
The current version of Data Theorem's Jenkins plugin is available on the Jenkins Index at https://plugins.jenkins.io/datatheorem-mobile-app-security.
The plugin is a post-build action that :
- Retrieves the mobile app binary generated during the building steps.
- Calls the Data Theorem Upload API to upload the mobile app binary directly to Data Theorem for scanning.
Step By Step Guide
Add the plugin to your Jenkins
Update the plugin
| |
Add your Upload API key to the Jenkins global configurationRetrieve your Upload API key using the Data Theorem portal at https://www.securetheorem.com/sdlc. The Upload API Key will be in the “API Key” section. Then, on the home page of your Jenkins instance, click on Credentials in the sidebar, and then navigate to System and click on Add credentials You will be able to create a Secret text credentials:
| |
Add or update a Jenkins jobGo back to the home page of your Jenkins instance and open the configuration page of the job that is used as the CI/CD pipeline of your iOS or Android application: From the configuration page you will have to modify multiple sections:
| |
Get access to your API KeyUse the Credential Binding Plugin to bind the API Key added in the previous step to an environment variable. The environment variable must be called: DATA_THEOREM_UPLOAD_API_KEY. | |
Add your building stepsBuild your sources using the Build section. You need to generate a valid .apk/.ipa package during this step. | |
Add your Data Theorem plugin to the jobThe Data Theorem plugin can be added from the Add post-build action list
If needed you can configure the plugin to hit your company proxy on the advanced option of Post-Build Actions. | |
Start a new build to test the pluginYou can test that the plugin is correctly configured by starting a new build and then access the last build result. If the plugin works you should get the following console output: | |
---|---|
Use the Data Theorem plugin inside a DSL pipeline (alternative way)
After the differents builds stages add a new stage: Upload Build To Data Theorem. You will have to set an environment variable with your secret upload api key using the command withCredentials() from the credential binding plugin
The plugin also support scripted pipeline integration, you will need to replace the DSL command with the following command: | Data Theorem DSL Pipeline example stage stage('Upload Build To Data Theorem') { steps { withCredentials([string(credentialsId: 'dt_upload_key', variable: 'DATA_THEOREM_UPLOAD_API_KEY')]) { sendBuildToDataTheorem buildToUpload: '{,**/}*android*.*', dontUpload: false, dataTheoremUploadApiKey: env.DATA_THEOREM_UPLOAD_API_KEY, proxyHostname:'',proxyPort: 0, proxyUsername:'', proxyPassword: '', proxyUnsecuredConnection: false } } } |