Package Documentation

Storm Package: synapse-spur

The following Commands are available from this package. This documentation is generated for version 2.0.0 of the package.

Storm Commands

This package implements the following Storm Commands.

spur.config.add

Add a Synapse-Spur configuration.

The proxy argument can be set to one of the following values:
  true: Use the Cortex configured proxy if set.
  false: Do not use the Cortex configured proxy if set.
  <str>: A proxy URL to use.

Examples:

  // Add a global configuration
  spur.config.add default myapikey1234

  // Add a configuration for the current user
  spur.config.add --scope self myconfig myapikey5678


Usage: spur.config.add [options] <name> <apikey>

Options:

  --help                      : Display the command usage.
  --ssl-noverify              : Do not perform SSL/TLS verification.
  --proxy <proxy>             : Configure the proxy usage. (default: True)
  --tag-prefix <tag_prefix>   : The tag prefix to use when recording data from Spur. (default: rep.spur)
  --baseurl <baseurl>         : The base URL of the Spur API. (default: https://api.spur.us)
  --scope <scope>             : Set the scope on the configuration. (default: global, choices: global, self, unscoped)

Arguments:

  <name>                      : A unique name for the configuration.
  <apikey>                    : The Spur API key string.

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

spur.config.del

Delete a Synapse-Spur configuration.

Examples:

  // Delete the "myconfig" configuration
  spur.config.del myconfig


Usage: spur.config.del [options] <name>

Options:

  --help                      : Display the command usage.

Arguments:

  <name>                      : The name of the configuration.

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

spur.config.list

Display the list of Synapse-Spur configurations you have access to.


Usage: spur.config.list [options]

Options:

  --help                      : Display the command usage.

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

spur.config.migrate

Migrate options for all Synapse-Spur configurations.

The proxy argument can be set to one of the following values:
  true: Use the Cortex configured proxy if set.
  false: Do not use the Cortex configured proxy if set.
  <str>: A proxy URL to use.

Examples:

  // Migrate the tag prefix for all configurations
  spur.config.migrate --tag-prefix my.tagpref


Usage: spur.config.migrate [options]

Options:

  --help                      : Display the command usage.
  --ssl-verify <ssl_verify>   : Set whether to verify the SSL certificate of the server. (default: None)
  --proxy <proxy>             : Configure the proxy usage. (default: None)
  --tag-prefix <tag_prefix>   : The tag prefix to use when recording data from Spur. (default: None)
  --baseurl <baseurl>         : The base URL of the Spur API. (default: None)

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

spur.config.show

Show the details of a configuration.

Examples:

  // Show the in-use configuration for the current user
  spur.config.show

  // Show a configuration by name
  spur.config.show myconfig


Usage: spur.config.show [options] <name>

Options:

  --help                      : Display the command usage.

Arguments:

  [name]                      : The name of the configuration.

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

spur.config.update

Update the configuration of a defined Synapse-Spur configuration.

The proxy argument can be set to one of the following values:
  true: Use the Cortex configured proxy if set.
  false: Do not use the Cortex configured proxy if set.
  <str>: A proxy URL to use.

Examples:

  // Set the permission level for user "myuser" to "admin" on the "myconfig"
  // configuration
  spur.config.update myconfig --perm user myuser admin

  // Set the permission level for the "all" role to "deny" on the
  // "myconfig" configuration
  spur.config.update myconfig --perm role all deny

  // Do not verify the SSL certificate when connecting to "myconfig"
  spur.config.update myconfig --ssl-verify (false)

  // Change the tag prefix used by the "myconfig" configuration
  spur.config.update myconfig --tag-prefix my.prefix

  // Use a Spur API mirror for the "myconfig" configuration
  spur.config.update myconfig --baseurl https://mirror.my.domain/spur

  // Change the name of the "myconfig" configuration to "otherconfig"
  spur.config.update myconfig --name otherconfig


Usage: spur.config.update [options] <config>

Options:

  --help                      : Display the command usage.
  --apikey <apikey>           : The Spur API key string. (default: None)
  --perm <perm>               : Set the permission level for a user or role on this configuration.
                                Arguments to this option are ``scope``, ``name``, ``level``:
                                  <scope>: The scope for the permission, either "user" or "role".
                                  <name>: The user/role name depending on scope.
                                  <level>: The $lib.auth.easyperm.level name, or (null) to remove the
                                           permission, which falls back to the config default.
                                 (default: None)
  --ssl-verify <ssl_verify>   : Set whether to verify the SSL certificate of the server. (default: None)
  --proxy <proxy>             : Configure the proxy usage. (default: None)
  --tag-prefix <tag_prefix>   : The tag prefix to use when recording data from Spur. (default: None)
  --baseurl <baseurl>         : The base URL of the Spur API. (default: None)
  --name <name>               : Rename the configuration. (default: None)

Arguments:

  <config>                    : The name of the configuration to modify.

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

spur.ipcontext

Query the Spur API to get additional information about an IP.

This command takes inet:ipv4 or inet:ipv6 nodes as input and enriches
them with additional context information from the Spur /v2/context
API which specializes in tracking and attributing anonymization
infrastructure (e.g. VPNs and Proxies.)

If tunnel information is present in the context information, this command
will create associated `inet:tunnel`, `inet:ipv4` or `inet:ipv6`, `inet:server`,
and `ps:contact` nodes. Each of these nodes will be tagged with `<prefix>.tunnel`
and `<prefix>.tunnel.<operator>`.

Examples:

  // Query the IP context API using an inet:ipv4 node
  inet:ipv4=161.117.234.232 | spur.ipcontext

  // Perform the above query, overriding the default property set behavior for inet:asn:owner to "notset"
  inet:ipv4=161.117.234.232 | spur.ipcontext --prop-behavior inet:asn:owner=notset

  // Query the IP context API using an inet:ipv6 node and skip adding tags
  inet:ipv6=2a01:6340:2:501::10 | spur.ipcontext --no-tags


Usage: spur.ipcontext [options]

Options:

  --help                      : Display the command usage.
  --debug                     : Show verbose debug output.
  --yield                     : Yield the newly created nodes.
  --no-tags                   : Do not record tags returned by the Spur API.
  --asof <asof>               : Specify the maximum age for a cached result. To disable caching, use --asof now.
                                (default: -30days)
  --prop-behavior <prop_behavior>: Override the global node property set behavior. (Specify multiple times to override
                                multiple behaviors.) (default: None)
  --config <config>           : Override the default config with the provided name.

Inputs:

  inet:ipv4                   : inet:ipv4 nodes
  inet:ipv6                   : inet:ipv6 nodes

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

spur.setup.prop.behavior

Manage the Spur node property set behavior.

These settings are global and apply to all users and configs.

Valid property set behaviors are:

    - always: Always set the property.
    - never: Never set the property.
    - notset: Set the property if it's not already set.

Examples:

    // List property set behavior
    spur.setup.prop.behavior --list

    // Change property set behavior for a form
    spur.setup.prop.behavior inet:asn:owner notset


Usage: spur.setup.prop.behavior [options] <property> <behavior>

Options:

  --help                      : Display the command usage.
  --list                      : List all defined properties and their behaviors for this power-up.

Arguments:

  [property]                  : The property to set behavior for.
  [behavior]                  : The behavior to set for the specified property. (choices: always, never, notset)

The command is accessible to users with one or more of the following permissions:

  • power-ups.spur.admin

  • power-ups.spur.user

Storm Modules

This package implements the following Storm Modules.

spur

ingestIpContext(resp, addtags=(true))

Add a Spur IP context record to the Cortex.

Example:

Iterate over a list of Spur responses to make nodes:

init { $spur=$lib.import(spur) }
for $resp in $resps {
  yield $spur.ingestIpContext($resp)
}
Args:

resp (dict): The API response from the Spur v2/context API endpoint.

addtags (bool): Add Spur related tags to the node created by the record.

Returns:

The IPv4 or IPv6 node created from the record. The return type is node.