Skip to main content

New CLI

Overview​

The New Conviso CLI is a command-line interface to interact with the Conviso Platform via GraphQL. It is designed for local use and CI/CD workflows.

Requirements​

  • Python 3.9+
  • Environment variable CONVISO_API_KEY (shell or .env)
  • Optional: CONVISO_API_TIMEOUT (seconds, default 30)

Project structure​

  • conviso/app.py: Typer entrypoint; registers subcommands.
  • conviso/commands/: CLI commands (projects, assets, requirements, vulnerabilities).
  • conviso/clients/: API clients (GraphQL).
  • conviso/core/: shared utilities (logging, notifications, output manager).
  • conviso/schemas/: table schemas/headers for consistent output.

Install (local)​

pip install -r requirements.txt

Or run the module directly:

python -m conviso.app --help

Usage examples​

  • Projects:
    python -m conviso.app projects list --company-id 443 --all
  • Assets:
    python -m conviso.app assets list --company-id 443 --tags cloud --attack-surface INTERNET_FACING --all
  • Requirements:
    python -m conviso.app requirements create --company-id 443 --label "Req" --description "Desc" --activity "Login|Check login"
  • Vulnerabilities:
    python -m conviso.app vulns list --company-id 443 --severities HIGH,CRITICAL --asset-tags cloud --all

Output options: --format table|json|csv, --output <path> to save JSON/CSV.

Behavior and notes​

  • GraphQL errors return exit code 1.
  • Use --all on list commands to fetch every page.
  • --quiet silences info logs; --verbose shows per-page requests when paginating.
  • On startup, the CLI checks for a newer version via the repository VERSION file.
    • Set CONVISO_CLI_SKIP_UPDATE_CHECK=1 to skip.
    • Without network access, the check warns; you can override with CONVISO_CLI_REMOTE_VERSION.
  • Upgrade: python -m conviso.app upgrade (equivalent to conviso upgrade) runs git pull --ff-only in the repo directory.
    • If installed via pip, run pip install . after the pull.

SBOM​

  • List:
    python -m conviso.app sbom list --company-id 443 --name log4j --all --format csv --output sbom.csv
  • Filters: --name, --vulnerable-only, --asset-ids, --tags, --sort-by, --order, pagination (--page/--per-page/--all).
  • Import:
    python -m conviso.app sbom import --company-id 443 --file bom.cdx --asset-id 123
    --asset-id is required and the backend infers format.
  • Formats: table/CSV/JSON/CycloneDX for list (--format cyclonedx).
  • Check vulnerabilities (OSV):
    • Using API:
      python -m conviso.app sbom check-vulns --company-id 443 --asset-ids 123 --tags foo --format json --output osv.json
    • Using CycloneDX file:
      python -m conviso.app sbom check-vulns --file bom.cdx --format json --output osv.json
    • Defaults to table output; use --format json for JSON (with or without --output).

Bulk CSV (assets)​

Command:

python -m conviso.app bulk assets --company-id 443 --file assets.csv --op create|update|delete [--force] [--preview-only]

Headers (CSV columns):

ColumnRequiredValues / Format
idupdate/delete onlyInteger ID (column name configurable via --id-column)
namecreate/updateText
businessImpactoptionalLOW, MEDIUM, HIGH, NOT_DEFINED
dataClassificationoptionalPII, PAYMENT_CARD_INDUSTRY, NON_SENSITIVE, NOT_DEFINED
tagsoptionalComma-separated, e.g. tag1,tag2
attackSurfaceoptionalINTERNET_FACING, INTERNAL, NOT_DEFINED

Examples:

Create:

name,businessImpact,dataClassification,tags,attackSurface
Asset A,HIGH,NON_SENSITIVE,"tag1,tag2",INTERNET_FACING

Update/Delete:

id,name,businessImpact
123,Asset A Updated,MEDIUM

