Skip to content
Detectors

Scanner deep dive

Overview

Serval is a workflow automation platform for IT and security teams. API keys pair a client ID with a secret and can call the Serval public API or run self-hosted workers.
From the detector’s Description() in source

Needs a person to check

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 Serval detector looks for pieces of a credential that belong together. The code names fields such as “client secret” and “client ID”.

Runs by default

Matching rules and source
Keywords
  • svl_secret_

Regexes

  • Regex 1idPatserval.go:46–47 (opens TruffleHog source on GitHub)Only code file

    \b([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\b
    Show as a diagram

    Must appear near: “serval” or “client”

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

    \b(svl_secret_(pk|wk|mk)_([0-9A-Za-z]{43})([0-9A-Za-z]{6}))\b
    Show as a diagram

How it works

  1. Skips any text that doesn’t contain “svl_secret_”. This keeps scanning fast.
  2. Looks for text matching any of its 2 patterns.
  3. Finds each part (client secret and client ID) and pairs them.
  4. Reports each remaining match as a possible Serval credential. It isn’t known to work until it’s verified.
Prefix regex
Several partsclient_secret and client_id
Guards against false matches
Not found in source
Not found in source
  • key_type
  • endpoint
Pairing and normalization
  • client_secret, client_id are combined from match sets

How it behaves

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

pkg/detectors/serval · Scanner

Keywords

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

  • svl_secret_

serval.go line 61 (opens TruffleHog source on GitHub)

Behavior

Multi-part
No
Match window
512 bytes on each side of a keyword
ahocorasickcore.go line 159 (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 1641 (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 “svl_secret_” 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 POST to a templated URL; 200 means verified, 401 means not verified, any other status is an error (unverified, not rejected).

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

Verification host is a template. The endpoint host is filled in at runtime (%s), so the exact host is not known from source.

Does checking a key change anything at the provider?

Probably not, but not certain: the source declares no changes, and many checks use POST only to read. POST can change data, so check the source if it matters.

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

Verification walkthrough

How it works

  1. Sends a POST to %s/v2/auth/token.
  2. Puts the found credential in the request: id is used as the username and secret is used as the password.
  3. If the answer is 200, TruffleHog reports the match as verified under this detector’s rules.
  4. If the answer is 401, it was rejected: reported as not verified.
  5. Any other answer sets a verification error: reported as unverified with an error, not as rejected.
  6. If the request can’t reach the provider, the result is an error, not a rejection.

Evidence from source

Endpoint

%s/v2/auth/token

Part of this address is filled in when the check runs, so the exact host isn’t known from source.

serval.go:181 (opens TruffleHog source on GitHub)

Key is sent as

HTTP Basic Authentication

serval.go:185 (opens TruffleHog source on GitHub)

How responses are judged

How each response status is judged
StatusOutcomeSource
Verifiedserval.go:198 (opens TruffleHog source on GitHub)
401Not verifiedserval.go:200 (opens TruffleHog source on GitHub)
OtherdefaultParser mapped default to not verified; source sends it to SetVerificationError.serval.go:202 (opens TruffleHog source on GitHub)
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

No command for this check. The check sends a POST request with a body the Atlas doesn't record, so a command might get a different answer and might not be read-only.

Rule: not-get. Key placement as recorded: HTTP Basic Authentication.

2. Likely causes

  • The check used the wrong address. Part of this check's address depends on your account or server. If the key belongs to a self-hosted, regional or custom-domain instance, make sure that's the address being called.
  • 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.
  • The provider rejected the key. TruffleHog counts 401 as not verified: usually a revoked, expired or mistyped key.
  • Rate limit or provider problem. TruffleHog counts any other status as an error, not a rejection. A rate limit (429) or an outage lands here; the key can be checked again later.
  • The provider changed its API. If the provider answers differently from the table above, its API may have changed since this check was written. Compare against the provider's docs.

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; unexpected HTTP response status %d

other statuses: verification error or unknown

transport errors return a verification error

All URLs found in source

  • https://public.api.serval.com
  • https://public.eu1.serval.com
  • %s/v2/auth/token

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: Serval
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 Serval 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

Atlas has no rotation guide for this detector.

Token types

TruffleHog’s source looks for 1 token type, by prefix. It doesn’t name them.

Token types: from TruffleHog’s source, and what the vendor says
Prefix
svl_secret_

The detector’s source links no vendor pages.

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

    Atlas added serval to its detector catalog in this update.

    pkg/detectors/serval/serval.go+213−0View file
    @@ -0,0 +1,213 @@
    1added: package serval
    2added:
    3added: import (
    4added: "cmp"
    5added: "context"
    6added: "fmt"
    7added: "hash/crc32"
    8added: "io"
    9added: "net/http"
    10added: "net/url"
    11added: "strings"
    12added:
    13added: regexp "github.com/wasilibs/go-re2"
    14added:
    15added: "github.com/trufflesecurity/trufflehog/v3/pkg/common"
    16added: "github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
    17added: "github.com/trufflesecurity/trufflehog/v3/pkg/pb/detector_typepb"
    18added: )
    19added:
    20added: type Scanner struct {
    21added: client *http.Client
    22added: // endpoints overrides regionEndpoints in tests.
    23added: endpoints []string
    24added: }
    25added:
    26added: // Ensure the Scanner satisfies the interface at compile time.
    27added: var _ detectors.Detector = (*Scanner)(nil)
    28added:
    29added: // regionEndpoints are the public API hosts of Serval's cloud regions. Regions
    30added: // are isolated, so a key issued in one is unknown to the other and every
    31added: // region must be tried before a key is called invalid.
    32added: var regionEndpoints = []string{
    33added: "https://public.api.serval.com",
    34added: "https://public.eu1.serval.com",
    35added: }
    36added:
    37added: var (
    38added: defaultClient = common.SaneHttpClient()
    39added:
    40added: // Serval API key secrets are svl_secret_<tag>_<43 base62 random><6 base62
    41added: // CRC32 checksum>. The tag names the key type: pk public API, wk
    42added: // self-hosted worker, mk Serval-managed worker.
    43added: secretPat = regexp.MustCompile(`\b(svl_secret_(pk|wk|mk)_([0-9A-Za-z]{43})([0-9A-Za-z]{6}))\b`)
    44added:
    45added: // The client ID that pairs with a secret is the API key's UUID.
    46added: idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"serval", "client"}) +
    47added: `\b([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\b`)
    48added: )
    49added:
    50added: var keyTypes = map[string]string{
    51added: "pk": "public_api",
    52added: "wk": "worker",
    53added: "mk": "managed_worker",
    54added: }
    55added:
    56added: const base62Alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
    57added:
    58added: // Keywords are used for efficiently pre-filtering chunks.
    59added: // Use identifiers in the secret preferably, or the provider name.
    60added: func (s Scanner) Keywords() []string {
    61added: return []string{"svl_secret_"}
    62added: }
    63added:
    64added: // FromData will find and optionally verify Serval API keys in a given set of bytes.
    65added: func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) {
    66added: dataStr := string(data)
    67added:
    68added: secrets := make(map[string]string)
    69added: for _, match := range secretPat.FindAllStringSubmatch(dataStr, -1) {
    70added: tag, random, checksum := match[2], match[3], match[4]
    71added: // A failed checksum means the match is not a Serval-issued secret.
    72added: if secretChecksum(tag, random) != checksum {
    73added: continue
    74added: }
    75added: secrets[match[1]] = tag
    76added: }
    77added: if len(secrets) == 0 {
    78added: return nil, nil
    79added: }
    80added:
    81added: ids := make(map[string]struct{})
    82added: for _, match := range idPat.FindAllStringSubmatch(dataStr, -1) {
    83added: ids[strings.ToLower(match[1])] = struct{}{}
    84added: }
    85added:
    86added: for secret, tag := range secrets {
    87added: // Verification needs the client ID, so a secret found without one
    88added: // is still reported, unverified.
    89added: if len(ids) == 0 {
    90added: results = append(results, detectors.Result{
    91added: DetectorType: detector_typepb.DetectorType_Serval,
    92added: Raw: []byte(secret),
    93added: SecretParts: map[string]string{"client_secret": secret},
    94added: ExtraData: map[string]string{"key_type": keyTypes[tag]},
    95added: })
    96added: continue
    97added: }
    98added:
    99added: for id := range ids {
    100added: r := detectors.Result{
    101added: DetectorType: detector_typepb.DetectorType_Serval,
    102added: Raw: []byte(secret),
    103added: RawV2: []byte(id + ":" + secret),
    104added: SecretParts: map[string]string{"client_id": id, "client_secret": secret},
    105added: ExtraData: map[string]string{"key_type": keyTypes[tag]},
    106added: }
    107added:
    108added: // Only public API keys can exchange credentials at the public
    109added: // token endpoint. It rejects worker keys with the same 401 as a
    110added: // wrong secret, so verifying them would report live keys as
    111added: // invalid.
    112added: if verify && tag == "pk" {
    113added: client := cmp.Or(s.client, defaultClient)
    114added: endpoints := s.endpoints
    115added: if len(endpoints) == 0 {
    116added: endpoints = regionEndpoints
    117added: }
    118added: isVerified, endpoint, vErr := verifyInRegions(ctx, client, endpoints, id, secret)
    119added: r.Verified = isVerified
    120added: if isVerified {
    121added: r.ExtraData["endpoint"] = endpoint
    122added: }
    123added: r.SetVerificationError(vErr, secret)
    124added: }
    125added:
    126added: results = append(results, r)
    127added:
    128added: // A secret belongs to exactly one client ID, so once a pair
    129added: // verifies, trying the remaining IDs only spends rate limit.
    130added: if r.Verified {
    131added: break
    132added: }
    133added: }
    134added: }
    135added:
    136added: return results, nil
    137added: }
    138added:
    139added: // secretChecksum mirrors Serval's issuer: CRC32 (IEEE) of "<tag>_<random>",
    140added: // written big-endian as six base62 digits.
    141added: func secretChecksum(tag, random string) string {
    142added: sum := crc32.ChecksumIEEE([]byte(tag + "_" + random))
    143added: out := make([]byte, 6)
    144added: for i := len(out) - 1; i >= 0; i-- {
    145added: out[i] = base62Alphabet[sum%62]
    146added: sum /= 62
    147added: }
    148added: return string(out)
    149added: }
    150added:
    151added: // verifyInRegions tries each region until one verifies the key and returns
    152added: // the endpoint that did. A 401 from one region does not override an
    153added: // indeterminate error from another, since that region may own the key.
    154added: func verifyInRegions(ctx context.Context, client *http.Client, endpoints []string, id, secret string) (bool, string, error) {
    155added: var lastErr error
    156added: for _, endpoint := range endpoints {
    157added: isVerified, err := verifyKey(ctx, client, endpoint, id, secret)
    158added: if isVerified {
    159added: return true, endpoint, nil
    160added: }
    161added: if err != nil {
    162added: lastErr = err
    163added: }
    164added: }
    165added: return false, "", lastErr
    166added: }
    167added:
    168added: // verifyKey exchanges the credentials for an access token with the OAuth2
    169added: // client credentials grant. The token in a successful response is discarded.
    170added: //
    171added: // The error is non-nil only when verification is indeterminate. Serval
    172added: // answers 401 for any unknown, revoked, expired or mismatched key; every
    173added: // other status (429 rate limit, 5xx) says nothing about the key.
    174added: func verifyKey(ctx context.Context, client *http.Client, baseURL, id, secret string) (bool, error) {
    175added: endpoint, err := url.JoinPath(baseURL, "/v2/auth/token")
    176added: if err != nil {
    177added: return false, err
    178added: }
    179added:
    180added: form := url.Values{"grant_type": {"client_credentials"}}
    181added: req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint, strings.NewReader(form.Encode()))
    182added: if err != nil {
    183added: return false, err
    184added: }
    185added: req.SetBasicAuth(id, secret)
    186added: req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
    187added:
    188added: res, err := client.Do(req)
    189added: if err != nil {
    190added: return false, err
    191added: }
    192added: defer func() {
    193added: _, _ = io.Copy(io.Discard, res.Body)
    194added: _ = res.Body.Close()
    195added: }()
    196added:
    197added: switch res.StatusCode {
    198added: case http.StatusOK:
    199added: return true, nil
    200added: case http.StatusUnauthorized:
    201added: return false, nil
    202added: default:
    203added: return false, fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)
    204added: }
    205added: }
    206added:
    207added: func (s Scanner) Type() detector_typepb.DetectorType {
    208added: return detector_typepb.DetectorType_Serval
    209added: }
    210added:
    211added: func (s Scanner) Description() string {
    212added: return "Serval is a workflow automation platform for IT and security teams. API keys pair a client ID with a secret and can call the Serval public API or run self-hosted workers."
    213added: }

