PgBeam
PgBeam Docs
Honeytokens

CreateHoneytoken

Register a honeytoken

Registers a decoy (canary) relation for the project. Any agent statement that references it is blocked and recorded as a canary_tripped audit event.

Usage

result, err := client.Honeytokens.CreateHoneytoken(ctx, "prj_xxx", pgbeam.HoneytokenInput{
    RelationName: "customer_ssns",
    Action: "...",
  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
reqpgbeam.HoneytokenInputYesRequest body
req.SchemaName*stringNoOptional schema. Null or empty matches the unqualified/public form.
req.RelationNamestringYesRelation (table or view) name of the decoy.
req.ActionstringYesResponse when the honeytoken is tripped.

Response

(*pgbeam.Honeytoken, error): honeytoken registered.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Honeytokens.CreateHoneytoken(ctx, "prj_xxx", pgbeam.HoneytokenInput{
    SchemaName: "public",
    RelationName: "customer_ssns",
    Action: "...",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
429Rate limited. Try again later.

On this page