CI/CD Integrations
Finite State Continuous Integration and Continuous Delivery (CI/CD) integrations allow you to automatically upload your build artifacts to Finite State for analysis. This allows you to automatically scan your binaries and third party scan results for vulnerabilities and other issues as part of your build process.
Official CI/CD Plugins & Extensions
Github Actions Marketplace
Azure DevOps Marketplace Extensions
Other Official Plugins & Extensions
- Coming Soon: Jenkins
CI/CD Integrations using the SDK
- In the Finite State platform, create an Artifact to represent the files you will be uploading.
- Get the Artifact / Asset ID (it is at the end of this url: https://platform.finitestate.io/artifacts/123456789)
- Configure secrets in your CI/CD environment for the following:
FS_CLIENT_ID
- The CLIENT_ID for your API keyFS_CLIENT_SECRET
- The secret for your API keyFS_ORGANIZATION_CONTEXT
- The ID of the Organization you belong to
- Create your build artifact as normal as part of the CI/CD process
- Get a token for using the API, using the CLIENT_ID and CLIENT_SECRET
# Step 5: Get a token
import finite_state_sdk
# get the secrets from your environment
FS_CLIENT_ID = os.environ['FS_CLIENT_ID']
FS_CLIENT_SECRET = os.environ['FS_CLIENT_SECRET']
FS_ORGANIZATION_CONTEXT = os.environ['FS_ORGANIZATION_CONTEXT']
# get the token for using the API (it is valid for 24 hours)
token = finite_state_sdk.get_auth_token(FS_CLIENT_ID, FS_CLIENT_SECRET)
- Add a step in your build to upload to Finite State. Note the
quick_scan
option is set toTrue
which is especially useful for CI/CD environments.
For more details, see Binary Quick Scan
# Step 6: For a Binary Upload
asset_id = '123456789' # this won't change for each run
version_name = '1.0.0' # this will change based on your build
file_path = 'path/to/file' # the location where your build artifact is stored locally
response = finite_state_sdk.create_new_asset_version_and_upload_binary( \
token, FS_ORGANIZATION_CONTEXT, asset_id=asset_id, version=version_name, \
file_path=file_path, quick_scan=True)
print("Uploaded the binary for Finite State Binary Analysis")
- Your binary will automatically be scanned by Finite State Binary Analysis. You can check the status of the scan by using the
response
object from the previous step.