Skip to content
Detectors

Scanner deep dive

Overview

Duo is a security platform that provides multi-factor authentication and identity management services.
From the detector’s Description() in source
Provider and detector details

Summary

ProviderNo provider details added yet.

Runs on any connection. Triggered by keywords in the content, after decoding.How TruffleHog works

How detection works

The Duo detector looks for pieces of a credential that belong together. The code names fields such as “host” and “ikey”.

Runs by default

Matching rules and source
Keywords
  • duosecurity

Regexes

  • Regex 1integrationKeyPatduo.go:36 (opens TruffleHog source on GitHub)Only code file

    \b(DI[A-Z0-9]{18})\b

    Matches 18-character strings of uppercase letters and digits after a prefix such as “DI”.

    Show as a diagram

    Must appear near: “duo”

  • Regex 2secretKeyPatduo.go:39 (opens TruffleHog source on GitHub)Only code file

    \b([A-Za-z0-9]{40})\b

    Matches 40-character strings of letters and digits.

    Show as a diagram

    Must appear near: “duo”

  • Regex 3apiHostduo.go:42 (opens TruffleHog source on GitHub)Only code file

    \b([a-z0-9-]{6,}\.duosecurity\.com)\b
    Show as a diagram

How it works

  1. Skips any text that doesn’t contain “duosecurity”. This keeps scanning fast.
  2. Looks for 18-character strings of uppercase letters and digits after a prefix such as “DI” within 40 characters after the word “duo”. Also looks for 40-character strings of letters and digits within 40 characters after the word “duo”. 1 more pattern in the technical detail.
  3. Finds each part (host, ikey, skey and application) and pairs them.
  4. Reports each remaining match as a possible Duo credential. It isn’t known to work until it’s verified.
Prefix regex
Several partshost, ikey, skey and application
Guards against false matches
Not found in source
Not found in source
  • application
Pairing and normalization
  • host, ikey, skey, application are combined from match sets

How it behaves

What this detector does at each step of the TruffleHog pipeline.

pkg/detectors/duo · Scanner

Keywords

Any one of these in the decoded text wakes the detector.

  • duosecurity

duo.go line 64 (opens TruffleHog source on GitHub)

Behavior

Multi-part
Yes, pairs two parts such as an ID and a secret
duo.go line 26 (opens TruffleHog source on GitHub)
Custom endpoints
No
Cloud endpoint
None
Randomness check
None in this detector's own code
False-positive check
The shared word lists
Enabled by default
Yes in the open-source CLI, which turns on its feature flag
defaults.go line 1179 (opens TruffleHog source on GitHub)

Verification. When a scan allows it, TruffleHog tests a match by calling the provider. A scan can turn this off for every detector or for this one. Atlas only describes this; it never tests credentials. How the verify decision works

Analyzer.None in the open-source code.

In short

Wakes on “duosecurity”, reads 1024 bytes around each hit to pair two parts and tests matches with the provider. The open-source CLI runs it by turning on its feature flag.

How verification works

What it means

Sends GET to https://.

The detection and verification evidence on this page comes from the Open Source implementation. Check the Enterprise coverage guide for product availability.

Does checking a key change anything at the provider?

Not expected to: it’s a GET request, which reads without changing anything, and the source declares no changes.

Source says: GET as declared in source; mutating side effects not declared

Verification walkthrough

How it works

  1. Sends a GET to https://.
  2. Puts the found credential in the request: credential is sent in the Authorization header; scheme is not Bearer/token in source.
  3. If the request can’t reach the provider, the result is an error, not a rejection.

Evidence from source

How responses are judged

Not found in source

Troubleshoot this check

If a result looks wrong, work through these steps. They’re built from the request and status rules above. The Atlas doesn’t send anything.

1. Send the same request yourself

curl -i -H "Authorization: $AUTHORIZATION_VALUE" "https://"
  • $AUTHORIZATION_VALUE: the full Authorization header value (its format depends on the provider)

Rule: header. Key placement as recorded: Authorization header.

Only test keys you own or are allowed to check. Each command is one read-only GET request, the same one TruffleHog makes. Compare the status you get with “How responses are judged” above.

2. Likely causes

  • The scanner couldn't reach the provider. The scanner needs outbound HTTPS access to the provider. A firewall, proxy or DNS problem is reported as an error, not a rejection, and the key can be checked again.

