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 Check | Inverted Check |
| Alert on failure | Alert on success |
| Port closed = failure | Port closed = success (no alert) |
| Port open = success | Port 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.
Configuration Drift Detection
Verify that a security header stays absent from public responses, or that a legacy endpoint stays gone after a migration.
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 Type | Normal | Inverted |
| TCP | Alert if port closed | Alert if port open |
| HTTP/HTTPS | Alert if status/body mismatch | Alert if status/body match |
| Ping | Alert if host unreachable | Alert if host reachable |
| DNS | Alert if resolution fails | Alert 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)
The starts-broken family: test-driven monitoring
The starts_broken family extends the test-driven workflow to
any check - including inverted ones. Create the monitor
before the thing it watches exists; it stays silent while the world
is in the "wrong" state and arms when the world matches.
The attributes
| Attribute | Default | Meaning |
starts_broken | false | Alerting is suppressed until the check's first success. After that first success the check graduates: the stored flag clears automatically and it behaves as a normal check. |
starts_broken_arrival_notice | true | On the first success, send the arrival notice ("it's up" / "the expected state is in effect") through the check's alert-rule channels. Opt out for flaky-at-boot services. |
starts_broken_deadline_seconds | unset | Create-only "never came up" guard: if the first success hasn't happened within N seconds of creation, suppression lifts and failure alerts flow - the operator hears that the thing they pre-registered never came up. Graduation (first success) still clears everything. |
alert_after_first_success remains accepted as a deprecated alias of
starts_broken.
Three scenarios
1. Inverted alone - firewall enforcement monitoring
A TCP check against db.example.com:5432 with
inverted = true: it succeeds while the firewall blocks the port and
fails the moment the port becomes reachable. Alert = "database port is
internet-reachable". Your security posture becomes an ongoing assertion rather
than a quarterly audit.
2. Starts-broken alone - test-driven monitoring
A check created during the sprint against
api.example.com/v2/recommendations before the service is deployed:
failures are the planned state (suppressed), the first success sends the
arrival notice ("recommendations API is up"), and normal alerting
arms from then on.
2b. Starts-broken alone - deployment version detection
The same pattern detects deployments. Create the check before the
release ships, asserting the version you are about to deploy:
{
"name": "api-deployed-v2",
"type": "https",
"config": {
"url": "https://api.example.com/version",
"expected_body": "v2.0.0"
},
"starts_broken": true,
"starts_broken_arrival_notice": true,
"regions": ["na-east-ewr"],
"interval_seconds": 60
}
- Before the release: the endpoint still serves v1.x → the
check fails → suppressed (the failure is planned).
- The deployment lands: the body matches → first success →
arrival notice: "v2.0.0 is live", confirming the rollout.
- From then on: the check graduates to normal enforcement -
a rollback or accidental version drift alerts like any failure.
This is why the example is a starts_broken check rather than an
inverted one: an inverted check would sit red forever after the
deployment (until you edit expected_body) and would report the
rollout as an alert instead of an arrival notice. With
starts_broken the deployment is the planned recovery, the notice is
the confirmation, and the check ends green.
3. Both - planned decommission with zombie detection
legacy-api.example.com is scheduled for shutdown on Friday. An
inverted check with starts_broken = true:
- Today → Friday: server still running → the inverted check fails
(server reachable) → suppressed (the failure is planned).
- Friday: shutdown. Server dark → inverted check succeeds →
arrival notice: "decommission confirmed - legacy-api is dark".
- Any time after: someone resurrects it (zombie process, accidental
reprovision, DR failover) → inverted check fails → alert: legacy-api is
reachable again.
The combination is the red → green → enforced pattern applied to a real
operational deadline.
4. Deadline orders - the M&A takeover playbook
Due diligence on an acquisition shows the product is wide open: database
ports reachable, admin panels public, debug endpoints live. The acquiring
CTO doesn't file tickets and hope - they register the exposure and the
deadline in one place:
{
"name": "acquired-product db port must be closed",
"type": "tcp",
"config": { "host": "db.acquired-product.com", "port": 5432 },
"inverted": true,
"starts_broken": true,
"starts_broken_arrival_notice": true,
"starts_broken_deadline_seconds": 604800,
"regions": ["na-east-ewr", "eu-central-fra"]
}
What happens next is the order being tracked automatically:
- While the port is open (today's broken reality): the check
fails - suppressed. No alert fatigue while the work is pending.
- Ops closes the port in time: first success →
arrival notice ("the expected block/enforcement is now in
effect") → the check graduates and enforces permanently. A regression
re-opens the port → alert.
- Ops misses the deadline: a one-time
deadline-breach escalation fires ("never reached its expected
state - the pre-registered deadline expired"), suppression lifts, and
every subsequent failure alerts normally. The order wasn't carried out,
and the platform says so.
One configuration is simultaneously the audit record of the exposure, the
deadline given to the team, the confirmation when the fix lands, and the
enforcement from then on.
Terraform
resource "quismon_check" "legacy_api_dark" {
name = "legacy-api decommissioned"
type = "tcp"
inverted = true
starts_broken = true
config = {
host = "legacy-api.example.com"
port = 443
timeout = 5
}
}
Note: starts_broken is create-only - after the first
success the platform graduates the check to a normal configuration and the stored
flag clears, so remove the attribute from your configuration after the first
successful apply.