Source

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

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

5 of 24 evidence rows need attention

Evidence rows that need attention
FieldStatusValueSource
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuideNone extractedFile
timeoutNone extractedFile
rateLimitNone extractedFile
verify.urls%s/v2/auth/tokenParser confidence: lowFile
All 24 evidence rows
All evidence rows
FieldStatusValueSource
descriptionServal is a workflow automation platform for IT and security teams. API keys pair a client ID with a secret and can call the Serval public API or run self-hosted workers.File
keywordssvl_secret_File
detectorTypesServalFile
filesserval.goFile
patterns\b([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\b, \b(svl_secret_(pk|wk|mk)_([0-9A-Za-z]{43})([0-9A-Za-z]{6}))\bFile
patternTypeprefix_regexFile
statusactiveFile
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuideNone extractedFile
verify.hasVerifyYesFile
verify.httpMethodsPOSTFile
verify.statusCodesOK, UnauthorizedFile
timeoutNone extractedFile
rateLimitNone extractedFile
errorHandlingSetVerificationError; unexpected HTTP response status %dFile
verify.urlshttps://public.api.serval.com, https://public.eu1.serval.comFile
verify.urls%s/v2/auth/tokenParser confidence: lowFile
detection.keywordssvl_secret_Lines 60–60
verification.endpoint%s/v2/auth/tokenLines 181–181
verification.httpMethodPOSTLines 181–181
verification.authenticationMethodHTTP Basic AuthenticationLines 185–185
verification.expectedStatuses.verified{"statuses":[200],"names":["StatusOK"],"outcome":"verified"}Lines 198–198
verification.expectedStatuses.not_verified{"statuses":[401],"names":["StatusUnauthorized"],"outcome":"not_verified"}Lines 200–200
verification.expectedStatuses.error_or_unknown{"statuses":[],"names":["default"],"outcome":"error_or_unknown"}Lines 202–202
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)
  • serval.go