3. Check the provider’s docs

No provider doc recorded for this check yet.

4. Still stuck

Report it to TruffleHog

Include the status code and response you got. Never include the key.

Errors, timeouts and rate limits
Not found in source
Not found in source
SetVerificationError

transport errors return a verification error

All URLs found in source

  • https://duo.com/docs/adminapi#account-info
  • https://duo.com/docs/authapi#check

Verified findings

Open Source · Standard output (stdout)

The CLI prints verified findings to stdout. Use --json for structured output.

Example scan output · credential redacted

✅ Found verified result 🐷🔑
Detector Type: Duo
Decoder Type: PLAIN
Raw result: [redacted]
Terminal printer source
CI formats

With --github-actions, GitHub Actions displays this workflow command as a warning on the indicated file and line.

::warning file=config/example.env,line=8,endLine=8::Found verified Duo result 🐷🔑
GitHub Actions printer source

Legacy compatibility. --json-legacy writes pre-v3 JSON for Git, GitLab, and GitHub sources only.

Enterprise alerts

When Enterprise verifies that a secret is live, a configured notifier can alert your team. The finding is also available through the Enterprise API.

Optional analysis

No analyzer is recorded for this detector.

A missing analyzer is not evidence the credential has no further access.

Rotation resources

Use the provider’s instructions for this credential.

Rotation instructions

Duo’s application guide explains how an administrator resets the secret key for the integration whose key and API hostname the detector found. Update the integration with its replacement secret.

Provider documentation checked by Atlas on .

See it in the rotation directory

Token types

TruffleHog’s source doesn’t name a token type or require a fixed prefix for this detector.

Pages TruffleHog’s source links to (2)

Written in the detector’s source by its authors. Shown as written: this doesn’t say what each page covers.

Coverage in other scanners

No confirmed matches in the available catalogs.

  • BetterleaksNo confirmed match
  • GitHub Secret ProtectionNo confirmed match
  • GitleaksNo confirmed match
  • KingfisherNo confirmed match

Changes

