Aller au contenu

scan

Ce contenu n’est pas encore disponible dans votre langue.

Probes one or more URLs to determine whether each response is cacheable per HTTP semantics (RFC 9111), whether it’s actually being cached, and how the fronting CDN/reverse proxy handles the cache key.

Terminal window
cache-detective scan --url https://example.com/

Exactly one of these must be set:

FlagDescription
--urlSingle target URL to scan
--listPath to a newline-delimited list of URLs (#-prefixed lines are comments)
--sitemapURL of a sitemap.xml to scan (flat <urlset> only, not <sitemapindex>)
--harPath to a .har file to import GET/HEAD requests from
--crawlCrawl same-origin links starting from --url instead of scanning it alone
FlagDefaultDescription
--path-prefix(none)Restrict --crawl to URLs under this path prefix
--max-pages50Maximum pages to discover with --crawl
--respect-robotstrueHonor robots.txt Disallow rules for * during --crawl
Terminal window
cache-detective scan --url https://example.com/ --crawl --path-prefix /blog --max-pages 100
FlagDefaultDescription
--methodGETHTTP method to test
--header(none)Custom request header "Name=Value" (repeatable)
--cookie(none)Cookie "name=value" to send with every request (repeatable)
--bearer(none)Bearer token for authenticated cache testing
--auth-profiles(none)Path to a JSON file mapping target origin (scheme://host[:port]) to per-origin headers/cookies/bearer, overriding --header/--cookie/--bearer for matching resources
--max-retries0Maximum retry attempts per probe request on transient failures (0 = no retries)
--retry-delay500msBase delay between retry attempts (grows with backoff, honors Retry-After)
--requests3Probe requests issued per resource for live cache-state detection
--interval500msDelay between consecutive probe requests to the same resource
--timeout15sPer-request timeout
--stale-window-max-wait30sMaximum time to wait for a resource to enter its declared stale-while-revalidate window before giving up on actively confirming it
--max-concurrencynumber of CPUsMaximum concurrent checks
--max-resource-concurrencynumber of CPUsMaximum concurrent resources per check
Terminal window
cache-detective scan --url https://example.com/account \
--bearer "$TOKEN" \
--cookie "session=abc123" \
--header "X-Api-Version=2"

--header, --cookie, and --bearer apply the same credentials to every resource in the scan. When a --list, --sitemap, --har, or --crawl run spans multiple hosts that each need different credentials, use --auth-profiles instead: a JSON file mapping each target’s origin to its own headers, cookies, and/or bearer token. A resource whose origin has no matching entry falls back to --header/--cookie/--bearer.

auth-profiles.json
{
"https://api.example.com": {
"bearer": "eyJhbGciOi...",
"headers": { "X-Api-Version": ["2"] }
},
"https://admin.example.com": {
"cookies": { "session": "abc123" }
}
}
Terminal window
cache-detective scan --list urls.txt --auth-profiles auth-profiles.json
FlagDefaultDescription
--aggressivefalseEnable cache poisoning/deception probing
--max-aggressive-requests10Hard cap on extra probe requests per resource for --aggressive checks (and the read-only vary-key check), even with --aggressive set
Terminal window
cache-detective scan --url https://staging.example.com/ --aggressive

--aggressive also gates stale-if-error confirmation — since confirming it means asking the origin to simulate a failure.

scan shares its output/reporting flags with the rest of the CerberAuth CLI suite:

FlagDefaultDescription
--formatterminalTerminal display format
--no-colorfalseDisable ANSI colors in terminal output
--quietfalseSuppress terminal display of the report
--output(none)File path to additionally write the report to
--output-formatjsonFormat for --output
--show-all-findingsfalseShow every finding on stdout, not just active ones
--report-url(none)HTTP endpoint to POST the report to
--report-header(none)Additional HTTP headers for the report transport (key=value)
--report-formatjsonFormat for --report-url
Terminal window
cache-detective scan --url https://example.com/ --output-format json --output report.json --quiet

scan exits 1 if any check itself failed to execute (network errors, timeouts, …) and 0 otherwise — findings are reported but don’t affect the exit code on their own. To gate a build on specific findings, parse the JSON output (see the GitHub Actions guide) or use diff to detect drift against a baseline.