Cosca (Combo Scanner) is an Application Security automation tool that invokes third-party scanners and processes their outputs β all with a single command.
# Scan website, Docker image and repo. Write the summary in a PDF and zip the reports python3 cosca.py \ -t https://ginandjuice.shop \ bkimminich/juice-shop:latest \ https://github.com/juice-shop/juice-shop \ -o pdf zip
[Edited for brevity β no output or logic was altered.]
Cosca takes advantage of appsec scanners that offer their official docker version. It identifies each type of target and invokes the appropiate scanners. Possible target types included from scratch: directory, website, API, Github repository and docker image. A combination of scanners and types of targets for a particular purpose are called combos and are defined in the file combos.json that can be customized. Implemented scanners so far:
- Kics (IaC)
- CycloneDX + Grype (SBOM generation and scanning)
- Syft + Grype (SBOM generation and scanning)
- Semgrep (SAST)
- ZAP (API, website)
- Dastardly (website)
- Trivy (containers)
- Trufflehog (secrets)
- π³ Docker-based β easy to run and isolate
- βοΈ Simple β minimal setup, no fluff
- π Scalable β add new scanners and output handlers with ease
- ποΈ Customizable β define scan combos and parameterize tools to fit your workflow
- π§ͺ Built on niche scanners β leverages specialized tools for targeted analysis
- π Unified scanning β Scan any type of asset with a consistent approach: directories, repositories, containers, websites, or APIs.
- π³ Always up-to-date β Docker-based scanners ensure you're using the latest official versions straight from trusted registries.
- π§Ύ Flexible output handling β Choose how you want the results: console output, ZIP archives, JSON reports, PDFs, or even direct import into DefectDojo.
- βοΈ Run it anywhere β Works seamlessly from your local machine, CI/CD pipelines, or any Docker-capable environment.
- π οΈ Fully extensible β Easily add new scan combos, integrate custom scanners, or define your own output handlers.
- π§ Local project analysis β Generate an SBOM, scan dependencies, and analyze source code for any project in a local directory.
- π Full-stack scanning β Scan source code, Docker images, and the live website of a web project, and instantly review the results in DefectDojo.
- π΅οΈββοΈ Secret detection automation β Quietly scan source code for leaked secrets using --quiet and pipe the output to tools like jq for automated response.
- π Assess legacy security debt β Quickly evaluate the security posture of outdated or legacy projects.
- π CI/CD integration β Scan all assets involved in a deployment during CI/CD, generate reports, and optionally block the pipeline if criteria arenβt met.
- π§© Third-party code review β Identify obvious risks in third-party code before integration.
- π Vulnerability management workflows β Automate scanning, track results, perform rescans, compare reports over time, and communicate findings effectively.
git clone git@github.com:jbeduino/cosca.gitpython3 -m venv venv source venv/bin/activatepip install -r requirements.txtgit clone https://github.com/juice-shop/juice-shop.git /tmp/juice-shop-masterTo import the results into DefectDojo, set DEFECTDOJO_URL and DEFECTDOJO_API_KEY environment variables as a minimum.
export DEFECTDOJO_URL=https://demo.defectdojo.org export DEFECTDOJO_API_KEY=XXXXXXXYou can also add more preferences: DEFECTDOJO_ENGAGEMENT_ID, DEFECTDOJO_PRODUCT_ID and DEFECTDOJO_PRODUCT_TYPE_ID. The demo site of DefectDojo can be used for tests. Log in with username admin and password 1Defectdojo@demo#appsec as stated here and copy the API KEY from API V2 Section.
Don't scan sensitive data in your tests with DefectDojo demo site.
# Scan local directory with source code, the deployed web application and a related Docker image. python3 cosca.py -t /tmp/juice-shop-master https://ginandjuice.shop bkimminich/juice-shop:latest -o pdf zip defectdojo Scans a local directory containing source code, a website, and a Docker image. It then generates a PDF report, a ZIP archive, and creates a DefectDojo entry with all the findings β following these steps:
-
Target identification β Detects the type of each target: directory, Docker image, website, OpenAPI, GraphQL, SOAP, or GitHub repository.
-
Combo selection β Loads the appropriate scanners based on the selected configuration in combos.json.
-
Scan execution β Runs the relevant scanners against each target.
-
Result aggregation β Collects and merges the outputs from all scanners.
-
Report generation β Creates the final deliverables: PDF report, ZIP file, and pushes findings to DefectDojo.
-
Can I add another scanner?
Yes, inherit your class from Scanner (scanner.py), and place your scanner implementation in the scanners/ folder. -
Can I add another output handler?
Yes, inherit your class from OutputHandler (output_handler.py), and place your output handler implementation in the output_handlers/ folder. -
Can I define a custom combination of scanners?
Yes, add an entry to combos.json and run Cosca with--combo <your-combo-name>. -
Why included 2 different SBOM generators (Syft and CdxGen)?
CdxGen generates CycloneDX, the de facto standard for SBOMs. In contrast, Syft offers a lightweight but more limited alternative, which, for example, does not support pyproject.toml.
