Sign inSign up

edgescan/cicd-integration

By edgescan

Updated over 2 years ago

This image allows to kick off an assessment on Edgescan and fails/succeeds according to its result.

Image
0

2.0K

edgescan/cicd-integration repository overview

Edgescan CI/CD integration

This image allows the user to:

  1. Kick off an assessment and fails/succeeds according to its result.

    It succeeds if the assessment completes with no vulnerabilities found (a tolerance for the risk level can be provided), it fails otherwise.

    When it's not waiting for the scan to finish it succeeds once the assessment is started.

    The program will exit with value 0 on success and -1 otherwise.

  2. Create a new asset. Optionally:

    • Add locations.
    • Assign licence.
    • Kick off assessment on the new asset as in step 1.

Getting started

Fetch the latest Docker image

docker pull edgescan/cicd-integration:latest

Execute the Docker image and append --help for details about its usage

docker run --tty edgescan/cicd-integration --help

Configuration can be provided in 3 ways (in order of priority)

1. CLI flags
2. YAML configuration file
3. Environment variables
ParameterCommand line flagField name in configuration fileEnvironment variable nameDefault valueRequired
Shared Options
API Token--api-tokenapi_tokenES_API_TOKENNoneTrue
Base URL--base-urlbase_urlES_BASE_URL"https://live.edgescan.com"False
Color--color / --no-colorcolorCOLORTrueFalse
Proxy--proxyproxyPROXYNoneFalse
Fail on Open Vulns--fail-on-vulns / --pass-on-vulnsfail_on_vulnsFAIL_ON_VULNSTrueFalse
Scanning Options
Start scanning--start-scanstart_scanSTART_SCANNoneTrue
Asset ID--asset-idasset_idES_ASSET_IDNoneTrue
Max Risk Threshold--max-risk-thresholdmax_risk_thresholdMAX_RISK_THRESHOLD3False
Wait--wait / --no-waitwaitWAITTrueFalse
New Asset Options
Create asset--create-assetcreate_assetCREATE_ASSETNoneTrue
Asset Name--namenameNAMENoneTrue
Asset Type--typetypeTYPENone ("app" or "net")True
New Locations--locationslocationsLOCATIONSNoneFalse
Licence Name--licence-namelicence_nameLICENCE_NAMENoneFalse
Order ID--order-idorder_idORDER_IDNoneFalse
Licence UUID--licence-uuidlicence_uuidLICENCE_UUIDNoneFalse

Execute the Docker image

Executing with the command line interface

docker run --tty edgescan/cicd-integration --start-scan --asset-id 1234 --api-token th34p1t0ken

Executing with a YAML config file

docker run --tty -v /local/path/to/file.yml:/cicd-config.yml edgescan/cicd-integration

Executing with an environment variable file

docker run --tty --env-file .env edgescan/cicd-integration

Executing with all 3 methods

docker run --tty -v /path/to/file.yml:/cicd-config.yml --env-file .env edgescan/cicd-integration --asset-id 1234

Execution Examples using the CLI

Start scan on an asset, and wait for the results
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" --start-scan --asset-id 5678 --wait --max_risk_threshold 3
Start scan on an asset, and do not wait for the results
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" --start-scan --asset-id 5678 --no-wait max_risk_threshold 3
Create an asset, without locations, or a licence
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "app"
Create an asset, with locations, and no licence
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com,https://test.example.com"
Create an asset, with locations, and a V2 licence
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com,https://test.example.com" --licence_name "Licence Name" --order_id 123
Create an asset, with locations, and a V3 licence
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com,https://test.example.com" --licence_uuid "Licence UUID"
Create an asset, with locations, and a V2 licence. Start a scan on the asset and do not wait for results
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com" --licence_name "Licence Name" --order-id 123 --start-scan --no-wait
Create an asset, with locations, and a V3 licence. Start a scan on the asset and do not wait for results
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com" --licence_uuid "Licence UUID" --start-scan --no-wait
Create an asset, with locations, and a V2 licence. Start a scan on another asset and wait for results
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com" --licence_name "Licence Name" --order-id 123 --start-scan --asset-id 456 --wait
Create an asset, with locations, and a V3 licence. Start a scan on another asset and wait for results
docker run --tty edgescan/cicd-integration --api-token "4p1t0k3n|1234" ---create-asset --name "Test Asset" --type "net" --locations "test.example.com" --licence_uuid "Licence UUID" --start-scan --asset-id 456 --wait

Tag summary

Content type

Image

Digest

sha256:c733097fc

Size

340 MB

Last updated

over 2 years ago

docker pull edgescan/cicd-integration