Deploy K2Components

Deploy K2Components mode will only deploy the K2agent.

Deploy K2 Components

Deploy K2 Component validates the environment and installs K2 component on the machine.

Options

Option

Description

--k2email

Provide the registered K2 email. The default value is set to installer@k2io.com.

--k2password

Provide the password corresponding to the registered K2 email.

--k2GroupName

Provide the Policy group name. The default is set to IAST.

--k2GroupEnv

Provide the Deployment environment of the policy group name other than PRODUCTION. The default is set to IAST.

--k2Cloud

Provide the K2 cloud URL. By default, it is set to https://k2io.net.

--k2icDirectoryPath

The directory path where you want all the K2 related stuff to be downloaded. Default value is set to ${HOME}/k2-ic

--config

Provide the config file path. How to setup config file?

Commands

  • Command to display the help page:

$ k2hackbot deploy-k2component --help
  
  --k2email TEXT            Provide K2 Registered Email
                            
                            Eg. k2hackbot deploy-k2component --k2email
                            demo@example.com

  --k2password TEXT         Provide K2 Registered Email's Password
                            
                            Eg. k2hackbot deploy-k2component --k2password
                            PASSWORD

  --k2GroupName TEXT        K2 Group name.
                            
                            Eg. k2hackbot deploy-k2component --k2GroupName
                            MY-K2-GROUP

  --k2GroupEnv TEXT         K2 Group deployment Environment
                            
                            Eg. k2hackbot deploy-k2component --k2GroupEnv
                            STAGING

  --k2Cloud TEXT            Provide K2Cloud URL if required
                            
                            Eg. k2hackbot deploy-k2component --k2Cloud
                            https://mycloud.com

  --k2icDirectoryPath TEXT  Provide path for k2-ic directory
                            
                            Eg. k2hackbot deploy-k2component
                            --k2icDirectoryPath /home/my_k2_dir

  --config FILE             Read configuration from FILE.
  --help                    Show this message and exit.
  • Command to deploy K2 component using default values:

k2hackbot deploy-k2component
  • Command to deploy K2 component using custom values for each option:

k2hackbot deploy-k2component --k2email 'demo@example.com' --k2password 'password' --k2GroupName 'MY-GROUP' --k2GroupEnv 'STAGING' --k2

Config File Setup

K2HackBot support two ways to define options:

  • CLI

  • Config File

The Hierarchy for reading config is as follows:

CLI > Environment > Configuration file > Default

The config file can be created with any name but it MUST be in JSON format. Below is a sample config file for deploy-k2component:

$ cat k2config.json

{
    "k2email": "demo@example.com",
    "k2password": "password",
    "k2GroupName": "MY-GROUP",
    "k2GroupEnv": "STAGING",
    "k2Cloud": "https://my-k2-cloud.com",
    "k2icDirectoryPath": "/my_k2_dir"
}

Command to run deploy-k2component using the config file:

k2hackbot deploy-k2component --config k2config.json

Last updated

Was this helpful?