Skip to content

Self-Hosted Runners (Feature Guide)

Run Controlinfra scans in your own infrastructure for enhanced security and unlimited scans.

Why Self-Hosted Runners?

BenefitDescription
SecurityAWS credentials never leave your network
ComplianceMeet regulatory requirements (SOC2, HIPAA, PCI)
Unlimited ScansNo quota limits
Network AccessScan private resources
Custom EnvironmentYour Terraform version, custom providers

Architecture

Cloud Runner (Default)

┌─────────────────────────────────────────────────────────┐
│                  Controlinfra Cloud                      │
│  ┌─────────────┐    ┌───────────────────────────────┐  │
│  │   Cloud     │    │                               │  │
│  │   Runner    │───▶│    Your AWS Resources         │  │
│  │             │    │                               │  │
│  └─────────────┘    └───────────────────────────────┘  │
│        │                                                │
│  AWS Credentials                                        │
│  stored here                                            │
└─────────────────────────────────────────────────────────┘

Self-Hosted Runner

┌─────────────────────────────────────────────────────────┐
│                  Your Infrastructure                     │
│  ┌─────────────┐    ┌───────────────────────────────┐  │
│  │ Self-Hosted │    │                               │  │
│  │   Runner    │───▶│    Your AWS Resources         │  │
│  │             │    │                               │  │
│  └──────┬──────┘    └───────────────────────────────┘  │
│         │                                               │
│   IAM Role                                              │
│   (no keys)                                             │
└─────────┼───────────────────────────────────────────────┘
          │ Results only

┌─────────────────────────────────────────────────────────┐
│                  Controlinfra Cloud                      │
│  • Dashboard                                            │
│  • AI Analysis                                          │
│  • Notifications                                        │
└─────────────────────────────────────────────────────────┘

Getting Started

For detailed setup instructions, see: Self-Hosted Runners Setup Guide

Quick Overview

  1. Create IAM Role with read permissions
  2. Launch EC2 Instance with the IAM role
  3. Install Dependencies (Terraform, Git)
  4. Register Runner in Controlinfra
  5. Install Agent and start

Runner Features

Multiple Runners

Run multiple runners for:

  • High Availability: Redundant scanning
  • Environment Isolation: Separate prod/staging
  • Geographic Distribution: Multi-region
┌─────────────────────────────────────────────────────────┐
│               Controlinfra Cloud                         │
└───────────────────────┬─────────────────────────────────┘

        ┌───────────────┼───────────────┐
        │               │               │
        ▼               ▼               ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Runner: prod  │ │ Runner: staging│ │ Runner: eu    │
│ us-east-1     │ │ us-east-1     │ │ eu-west-1     │
└───────────────┘ └───────────────┘ └───────────────┘

Runner Labels

Tag runners to route scans appropriately:

yaml
Runner: prod-runner
Labels:
  - production
  - us-east-1
  - high-security

Runner: staging-runner
Labels:
  - staging
  - us-east-1

Then in repository settings:

yaml
Repository: production-infra
Runner: Self-hosted
Labels: production, us-east-1

Auto-Selection

Controlinfra automatically selects the best runner:

  1. Matches labels if specified
  2. Chooses least busy runner
  3. Falls back to cloud runner if none available

Runner Management

Dashboard

View all runners in Settings → Runners:

┌─────────────────────────────────────────────────────────┐
│ Self-Hosted Runners                                     │
├─────────────────────────────────────────────────────────┤
│ ● prod-runner     │ Online │ us-east-1    │ 5 min ago  │
│ ● staging-runner  │ Online │ us-east-1    │ 2 min ago  │
│ ○ backup-runner   │ Offline│ us-west-2    │ 3 hrs ago  │
├─────────────────────────────────────────────────────────┤
│ [+ Add Runner]                                          │
└─────────────────────────────────────────────────────────┘

Runner States

StateIconDescription
Online🟢Ready to accept scans
Busy🟡Currently running a scan
Offline🔴Not connected
Error⚠️Error state, needs attention

Actions

ActionDescription
View LogsSee runner activity
Edit LabelsUpdate routing labels
Regenerate TokenNew authentication token
RemoveDelete runner registration

Security Considerations

No Credential Exposure

With self-hosted runners:

  • AWS credentials stay in your VPC
  • Use IAM roles instead of access keys
  • Controlinfra only receives scan results

Network Security

Recommended setup:

  • Runner in private subnet
  • NAT Gateway for outbound
  • No inbound access required
  • Security group: outbound HTTPS only

Audit Trail

All runner activity is logged:

  • Scan requests
  • Results uploaded
  • Errors and failures

Performance

Scan Speed

Self-hosted runners can be faster:

  • Direct network access to AWS
  • No credential exchange latency
  • Configurable instance size

Scaling

For high scan volume:

yaml
# Multiple runners share load
prod-runner-1 (labels: production)
prod-runner-2 (labels: production)
prod-runner-3 (labels: production)

Resource Requirements

WorkloadInstance TypeNotes
Lightt3.smallFew scans/day
Mediumt3.mediumRegular scans
Heavyt3.large+Many concurrent scans

Troubleshooting

Runner Won't Connect

  1. Check network connectivity:
    bash
    curl https://api.controlinfra.com/health
  2. Verify token is correct
  3. Check firewall rules

Scans Failing

  1. Check Terraform is installed
  2. Verify IAM permissions
  3. Review runner logs

Runner Goes Offline

  1. Check EC2 instance status
  2. Verify runner service is running
  3. Check for resource exhaustion

Cost Optimization

EC2 Costs

  • Use Spot Instances for non-critical scans
  • Right-size based on workload
  • Use Reserved Instances for steady usage

Comparison

ApproachProsCons
Cloud RunnerNo infrastructureQuota limits
Self-HostedUnlimited, secureEC2 costs

Next Steps

AI-powered infrastructure drift detection