Skip to main content

Consul

Consul is a service networking platform and service mesh solution developed by HashiCorp that provides service discovery, health checking, key/value storage, and multi-datacenter support for modern distributed applications and microservices architectures. This integration enables querying and retrieving comprehensive information about your Consul infrastructure, configuration, and security policies.

CategoryContainers
DirectionQuery source
Sign-inACL Token
Query languagesSQLite
Tables10
Query templates41
Websiteconsul.io

Before you start​

Huntbase signs in to Consul with ACL Token. Create the credential in Consul first, then keep it to hand for the Connect step.

  1. Create a read-only policy, for example consul acl policy create -name "huntbase-read" -rules @rules.hcl, where the rules file grants read on the resources Huntbase should see, such as service_prefix "" and node_prefix "".
  2. Create a token linked to that policy: consul acl token create -description "Huntbase read-only" -policy-name huntbase-read.
  3. Copy the SecretID from the output. That is the token. The AccessorID is only a public identifier.

Permissions:

  • read policy on service_prefix "" and node_prefix "", or narrower prefixes.

For the vendor's own instructions, see Consul ACL token create command.

tip

Use a dedicated, read-only credential for Huntbase where the product allows it. Huntbase only needs to read.

Connect Consul​

  1. Go to Connections and click New connection, or click New connection on the Consul product page.
  2. On Product, pick Consul and choose the Owner.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the settings and credentials described below.
  5. On Verify, review the summary and click Create & check.

For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.

Settings​

Where your Consul lives:

FieldRequiredNotes
AddressYesThe Consul HTTP API address, including scheme and port, such as http://consul.example.com:8500.
NamespaceNoConsul Enterprise only. Use * for all namespaces. Leave empty for the default namespace.
PartitionNoConsul Enterprise only. Leave empty for the default partition.

Credentials​

The only Method is ACL Token. Enter a Credential label (for example Production), then fill in:

FieldRequiredNotes
ACL TokenYesOnly needed when ACLs are enabled on the Consul servers. Secret — not shown again after you save it.

Query it​

Once connected, Consul can serve these languages in a query tab, and Scout can use it when you ask in Auto:

LanguageUse it for
SQLiteSQL over the 10 tables listed below, alongside every other connected source.

Example: SQLite​

Show Consul key value details — Explore which key-value pairs are being used in Consul sessions.

select
key,
session,
namespace,
value
from
consul_key;

Consul ships with 41 query templates. Find them in Library › Queries — see Query templates.

Tables​

Consul adds 10 tables. Browse their columns from Schema in the query bar's ⋯ menu.

All 10 tables
TableContains
consul_acl_auth_methodRetrieve information about your ACL auth methods.
consul_acl_binding_ruleRetrieve information about your ACL binding rules.
consul_acl_policyRetrieve information about your ACL policies.
consul_acl_roleRetrieve information about your ACL roles.
consul_acl_tokenRetrieve information about your ACL tokens.
consul_intentionRetrieve information about your intentions.
consul_keyRetrieve information about your keys.
consul_namespaceRetrieve information about your namespaces.
consul_nodeRetrieve information about your nodes.
consul_serviceRetrieve information about your services.

Next steps​