Skip to main content

Discovery Overview

Infracast's discovery system continuously maps your infrastructure β€” cloud accounts, on-premises networks, identity systems, and security devices β€” into a unified, queryable graph. This page explains how the discovery engine works under the hood and how to configure it.

What Is a Discovery Plugin?​

A discovery plugin is a purpose-built collector for a specific platform or technology. Each plugin knows how to authenticate, query, and normalize data from its target into Infracast's common schema.

Plugins exist for:

PluginTarget
awsAmazon Web Services accounts
azureMicrosoft Azure subscriptions
gcpGoogle Cloud Platform projects
cisco-iosCisco IOS/IOS-XE network devices
palo-altoPalo Alto Networks firewalls (PAN-OS)
vmware-vsphereVMware vCenter / ESXi
active-directoryMicrosoft Active Directory / LDAP

How Plugins Work​

gRPC Plugin Protocol​

Infracast uses a gRPC-based plugin protocol. Each plugin runs as a sidecar process alongside the Infracast collector daemon and communicates over a local Unix socket or loopback TCP connection.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Infracast Collector β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” gRPC β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Scheduler │◄───────►│Plugin β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ Graph Store β”‚ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”˜
β”‚ API calls
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Target Platform β”‚
β”‚ (AWS/Azure/network) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The plugin protocol defines three RPC methods:

  • Validate β€” Test credentials and connectivity before a full run
  • Discover β€” Stream discovered resources back to the collector
  • Diff β€” Return only changed resources since a given checkpoint (incremental updates)

Poll-Based Discovery​

Most plugins operate in poll mode β€” they run on a configurable schedule, enumerate all resources in their scope, and compare results against the previous snapshot. Changes (additions, modifications, deletions) are written to the graph.

Some plugins also support event-driven mode where available (e.g., AWS CloudTrail + EventBridge), allowing near-real-time updates between scheduled polls.

Timeline:
T=0 Full discovery run (baseline)
T=15m Poll: only changes since T=0
T=30m Poll: only changes since T=15m
T=24h Full discovery run (re-baseline)
info

Incremental polling reduces API call volume significantly. For large AWS accounts with thousands of resources, this can mean going from tens of thousands of API calls per run down to a few hundred.

Credential Management​

Credentials for discovery plugins are stored encrypted in Infracast's credential vault. No plaintext secrets are written to disk.

Storing Credentials​

Use the Infracast CLI to register credentials:

# AWS role-based credential
infracast creds add --plugin aws \
--name "prod-account" \
--type assume-role \
--role-arn arn:aws:iam::123456789012:role/InfracastDiscovery \
--external-id your-external-id

# Generic username/password
infracast creds add --plugin active-directory \
--name "corp-ad" \
--type ldap \
--username "svc-infracast@corp.example.com" \
--password-file /run/secrets/ad-password

# API key
infracast creds add --plugin palo-alto \
--name "fw01" \
--type api-key \
--api-key-file /run/secrets/panos-apikey

Credential Rotation​

Credentials can be rotated without downtime:

# Update an existing credential set
infracast creds update --name "prod-account" \
--role-arn arn:aws:iam::123456789012:role/InfracastDiscovery-v2

# Verify the new credential works
infracast creds validate --name "prod-account"
warning

Infracast never logs credential values. If you see secrets in log output, check your logging configuration and rotate the affected credentials immediately.

Credential Scoping​

Each credential is scoped to a specific plugin type. A credential registered for aws cannot be used by the azure plugin. This prevents cross-plugin credential leakage.

Scheduling Discovery Jobs​

Discovery jobs are defined in infracast.yaml (or via the UI). Each job binds a plugin to a credential and a schedule.

Basic Job Configuration​

discovery:
jobs:
- name: aws-production
plugin: aws
credential: prod-account
schedule: "*/15 * * * *" # every 15 minutes
config:
regions:
- us-east-1
- us-west-2
account_id: "123456789012"

- name: corp-active-directory
plugin: active-directory
credential: corp-ad
schedule: "0 * * * *" # every hour
config:
host: dc01.corp.example.com
base_dn: "DC=corp,DC=example,DC=com"

Schedule Syntax​

Infracast uses standard cron syntax (5-field, UTC):

FieldAllowed Values
Minute0–59
Hour0–23
Day of month1–31
Month1–12
Day of week0–6 (Sunday = 0)

Common schedules:

ScheduleCron Expression
Every 15 minutes*/15 * * * *
Every hour0 * * * *
Every 6 hours0 */6 * * *
Daily at 2 AM UTC0 2 * * *
Weekly on Sunday0 0 * * 0
tip

For dynamic cloud environments (AWS, Azure, GCP), use a 15–30 minute interval. For slower-changing systems like Active Directory or vSphere, hourly or 6-hour intervals are usually sufficient.

Running a Job Manually​

# Trigger an immediate run outside the schedule
infracast discovery run --job aws-production

# Run in dry-run mode (no writes to graph)
infracast discovery run --job aws-production --dry-run

# Run with verbose output
infracast discovery run --job aws-production --verbose

Viewing Job Status​

# List all jobs and their last run status
infracast discovery jobs list

# Get details on a specific job
infracast discovery jobs status --name aws-production

# View recent job logs
infracast discovery jobs logs --name aws-production --tail 100

Resource Graph​

All discovered resources flow into Infracast's resource graph β€” a property graph database where nodes represent resources and edges represent relationships between them.

Example relationships Infracast builds automatically:

  • EC2 instance β†’ belongs to β†’ VPC subnet
  • EC2 instance β†’ attached to β†’ Security Group
  • EC2 instance β†’ runs β†’ AMI
  • Lambda function β†’ has permission β†’ S3 bucket
  • AD user β†’ member of β†’ AD group
  • AD group β†’ assigned to β†’ GPO

These relationships power Infracast's attack path analysis, compliance mapping, and blast radius calculations.

Next Steps​

Configure your first discovery plugin:

  • AWS β€” Start here if you're cloud-first
  • Azure β€” For Microsoft Azure environments
  • GCP β€” For Google Cloud Platform
  • Cisco IOS β€” For on-premises Cisco networks
  • Palo Alto β€” For Palo Alto firewalls
  • VMware vSphere β€” For virtualized infrastructure
  • Active Directory β€” For identity and access mapping