Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(cli): The new lacework-cli MVP #28

Merged
5 commits merged into from
Mar 27, 2020
Merged

feature(cli): The new lacework-cli MVP #28

5 commits merged into from
Mar 27, 2020

Conversation

ghost
Copy link

@ghost ghost commented Mar 26, 2020

lacework-cli MVP 🔥🙌🏽

The Lacework Command Line Interface is a tool that helps you manage your
Lacework cloud security platform. You can use it to manage compliance
reports, external integrations, vulnerability scans, and other operations.

Install

Bash:

$ curl https://raw.githubusercontent.com/lacework/go-sdk/master/cli/install.sh | sudo bash

Powershell:

C:\> Set-ExecutionPolicy Bypass -Scope Process -Force
C:\> iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/lacework/go-sdk/master/cli/install.ps1'))

Configuration File

The lacework-cli looks for a file named .lacework.toml inside your home
directory ($HOME/.lacework.toml) to access the following parameters:

  • account: Account subdomain of URL (i.e. <ACCOUNT>.lacework.net)
  • api_key: API Access Key ID
  • api_secret: API Access Secret Key

An example of a Lacework configuration file:

account = "example"
api_key = "EXAMPLE_1234567890ABC"
api_secret = "_super_secret_key"

You can provide a different configuration file with the option --config.

Basic Usage

Once you have created your configuration file $HOME/.lacework.toml,
you are ready to use the Lacework cli, a few basic commands are:

  1. List all integration in your account:
$ lacework-cli integration list
  1. Use the api command to access Lacework's ResfulAPI, for example,
    to get details about and specific event:
$ lacework-cli api get '/external/events/GetEventDetails?EVENT_ID=16700'

Help Message / Usage 👀

$ lacework-cli help

The Lacework Command Line Interface is a tool that helps you manage your
Lacework cloud security platform. You can use it to manage compliance
reports, external integrations, vulnerability scans, and other operations.

Usage:
  lacework-cli [command]

Available Commands:
  api         Helper to call Lacework's ResfulAPI
  help        Help about any command
  integration Manage external integrations
  version     Print the lacework-cli version

Flags:
  -a, --account string      account subdomain of URL (i.e. <ACCOUNT>.lacework.net)
  -k, --api_key string      access key id
  -s, --api_secret string   access secret key
  -c, --config string       config file (default is $HOME/.lacework.toml)
      --debug               turn on debug logging
  -h, --help                help for lacework-cli

Use "lacework-cli [command] --help" for more information about a command.

Show the Schema of an Integration

image

@ghost ghost self-assigned this Mar 26, 2020
This is the MVP of the `lacework-cli` tool!

Signed-off-by: Salim Afiune Maya <[email protected]>
@ghost ghost force-pushed the afiune/cli/mvp branch 2 times, most recently from b30dd78 to 07a66a4 Compare March 26, 2020 23:52
Copy link
Contributor

@scottford-lw scottford-lw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ghost ghost merged commit 288bdf8 into master Mar 27, 2020
@ghost ghost deleted the afiune/cli/mvp branch March 27, 2020 16:01
// apiCmd represents the api command
apiCmd = &cobra.Command{
Use: "api <method> <path>",
Short: "Helper to call Lacework's ResfulAPI",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "Restful"

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants