Introduction
Prerequisites
Getting Started
Configure
Usage
Introduction
The NowSecure CLI is a tool that provides users with an alternative way to interact with the NowSecure Platform. The NowSecure CLI is a command line interface that enables users to perform a variety of tasks including:
- Uploading apps to NowSecure Platform
- Accessing assessment data
- Managing your NowSecure organization, including sending invitations
Prerequisites
The following is needed to use the ns-cli
:
- A valid NowSecure Platform account.
- A valid NowSecure Platform API token. Instructions on how to acquire an API token is in the Creating an API Bearer Token in Platform article.
- If you are using a single tenant deployment of NowSecure Platform, specify the URLs of your deployment during configuration. Have the following URLs available:
- NowSecure Platform REST API- URL that access the NowSecure Platform API:
lab-api.<tenant>.nowsecure.com
- NowSecure Graph API- URL that accesses the NowSecure Graph API:
api.<tenant>.nowsecure.com
- NowSecure Platform UI- URL that accesses the NowSecure Platform UI:
app.<tenant>.nowsecure.com
if using the new "Rainier" NowSecure UI orlab.<tenant>.nowsecure.com
if using the Classic NowSecure UI.
- NowSecure Platform REST API- URL that access the NowSecure Platform API:
Getting Started
Install
- Download the NowSecure Platform CLI from this GitHub repo. You may also download the binaries directly from this artifact link.
Note: Be sure you are signed in to your GitHub account prior to accessing the link, otherwise you may not be prompted with the download. - The download contains two .pkg files, arm64 (Apple Silicon) and x64 (Intel). Right click the desired .pkg file and select Run.
Configure
- After the
ns-cli
has been installed on your system, runns-cli configure
to configure the CLI with your NowSecure Platform account. - The first prompt asks to enter the profile you are using. Select enter for the default profile of default.
Note: Most users will only need to use the default profile. - The next prompt asks for the Platform API token. Paste the token into the field provided and select enter.
- The next prompt asks for the GraphQL endpoint for the NowSecure Platform. Select enter if you are using the CLI to interact with the default production instance of NowSecure Platform.
If you are using a single tenant deployment of NowSecure Platform, enter the URL of your GraphQL endpoint in this format:api.<tenant>.nowsecure.com.
- The next prompt asks for the REST endpoint for the NowSecure Platform. Select enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, enter the URL of your REST endpoint in this format:
lab-api.<tenant>.nowsecure.com.
- The next prompt will ask you to enter the UI Server for the NowSecure Platform. Select enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, enter the URL of your UI server in this format:
app.<tenant>.nowsecure.com.
- The next and final prompt asks if you are using the Rainier or Classic UI. By default Rainier is recommended.
Once completed, verify the CLI functions as expected by running ns-cli app list
. A listing of the apps in your platform account will be displayed. To return results in JSON format, run ns-cli app list --json
Usage
Running ns-cli help
provides a top level list of the available CLI options.
Version |
@nowsecure/cli/1.0.0-alpha.2 darwin-arm64 node-v16.19.1 |
Usage |
|
Commands | |
|
commands to manipulate apps for analysis |
|
commands to retrieve assessment data |
|
displays autocomplete installation instructions |
|
configures the CLI with your NowSecure Platform account |
|
displays help for ns-cli |
|
commands for the user's organization |
|
lists installed plugins |
|
commands for users and accounts |
Command Options
App options
App commands provide steps to manipulate app binaries for analysis. Use the --help
option to get more details on each of the options.
The following app commands are available:
ns-cli app archive
Allows archive or unarchive an app that was uploaded to NowSecure Platformns-cli app config
Retrieves the analysis configuration for an application that has been uploaded to NowSecure Platformns-cli app create
Creates an app resource without a binaryns-cli app last-assessment
Shows the details and findings of an assessment based on platform (ios or android) and package name (com.facebook.katana). If the app exists in multiple groups, provide the group reference using the-g
or--group
optionns-cli app list
Lists available applications in your platform accountns-cli app process
Uploads and analyze an app binaryns-cli app update
Updates the app's analysis configurationns-cli app upload
Uploads an app binaryns-cli app vulnerabilities
Shows app vulnerabilities
Assessment options
Assessment commands are used to interact with assessments created in in NowSecure Platform. Use the --help
option to get more details on each of the options.
The following commands are available:
ns-cli assessment cancel
Cancels a running assessmentns-cli github-snapshot
Creates a SARIF report from an assessmentns-cli assessment list
Lists assessments in your NowSecure Platform accountns-cli assessment raw
Gets the raw data for an assessmentns-cli assessment sarif
Creates a SARIF report from an assessmentns-cli assessment show
Shows the details and findings of an assessmentns-cli assessment start
Starts an assessment
Autocomplete options
Running ns-cli autocomplete
provides details on how to integrate the ns-cli into your .zshrc to perform autocomplete actions
Configure options
ns-cli configure
is described above in the Configure section.
Help options
ns-cli help
provides help for the ns-cli.
Organization options
Organization commands provide steps that can be used to manipulate an organization within NowSecure Platform. Use the --help
option to get more details on each of the options.
The following commands are available:
ns-cli organization groups
Returns the groups that have been configured in an NowSecure Platform organizationns-cli organization invitations
Lists invitations that have been created within your NowSecure Platform organizationns-cli organization invite
Creates an invitation to add someone to your NowSecure Platform organizationns-cli organization revoke-invitation
Revokes an invitation that has been created in your NowSecure Platform organizationns-cli organization users
Lists the users that exist in your NowSecure Platform organization
Plugins options
The ns-cli plugins
option will list plugins that have been added to the ns-cli
User options
User commands provide steps that can be used to manipulate users within NowSecure Platform. Use the --help
option to get more details on each of the options.
The following commands are available:
ns-cli user account
Lists the user details from NowSecure Platform for the user account that was used to create the token that the ns-cli has been configured to usens-cli user groups
Lists the NowSecure Platform group membership for the user account that was used to create the token from which the ns-cli has been configured
Comments
Article is closed for comments.