Spyderbat
Book a DemoStart FreeContact Us
  • Spyderbat Product Docs
  • Getting Started
    • Create an Organization
    • Install the Nano Agent
    • Three Things to Try with Spyderbat Community Edition
    • Manage Users and Roles
  • Installation
    • Spyderbat Nano Agent
      • Kubernetes
        • Pre Deployment Environment Data Collection Script
      • Linux Standalone
      • AWS Unattended Install
        • Secure your Registration Code with AWS Secrets Manager
      • Create a Golden Image with the Nano Agent Pre-Installed
    • Spyderbat AWS Agent
      • AWS Linux VM
      • Kubernetes
      • Configuration Guide - AWS Linux VM
      • Configuration Guide - Kubernetes
    • Install Spyctl CLI
      • Initial Configuration
    • Install Spydertop CLI
    • Install the Spyderbat Event Forwarder
      • Helm Chart
      • Traditional Installer
  • Concepts
    • Guardian & Interceptor
      • Ruleset Policies
      • Workload Policies
    • Flashback (Go Back In Time)
      • Investigations
    • Search
      • Saved Searches
    • Summarize
      • Spydertrace Summarize
    • Dashboards
      • Dashboard Categories
    • Reports
    • Notifications
      • Notification Targets
      • Notification Templates
    • Actions
    • Integrations
      • AWS Integration
      • Spyderbat Event Forwarder
    • Suppression & Tuning
    • Scout (Detections)
      • Custom Flags
  • Tutorials
    • Flashback
      • How to Use the Investigations Feature in Spyderbat
    • Guardian
      • How to Lock Down Your Workloads With Guardian Policies Using Spyctl
      • How to Put Guardrails Around Your K8s Clusters Using Spyctl
    • Integrations
      • How to Configure Event Forwarder Webhook for Panther
      • How to Set Up Spyderbat to Ingest Falco Alerts
      • How to Create and Use a Spyderbat API Key
    • Notifications
      • How to Set Up Notifications Using Spyctl
      • How to Set up Agent-Health Notifications Using Spyctl
    • Dashboards
    • Miscellaneous
      • How to Set Up Spyderbat to Monitor Systems From vulnhub.com
    • Scout (Detections)
      • How to Set Up Custom Flags Using Spyctl CLI
  • Reference
    • Policies
      • Response Actions
    • Rulesets
    • Selectors
    • Notifications
    • Spyctl CLI
      • Spyctl Commands
      • Guardian Policy Management using Spyctl
      • Notification Template Management using Spyctl
      • Notification Target Management using Spyctl
    • Search
      • All Operators
      • All Fields
      • All Related Objects
  • Quick Links
    • Contact Us
    • Try Spyderbat for Free
    • Book a Demo
Powered by GitBook

© SPYDERBAT, Inc., All Rights Reserved

On this page
  • Prerequisites
  • Initial Configuration

Was this helpful?

Export as PDF
  1. Installation
  2. Install Spyctl CLI

Initial Configuration

Learn how to quickly configure Spyctl to interact with your Spyderbat data

Last updated 1 year ago

Was this helpful?

Prerequisites

Initial Configuration

In this section you will learn how to configure Spyctl to enable data retrieval from across your entire organization. To do so, you must first create an APISecret and then use that APISecret to set a Context. An APISecret encapsulates your Spyderbat API credentials; the Context specifies where Spyctl should look for data when interacting with the Spyderbat API (e.g., organization, cluster, machine, service, or container image).

Create an APISecret

An APISecret encapsulates your Spyderbat API credentials. You must create at least one APISecret in order for Spyctl to access your data via theSpyderbat API.

To create an APISecret, use an .

Region
API URL

United States

https://api.spyderbat.com

Mumbai, India

https://api.mum.prod.spyderbat.com

Frankfurt, Germany

https://api.deu.prod.spyderbat.com

For most users, the API URL will be the one in the United States. If you are unsure which one applies to you, contact .

Copy a generated API key and region-specific API URL into the following command:

spyctl config set-apisecret -k <apikey> -u <apiurl> NAME

For example:

$ spyctl config set-apisecret -k ZXlKaGJHY2lPaUpJVXpJMU5pSXNJbXRwWkNJNkluTm\
lJaXdpZEhsd0lqb2lTbGRVSW4wLmV5SmxlSEFpT2pFM01EUTVPVGM1TWpBc0ltbGhkQ0k2TVRZM\
016UTJNVGt4T1N3aWFYTnpJam9pYTJGdVoyRnliMjlpWVhRdWJtVjBJaXdpYzNWaUlqb2ljSGhX\
YjBwMlVFeElXakJIY1VJd2RXMTNTMEVpZlEuZGpxWkRCOTNuUnB4RUF0UU4yQ0ZrOU5zblQ5Z2Q\
tN0tYT081TEZBZC1GSQ== -u "https://api.spyderbat.com" my_secret

Set new apisecret 'my_secret' in '/home/demouser/.spyctl/.secrets/secrets'

Spyctl saves APISecrets in $HOME/.spyctl/.secrets/secrets

Set a Context

Contexts will let Spyctl know where to look for data. The broadest possible Context is organization-wide. This means that when you run Spyctl commands, the Spyderbat API will return results relevant to your entire organization.

spyctl config set-context --org <ORG NAME or UID> --secret <SECRET NAME> NAME

For example:

$ spyctl config set-context --org "John's Org" --secret my_secret my_context
Set new context 'my_context' in configuration file '/home/demouser/.spyctl/config'.

You can view your configuration by issuing the following command:

spyctl config view

You should see something like this:

apiVersion: spyderbat/v1
kind: Config
contexts:
- name: my_context
  secret: my_secret
  context:
    organization: John's Org
current-context: my_context

The global configuration file is located at $HOME/.spyctl/config

It is possible to create more specific contexts, such as a group of machines or a specific container image. You can think of the fields in your context as filters to limit your scope. Follow this link to learn more about contexts: Contexts

At this point you should now be able to run spyctl commands that utilize the Spyderbat API.

For the --org field in the following command you may supply the name of your organization which can be found in the top right of the Spyderbat Console or the organization UID which can be found in your web browser’s url when logged into the : .

Install Spyctl
Generate a key to access the Spyderbat API
API key generated from the Spyderbat Console
support@spyderbat.com
Spyderbat Console
https://app.spyderbat.com/app/org/UID/dashboard