Skip to main content

Cosmo CLI

The Cosmo CLI is the official Command Line Interface that lets you interact with Cosmo. With the Cosmo CLI you can perform every operation enabled on the Cosmo platform (eg: create new scan or download reports).

Download

Download the latest version of the CLI for your OS from the release page of the official open source GitHub repository.

Usage

Using the CLI is simple. The base syntax is:

cosmo [command] [arguments]

All the CLI commands implemented are detailed in the table below:

DescriptionCommand
List usercosmo user list
List objectscosmo object list
Delete objectcosmo object delete <ID>
Create objectcosmo object new <NAME> <DESCRIPTION> <TAGS>...
List scanscosmo scan list
Delete scancosmo scan delete <ID>
Create scancosmo scan new --output <OUTPUT> --report <REPORT> <OBJECT_ID> <FILENAME> <SCAN_TYPE> <ANALYSIS_TYPES>...
info

All commands require access. This can be provided through an --api-key <API_KEY> argument to the command or set as the environment variable COSMO_API_KEY.

Features in detail

The Cosmo CLI allows you to perform all the actions described below.

List user

With this command you can verify what user is linked to an <API_KEY>.

cosmo --api-key <API_KEY> user list

List objects

With this command you can list objects associated with a user.

cosmo --api-key <API_KEY> object list

Delete object

With this command you can delete an object associated with a user.

cosmo --api-key <API_KEY> object delete <ID>

Create object

With this command you can create an object.

cosmo --api-key <API_KEY> object new <NAME> <DESCRIPTION> <TAGS>...

List scans

With this command you can list scans associated with a user.

cosmo --api-key <API_KEY> scan list

Delete scan

With this command you can delete a scan associated with a user.

cosmo --api-key <API_KEY> object delete <ID>

Create scan

info

Refer to this section of the documentation if you are unsure of what kind of file you should upload to Cosmo.

With this command you can ask Cosmo to start a new scan on the specified firmware image.

cosmo --api-key <API_KEY> scan new --output <OUTPUT> --report <REPORT> <OBJECT_ID> <FILENAME> <SCAN_TYPE> <ANALYSIS_TYPES>...
info

The optional --output argument is a file where all scan results get saved in JSON format. The optional --report argument is a file where an HTML scan overview report gets saved.

Supported analyses

All the supported analysis - for each firmware type - are listed below.

Linux/Container Analysis

UEFI Analysis

Vxworks Analysis

Supported firmware types

All the firmware type supported by the Cosmo CLI are listed below.

info

Types and subtypes are only required to create new scans using the scan new command.

typedescription
linuxGeneric Linux firmare image analysis
dockerFull Docker image analysis
lxcLXC container image analysis
uefiUEFI Bios analysis
vxworksVxWorks image analysis