1 recorded change since Sep 18, 2026; 1 still needs review.

  1. What this change means

    Source files changed in ways the catalog does not model (for example logic inside Verify). Read the diff to judge the effect.

    pkg/detectors/duo/duo.go+74−61View file
    @@ -6,6 +6,8 @@ import (
    66 "crypto/sha1"
    77 "encoding/base64"
    88 "encoding/hex"
    9added: "encoding/json"
    10added: "errors"
    911 "fmt"
    1012 "io"
    1113 "net/http"
    @@ -40,6 +42,22 @@ var (
    4042 apiHost = regexp.MustCompile(`\b([a-z0-9-]{6,}\.duosecurity\.com)\b`)
    4143)
    4244
    45added: const (
    46added: adminAPIPath = "/admin/v1/info/summary" // https://duo.com/docs/adminapi#account-info
    47added: authAPIPath = "/auth/v2/check" // https://duo.com/docs/authapi#check
    48added:
    49added: adminApplication = "Admin API"
    50added: authApplication = "Auth API"
    51added:
    52added: duoCodeInvalidSignature = 40103
    53added: duoCodeAccessForbidden = 40301
    54added: )
    55added:
    56added: type duoReply struct {
    57added: status int
    58added: code int
    59added: }
    60added:
    4361// Keywords are used for efficiently pre-filtering chunks.
    4462// Use identifiers in the secret preferably, or the provider name.
    4563func (s Scanner) Keywords() []string {
    @@ -53,7 +71,7 @@ func (s Scanner) getClient() *http.Client {
    5371 return defaultClient
    5472}
    5573
    56removed: // FromData will find and optionally verify DeepSeek secrets in a given set of bytes.
    74added: // FromData will find and optionally verify Duo secrets in a given set of bytes.
    5775func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) {
    5876 dataStr := string(data)
    @@ -77,31 +95,19 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
    7795 Raw: []byte(apiKey),
    7896 RawV2: []byte(fmt.Sprintf("%s:%s:%s", host, apiKey, apiSecret)),
    7997 ExtraData: map[string]string{
    80removed: "application": "Admin API",
    98added: "application": adminApplication,
    8199 },
    82100 SecretParts: map[string]string{
    83101 "host": host,
    84102 "ikey": apiKey,
    85103 "skey": apiSecret,
    86removed: "application": "Admin API",
    104added: "application": adminApplication,
    87105 },
    88106 }
    89107 if verify {
    90removed: verified, verificationErr := VerifyAdminToken(ctx, s.getClient(), host, apiKey, apiSecret)
    91removed: // we will try auth api verification if admin api verification fails without error,
    92removed: // which is in the case of it returning 401 unauthorized due to invalid credentials.
    93removed: if !verified && verificationErr == nil {
    94removed: var authStatusCode int
    95removed: verified, authStatusCode, verificationErr = VerifyAuthToken(ctx, s.getClient(), host, apiKey, apiSecret)
    96removed: // The Auth API responds 403 (not 401) when ikey/skey are
    97removed: // structurally valid Admin API keys, active or not. That still
    98removed: // counts as verified, but the keys remain Admin API keys, so
    99removed: // only relabel to Auth API when the check actually succeeded (200).
    100removed: if authStatusCode != http.StatusForbidden {
    101removed: s1.ExtraData["application"] = "Auth API"
    102removed: s1.SecretParts["application"] = "Auth API"
    103removed: }
    104removed: }
    108added: verified, application, verificationErr := verifyMatch(ctx, s.getClient(), host, apiKey, apiSecret)
    109added: s1.ExtraData["application"] = application
    110added: s1.SecretParts["application"] = application
    105111 s1.SetVerificationError(verificationErr, host, apiKey, apiSecret)
    106112 s1.Verified = verified
    107113 }
    @@ -112,49 +118,56 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
    112118 return results, nil
    113119}
    114120
    115removed: // returns verified=true if credentials are valid and belong to auth api, false if creds are invalid, and error if creds belong to auth api or for anything else (e.g., network error).
    116removed: // The HTTP status code is also returned so callers can distinguish a genuine 200 from a
    117removed: // 403, which the Auth API returns for structurally valid Admin API keys (active or not).
    118removed: func VerifyAuthToken(
    121added: // verifyMatch checks the credentials against the Admin API, then the Auth API, and
    122added: // returns whether they are valid and which application they belong to.
    123added: //
    124added: // Only a 200 from either API proves the credentials valid, and only error code 40103
    125added: // (invalid signature) from either API proves them invalid: that API recognized the
    126added: // integration key and rejected the secret key. Other responses are reported as a verification error.
    127added: func verifyMatch(
    119128 ctx context.Context,
    120129 client *http.Client,
    121130 host, ikey, skey string,
    122removed: ) (bool, int, error) {
    123removed: // Docs: https://duo.com/docs/authapi#check
    124removed: return verifyDuoRequest(
    125removed: ctx,
    126removed: client,
    127removed: host,
    128removed: ikey,
    129removed: skey,
    130removed: "/auth/v2/check",
    131removed: )
    132removed: }
    131added: ) (bool, string, error) {
    132added: admin, adminErr := duoRequest(ctx, client, host, ikey, skey, adminAPIPath)
    133added: if adminErr == nil && admin.status == http.StatusOK {
    134added: return true, adminApplication, nil
    135added: }
    133136
    134removed: // returns 401 unauthorized if credentials are invalid, 200 OK if valid, and error for anything else
    135removed: func VerifyAdminToken(
    136removed: ctx context.Context,
    137removed: client *http.Client,
    138removed: host, ikey, skey string,
    139removed: ) (bool, error) {
    140removed: // Docs: https://duo.com/docs/adminapi#account-info
    141removed: verified, _, err := verifyDuoRequest(
    142removed: ctx,
    143removed: client,
    144removed: host,
    145removed: ikey,
    146removed: skey,
    147removed: "/admin/v1/info/summary",
    137added: auth, authErr := duoRequest(ctx, client, host, ikey, skey, authAPIPath)
    138added: if authErr == nil && auth.status == http.StatusOK {
    139added: return true, authApplication, nil
    140added: }
    141added:
    142added: if (adminErr == nil && admin.code == duoCodeInvalidSignature) ||
    143added: (authErr == nil && auth.code == duoCodeInvalidSignature) {
    144added: return false, adminApplication, nil
    145added: }
    146added: if adminErr != nil {
    147added: return false, adminApplication, adminErr
    148added: }
    149added: if authErr != nil {
    150added: return false, adminApplication, authErr
    151added: }
    152added:
    153added: msg := fmt.Sprintf(
    154added: "indeterminate Duo verification: admin API returned HTTP %d (code %d), auth API returned HTTP %d (code %d)",
    155added: admin.status, admin.code, auth.status, auth.code,
    148156 )
    149removed: return verified, err
    157added: if admin.code == duoCodeAccessForbidden {
    158added: msg += `; an Admin API integration needs the "Grant read information" permission to be verified`
    159added: }
    160added: return false, adminApplication, errors.New(msg)
    150161}
    151162
    152removed: func verifyDuoRequest(
    163added: // duoRequest sends a signed GET request to the given Duo API path and returns the HTTP
    164added: // status and Duo error code without interpreting them.
    165added: func duoRequest(
    153166 ctx context.Context,
    154167 client *http.Client,
    155168 host, ikey, skey string,
    156169 path string,
    157removed: ) (bool, int, error) {
    170added: ) (duoReply, error) {
    158171
    159172 timestamp := time.Now().UTC().Format(http.TimeFormat)
    @@ -185,7 +198,7 @@ func verifyDuoRequest(
    185198 nil,
    186199 )
    187200 if err != nil {
    188removed: return false, 0, err
    201added: return duoReply{}, err
    189202 }
    190203
    191204 req.Header.Set("Authorization", "Basic "+auth)
    @@ -193,23 +206,23 @@ func verifyDuoRequest(
    193206
    194207 res, err := client.Do(req)
    195208 if err != nil {
    196removed: return false, 0, err
    209added: return duoReply{}, err
    197210 }
    198211 defer func() {
    199212 _, _ = io.Copy(io.Discard, res.Body)
    200213 _ = res.Body.Close()
    201214 }()
    202215
    203removed: switch res.StatusCode {
    204removed: case http.StatusOK:
    205removed: return true, res.StatusCode, nil
    206removed: case http.StatusUnauthorized:
    207removed: return false, res.StatusCode, nil
    208removed: case http.StatusForbidden: // Auth API returns 403 if credentials are admin keys be it active or inactive
    209removed: return true, res.StatusCode, nil
    210removed: default:
    211removed: return false, res.StatusCode, fmt.Errorf("unexpected HTTP status %d", res.StatusCode)
    216added: reply := duoReply{status: res.StatusCode}
    217added: if res.StatusCode != http.StatusOK {
    218added: var body struct {
    219added: Code int `json:"code"`
    220added: }
    221added: if json.NewDecoder(io.LimitReader(res.Body, 64<<10)).Decode(&body) == nil {
    222added: reply.code = body.Code
    223added: }
    212224 }
    225added: return reply, nil
    213226}
    214227
    215228func (s Scanner) Type() detector_typepb.DetectorType {

Source

Every fact on this page was parsed from trufflesecurity/trufflehog at 2325546, unless a row below says otherwise.

2325546
2325546
Parser
trufflehog-detectors-analyzers-v12
Extraction
intel-detector-v7

4 of 20 evidence rows need attention

Evidence rows that need attention
FieldStatusValueSource
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuideNone extractedFile
timeoutNone extractedFile
rateLimitNone extractedFile
All 20 evidence rows
All evidence rows
FieldStatusValueSource
descriptionDuo is a security platform that provides multi-factor authentication and identity management services.File
keywordsduosecurityFile
detectorTypesDuoFile
filesduo.goFile
patterns\b(DI[A-Z0-9]{18})\b, \b([A-Za-z0-9]{40})\b, \b([a-z0-9-]{6,}\.duosecurity\.com)\bFile
patternTypeprefix_regexFile
statusactiveFile
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuideNone extractedFile
verify.hasVerifyYesFile
verify.httpMethodsGETFile
verify.statusCodesOKFile
timeoutNone extractedFile
rateLimitNone extractedFile
errorHandlingSetVerificationErrorFile
verify.urlshttps://duo.com/docs/adminapi#account-info, https://duo.com/docs/authapi#checkFile
detection.keywordsduosecurityLines 63–63
verification.endpointhttps://Lines 194–194
verification.httpMethodGETLines 194–194
verification.authenticationMethodAuthorization headerLines 204–204
Parser completeness
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Unknown
  • Field status: Unknown
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Not scanned
Package files (1)
  • duo.go