Skip to content

Scan Scheduling

Automate infrastructure drift detection with scheduled scans.

Overview

Scheduled scans allow you to:

  • Automatically detect drift on a regular basis
  • Catch unauthorized changes quickly
  • Maintain infrastructure compliance
  • Reduce manual monitoring effort

Setting Up Schedules

Repository-Level Schedule

Set a default schedule for all workspaces:

  1. Navigate to your repository
  2. Click Settings (gear icon)
  3. Find Scan Schedule
  4. Select frequency
  5. Click Save

Workspace-Level Schedule

Override for specific workspaces:

  1. Navigate to the workspace
  2. Click Settings
  3. Set Custom Schedule
  4. Choose frequency and time
  5. Click Save

Schedule Options

Predefined Schedules

OptionFrequencyBest For
HourlyEvery hourCritical production
DailyOnce per dayProduction systems
WeeklyOnce per weekStaging/Dev
MonthlyOnce per monthStable infrastructure
Manual OnlyNo automatic scansOn-demand only

Custom Schedules

For more control, use cron expressions:

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *

Common Examples

ScheduleCron ExpressionDescription
Every hour0 * * * *Top of every hour
Daily at 6 AM0 6 * * *6:00 AM UTC daily
Weekdays at 9 AM0 9 * * 1-5Mon-Fri at 9 AM
Weekly Monday0 0 * * 1Midnight Monday
Monthly 1st0 0 1 * *Midnight, 1st of month
Every 4 hours0 */4 * * *Every 4 hours

Time Zone

All schedules use UTC time zone. Convert from your local time:

Your Time ZoneUTC Offset9 AM Local = UTC
EST (New York)UTC-514:00 (2 PM)
PST (Los Angeles)UTC-817:00 (5 PM)
GMT (London)UTC+009:00
CET (Berlin)UTC+108:00
JST (Tokyo)UTC+900:00 (midnight)

Scan Behavior

What Happens During Scheduled Scan

  1. Trigger: Schedule time reached
  2. Queue: Scan added to queue
  3. Execute: Runner picks up scan
  4. Complete: Results stored
  5. Notify: Alerts sent (if configured)

Scan Pipeline

Schedule Triggers


┌─────────────┐
│    Clone    │ Download repository
└──────┬──────┘


┌─────────────┐
│    Init     │ terraform init
└──────┬──────┘


┌─────────────┐
│    Plan     │ terraform plan
└──────┬──────┘


┌─────────────┐
│   Detect    │ Parse drift
└──────┬──────┘


┌─────────────┐
│  Analyze    │ AI analysis
└──────┬──────┘


┌─────────────┐
│  Complete   │ Store results
└─────────────┘

Handling Failures

If a scheduled scan fails:

  • Retry: Automatic retry after 5 minutes
  • Alert: Notification sent (if configured)
  • Log: Error recorded in scan history
  • Skip: Next scheduled scan proceeds normally

Notifications

Configure Alerts

Set up notifications for scheduled scans:

  1. Go to SettingsNotifications
  2. Enable desired alerts:
Alert TypeDescription
Scan CompleteEvery completed scan
Drift DetectedOnly when drift found
Critical DriftOnly critical severity
Scan FailedWhen scans fail

Alert Channels

  • Email: Sent to your registered email
  • Slack: (Coming soon) Webhook integration
  • Webhooks: (Coming soon) Custom endpoints

Alert Content

Email alerts include:

Subject: [Controlinfra] Drift detected in production/

Summary:
• Repository: my-org/infrastructure
• Workspace: production/
• Drifts Found: 3
• Highest Severity: Critical

Quick View:
🔴 aws_security_group.web - Ingress rule modified
🟡 aws_instance.api - Instance type changed
🟢 aws_s3_bucket.logs - Tag added

View Details: https://controlinfra.com/scans/abc123

---
You're receiving this because you have notifications
enabled for this repository.

Viewing Scheduled Scans

Upcoming Scans

See what's scheduled:

  1. Go to Repositories
  2. Click on a repository
  3. View Next Scan timestamp

Or view all upcoming scans:

  1. Go to Scans
  2. Filter by Scheduled

Scan History

View past scheduled scans:

Scan History - production/

#47 | Dec 9, 6:00 AM  | ⚠️ 2 drifts | Scheduled
#46 | Dec 8, 6:00 AM  | ✅ Clean    | Scheduled
#45 | Dec 7, 6:00 AM  | ✅ Clean    | Scheduled
#44 | Dec 6, 3:15 PM  | ⚠️ 1 drift  | Manual
#43 | Dec 6, 6:00 AM  | ✅ Clean    | Scheduled

Managing Schedules

Pause Schedules

Temporarily disable scheduled scans:

  1. Navigate to repository or workspace
  2. Click Settings
  3. Toggle Pause Scheduled Scans
  4. Click Save

Use cases:

  • During maintenance windows
  • While making major changes
  • During incident response

Resume Schedules

Re-enable paused schedules:

  1. Navigate to settings
  2. Toggle Pause Scheduled Scans off
  3. Click Save

Delete Schedule

Remove a schedule entirely:

  1. Navigate to settings
  2. Set schedule to Manual Only
  3. Click Save

Quota Considerations

Cloud Runner Limits

If using cloud runners, schedules count against your quota:

Monthly Quota: 100 scans
Current Usage: 45 scans

Scheduled Scans:
• production/ - Daily (30 scans/month)
• staging/ - Weekly (4 scans/month)
• networking/ - Daily (30 scans/month)

Estimated Monthly: 64 scheduled + manual scans

Optimizing Quota Usage

StrategyImpact
Reduce frequencyDaily → Weekly saves 75%
Scan off-hoursLower priority, same coverage
Use self-hostedUnlimited scans
Consolidate workspacesFewer scans needed

Best Practices

1. Match Frequency to Risk

EnvironmentRisk LevelRecommended
ProductionHighDaily or more
StagingMediumDaily
DevelopmentLowWeekly
ArchivesMinimalMonthly

2. Schedule During Low-Activity Periods

yaml
# Better: Scan during off-hours
Schedule: 0 3 * * *  # 3 AM UTC

# Avoid: Scan during deployments
# Consider your deployment windows

3. Stagger Multiple Workspaces

yaml
# Stagger to avoid resource contention
production/: 0 6 * * *   # 6:00 AM
staging/:    0 7 * * *   # 7:00 AM
networking/: 0 8 * * *   # 8:00 AM

4. Enable Critical Alerts

At minimum, enable alerts for:

  • Critical severity drift
  • Scan failures

Regularly review scan history:

  • Are scans finding repeated drift?
  • Is drift increasing over time?
  • Are specific resources always drifting?

Troubleshooting

Scheduled Scan Didn't Run

  1. Check if schedule is paused
  2. Verify schedule configuration
  3. Check for system maintenance
  4. Review scan history for errors

Scans Running Too Often

  1. Review cron expression
  2. Check for multiple schedules
  3. Verify time zone calculation

Missing Notifications

  1. Check email spam folder
  2. Verify notification settings
  3. Confirm email address is correct
  4. Check notification preferences

Quota Exhausted

  1. Reduce scan frequency
  2. Remove unnecessary workspaces
  3. Upgrade plan
  4. Use self-hosted runners

Next Steps

AI-powered infrastructure drift detection