💥 Override configuration
You can override the configuration of your application on Escape by passing a partial JSON configuration. This configuration will be merged with the one on Escape using the deepmerge algorithm.
info
You can learn more about configuring your application on Escape here.
- GitHub Action
- Gitlab CI
- Bitbucket Pipelines
- CircleCI
- Jenkins Pipeline
- Azure DevOps
- CLI
- API
# https://github.com/Escape-Technologies/action
name: Post Deploy
on:
push:
branches:
- staging
jobs:
Escape:
runs-on: ubuntu-latest
steps:
- name: Escape Scan
uses: Escape-Technologies/action@v0
with:
application_id: ${{ secrets.ESCAPE_APPLICATION_ID }}
api_key: ${{ secrets.ESCAPE_API_KEY }}
configuration_override: '{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
# configuration_override_path: ./configuration_override.json # you can also use a file
Escape:
stage: post-deploy
needs:
- deploy # name of your deployment job
variables: # you can find those secrets directly in your Escape Application Settings
- ESCAPE_APPLICATION_ID: $ESCAPE_APPLICATION_ID
- ESCAPE_API_KEY: $ESCAPE_API_KEY
- CONFIGURATION_OVERRIDE: '{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
- # CONFIGURATION_OVERRIDE_PATH: ./configuration_override.json # you can also use a file
image: node:alpine
before_script:
- npm install -g @escape.tech/action
- npm show @escape.tech/action version
script:
- escape-action
allow_failure: true
only:
refs:
- staging
image: node:alpine
pipelines:
default:
- step:
name: Deploy
script:
# Your deployment scripts here
- step:
name: Escape
trigger: manual # Set to manual if you wish to run this step manually
after-script: # Similar to post-deploy in GitLab
- npm install -g @escape.tech/action
- npm show @escape.tech/action version
- escape-action
deployment: staging # Assuming staging environment for deployment
script:
- echo "Starting Escape scan..."
services:
- docker
caches:
- node
size: 2x
max-time: 10
variables:
ESCAPE_APPLICATION_ID: $ESCAPE_APPLICATION_ID
ESCAPE_API_KEY: $ESCAPE_API_KEY
CONFIGURATION_OVERRIDE: '{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
# CONFIGURATION_OVERRIDE_PATH: ./configuration_override.json # Uncomment if you're using a file for configuration override
version: 2.1
jobs:
deploy:
docker:
- image: node:alpine
steps:
- checkout
# Your deployment steps here
escape_scan:
docker:
- image: node:alpine
steps:
- checkout
- run:
name: Install Escape CLI
command: |
npm install -g @escape.tech/action
npm show @escape.tech/action version
- run:
name: Run Escape Scan
command: escape-action
environment:
ESCAPE_APPLICATION_ID: $ESCAPE_APPLICATION_ID
ESCAPE_API_KEY: $ESCAPE_API_KEY
CONFIGURATION_OVERRIDE: '{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
# CONFIGURATION_OVERRIDE_PATH: ./configuration_override.json # Uncomment if you're using a file for configuration override
workflows:
version: 2
deploy_and_scan:
jobs:
- deploy
- escape_scan:
requires:
- deploy
filters:
branches:
only: staging
pipeline {
agent {
docker {
image 'node:alpine'
}
}
environment {
ESCAPE_APPLICATION_ID = credentials('ESCAPE_APPLICATION_ID')
ESCAPE_API_KEY = credentials('ESCAPE_API_KEY')
CONFIGURATION_OVERRIDE = '{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
// CONFIGURATION_OVERRIDE_PATH = './configuration_override.json' // Optional, you can also use a file
}
stages {
stage('Checkout') {
steps {
checkout scm // Checkout the codebase from the SCM provider
}
}
stage('Post-Deploy') {
when {
branch 'staging' // Only run on the 'staging' branch
}
steps {
script {
// Install the Escape CLI tool
sh 'npm install -g @escape.tech/action'
// Show the installed Escape CLI version
sh 'npm show @escape.tech/action version'
// Run the Escape action
sh 'escape-action'
}
}
post {
always {
// Configuration to allow failure
}
}
}
}
}
trigger:
branches:
include:
- staging
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: EscapeScan
displayName: 'Escape Scan'
dependsOn: deploy # Assuming you have a 'deploy' job defined elsewhere in your Azure DevOps pipeline.
variables:
ESCAPE_APPLICATION_ID: $(EscapeAppId) # Define these in the Azure DevOps Pipeline environment variables or in a variable group.
ESCAPE_API_KEY: $(EscapeApiKey)
CONFIGURATION_OVERRIDE: '{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
# CONFIGURATION_OVERRIDE_PATH: ./configuration_override.json # Uncomment if you want to use a file.
steps:
- script: |
sudo npm install -g @escape.tech/action
npm show @escape.tech/action version
escape-action
displayName: 'Run Escape Action'
env:
ESCAPE_APPLICATION_ID: $(EscapeAppId)
ESCAPE_API_KEY: $(EscapeApiKey)
CONFIGURATION_OVERRIDE: $(CONFIGURATION_OVERRIDE)
# CONFIGURATION_OVERRIDE_PATH: $(CONFIGURATION_OVERRIDE_PATH) # Uncomment if you want to use a file.
continueOnError: true
export ESCAPE_APPLICATION_ID=<YOUR APPLICATION ID>
export ESCAPE_API_KEY=<YOUR API KEY>
export CONFIGURATION_OVERRIDE='{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
# export CONFIGURATION_OVERRIDE_PATH="./configuration_override.json" # you can also use a file
npm i -g @escape.tech/action
escape-action
export APPLICATION_ID=<YOUR APPLICATION ID>
export API_KEY=<YOUR API KEY>
export CONFIGURATION_OVERRIDE='{"users":{"user1":{"auth":"schema1","headers":{"Authorization":"<YOUR_AUTH>"}}},"auth":{"schema1":{"tech":"manual"}}}'
# export CONFIGURATION_OVERRIDE_PATH="./configuration_override.json" # you can also use a file
curl -X POST \
-H "Authorization: Key $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"configurationOverride\": $CONFIGURATION_OVERRIDE }"
https://public.escape.tech/applications/$APPLICATION_ID/start-scan