The KhulnaSoft CLI provides a command line interface on top of the KhulnaSoft Engine REST API.
Using the KhulnaSoft CLI users can manage and inspect images, policies, subscriptions and registries for the following:
Supported Operating Systems
- Alpine
- Amazon Linux 2
- CentOS
- Debian
- Google Distroless
- Oracle Linux
- Red Hat Enterprise Linux
- Red Hat Universal Base Image (UBI)
- Ubuntu
Supported Packages
- GEM
- Java Archive (jar, war, ear)
- NPM
- Python (PIP)
The KhulnaSoft CLI can be installed from source using the Python pip utility
git clone https://github.com/khulnasoft-lab/khulnasoft-cli cd khulnasoft-cli pip install --user --upgrade .
Or can be installed from the installed form source from the Python PyPI package repository.
yum install epel-release yum install python-pip pip install khulnasoftcli
apt-get update apt-get install python-pip pip install khulnasoftcli Note make sure ~/.local/bin is part of your PATH or just export it directly: export PATH="$HOME/.local/bin/:$PATH"
Use Python's pip package manager:
sudo easy_install pip pip install --user khulnasoftcli export PATH=${PATH}:${HOME}/Library/Python/2.7/bin
To ensure khulnasoft-cli is readily available in subsequent terminal sessions, remember to add that last line to your shell profile (.bash_profile or equivalent).
To update khulnasoft-cli later:
pip install --user --upgrade khulnasoftcli
By default the KhulnaSoft CLI will try to connect to the KhulnaSoft Engine at http://localhost/v1
with no authentication.
The username, password and URL for the server can be passed to the KhulnaSoft CLI as command line arguments.
--u TEXT Username eg. admin --p TEXT Password eg. foobar --url TEXT Service URL eg. http://localhost:8228/v1
Rather than passing these parameters for every call to the cli they can be stores as environment variables.
KHULNASOFT_CLI_URL=http://myserver.example.com:8228/v1 KHULNASOFT_CLI_USER=admin KHULNASOFT_CLI_PASS=foobar
Add an image to the KhulnaSoft Engine
khulnasoft-cli image add docker.io/library/debian:latest
Wait for an image to transition to analyzed
khulnasoft-cli image wait docker.io/library/debian:latest
List images analyzed by the KhulnaSoft Engine
khulnasoft-cli image list
Get summary information for a specified image
khulnasoft-cli image get docker.io/library/debian:latest
Perform a vulnerability scan on an image
khulnasoft-cli image vuln docker.io/library/debian:latest os
Perform a policy evaluation on an image
khulnasoft-cli evaluate check docker.io/library/debian:latest --detail
List operating system packages present in an image
khulnasoft-cli image content docker.io/library/debian:latest os
Subscribe to receive webhook notifications when new CVEs are added to an update
khulnasoft-cli subscription activate vuln_update docker.io/library/debian:latest
For further details on use of the KhulnaSoft CLI with the KhulnaSoft Engine please refer to KhulnaSoft Engine