Behavior:

  • Always runs a dry-run first and shows a report.
  • Use --force to apply without confirmation; otherwise you will be prompted after dry-run.
  • Use --preview-only to exit after dry-run without applying.

Bulk CSV (requirements)​

Command:

python -m conviso.app bulk requirements --company-id 443 --file reqs.csv --op create|update|delete [--force] [--preview-only]

Headers (CSV columns):

ColumnRequiredValues / Format
idupdate/delete onlyInteger ID (column name configurable via --id-column)
labelcreate/updateText
descriptioncreate/updateText
globaloptionaltrue/false
activitiesoptionalSemicolon-separated, each activity uses `label

Examples:

Create:

label,description,global,activities
Requirement A,Do X,true,"Login|Check login|1|REF||Category||123|1;Logout|Check logout|1"

Update/Delete:

id,label,description
123,Requirement A Updated,Do Y

Bulk CSV/SARIF (vulnerabilities)​

Command:

python -m conviso.app bulk vulns --company-id 443 --file vulns.csv --op create|update|delete [--force] [--preview-only] [--sarif]

Types: WEB, NETWORK, SOURCE. CSV by default; use --sarif to import from SARIF (fields compatible with the table). --sarif-asset-field <field> sets where to read the asset (name or id). If the asset does not exist, the CLI creates it automatically for the company.

Template helper: python -m conviso.app bulk vulns --show-template

Headers (CSV columns):

ColumnRequiredValues / Format
typecreateWEB, NETWORK, SOURCE
assetIdcreateInt
titlecreateText
descriptioncreateText
solutioncreateText
impactLevelcreateImpactLevelCategory (e.g., HIGH)
probabilityLevelcreateProbabilityLevelCategory (e.g., MEDIUM)
severitycreateNOTIFICATION, LOW, MEDIUM, HIGH, CRITICAL
summarycreateText
impactDescriptioncreateText
stepsToReproducecreateText
referenceoptionalText/URL
categoryoptionalText
projectIdoptionalInt
statusoptionalIssueStatusLabel
compromisedEnvironmentoptionaltrue/false
method (WEB)WEBHTTPMethod (GET, POST, ...)
scheme (WEB)WEBSchemeCategory (HTTP, HTTPS)
url (WEB)WEBString
port (WEB/NETWORK)WEB/NETWORKInt
request (WEB)WEBString
response (WEB)WEBString
parameters (WEB)WEB optionalString
address (NETWORK)NETWORKString (host/IP)
protocol (NETWORK)NETWORKString
attackVector (NETWORK)NETWORKString
fileName (SOURCE)SOURCEString
vulnerableLineSOURCEInt
firstLineSOURCEInt
codeSnippetSOURCEString
sourceSOURCE optionalString
sinkSOURCE optionalString
commitRefSOURCE optionalString
deployIdSOURCE optionalString

Example (WEB create):

type,assetId,title,description,solution,impactLevel,probabilityLevel,severity,summary,impactDescription,stepsToReproduce,method,scheme,url,port,request,response
WEB,12345,XSS,"desc","fix",HIGH,MEDIUM,HIGH,"summary","impact","steps",GET,HTTPS,https://app/login,443,"GET /login","HTTP/1.1 200"

Example (update/delete):

CSV export from vulns list --format csv can be used for update/delete. Use column id or issueId. Types are inferred. --sarif-asset-field controls where to read the asset in SARIF; if the asset does not exist, the CLI creates it automatically.

Contribute to the Docs

Found something outdated or missing? Help us improve the documentation with a quick suggestion or edit.

How to contribute

Resources

By exploring our content, you'll find resources that will enhance your understanding of the importance of a Security Application Program.

Conviso Blog: Explore our blog, which offers a collection of articles and posts covering a wide range of AppSec topics. The content on the blog is primarily in English.

Conviso's YouTube Channel: Access a wealth of informative videos covering various topics related to AppSec. Please note that the content is primarily in Portuguese.