Inverted Checks

Inverted checks flip the normal success/failure logic: they alert when a check succeeds instead of when it fails. This is ideal for security monitoring—alerting when something that should be inaccessible becomes accessible.

How It Works

Normal CheckInverted Check
Alert on failureAlert on success
Port closed = failurePort closed = success (no alert)
Port open = successPort open = failure (alert!)

Use Cases

Firewall Validation

Verify that internal ports remain closed to the public internet. If a firewall rule is accidentally removed, you'll know immediately.

{
  "name": "internal-db-should-be-closed",
  "type": "tcp",
  "config": {
    "host": "db.example.com",
    "port": 5432
  },
  "inverted": true,
  "regions": ["na-east-ewr", "eu-central-fra"],
  "interval_seconds": 300
}

Private Endpoint Monitoring

Ensure admin panels, staging environments, or internal APIs aren't accidentally exposed.

Development Server Detection

Alert if development servers with debug mode enabled become accessible from the internet.

Rate Limiting Validation

Verify that rate limiting is working by checking that requests are blocked when they should be.

Deployment Version Detection

Create an inverted check that alerts when a new version string appears, confirming deployments happened.

{
  "name": "detect-new-deployment",
  "type": "https",
  "config": {
    "url": "https://api.example.com/version",
    "expected_body": "v2.0.0"
  },
  "inverted": true,
  "regions": ["na-east-ewr"],
  "interval_seconds": 60
}

This alerts when the response no longer contains "v2.0.0", indicating a new version was deployed.

API Usage

Set inverted: true when creating a check:

curl -X POST https://api.quismon.com/v1/checks \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "admin-panel-not-public",
    "type": "https",
    "config": {
      "url": "https://example.com/admin",
      "expected_status": [401, 403]
    },
    "inverted": true,
    "regions": ["na-east-ewr", "eu-central-fra", "ap-southeast-sin"],
    "interval_seconds": 300
  }'

Inverted Logic by Check Type

Check TypeNormalInverted
TCPAlert if port closedAlert if port open
HTTP/HTTPSAlert if status/body mismatchAlert if status/body match
PingAlert if host unreachableAlert if host reachable
DNSAlert if resolution failsAlert if resolution succeeds

Terraform Example

# Ensure database port is NOT accessible from outside
resource "quismon_check" "db_not_public" {
  name     = "db-port-not-public"
  type     = "tcp"
  inverted = true

  config = jsonencode({
    host = "db.example.com"
    port = 5432
  })

  regions          = ["na-east-ewr", "eu-central-fra"]
  interval_seconds = 300
}

# Alert rule for inverted check
resource "quismon_alert_rule" "db_exposed" {
  name          = "database-port-exposed"
  check_id      = quismon_check.db_not_public.id
  condition     = "failed_for_1m"
  severity      = "critical"
  message       = "Database port is accessible from the internet!"

  notification_channels = [quismon_notification_channel.slack.id]
}

Console Indicators

Inverted checks are clearly marked in the console with:

  • A purple "Inverted" badge next to the check name
  • Tooltip explaining: "alerts on success instead of failure"
  • Status indicators show inverted logic (success = red, failure = green)