MAQPNADocs

maqpna audit import

Import tool calls from CloudTrail, OpenAI or Anthropic audit logs into the ledger, flagging calls that bypassed the gateway

Observe-o json | yaml

Synopsis#

maqpna audit import --source cloudtrail|openai|anthropic --ledger FILE [--since T] [--until T] [--state FILE] [--raw-dir DIR]
                    [--namespace NS [--agent A]] [--event-source S]... [--type T]... [--region R] [--endpoint URL] [--key-env VAR] [--dry-run]
maqpna audit import --source cloudtrail --ledger FILE CLOUDTRAIL_LOG_FILE|DIR...

Flags#

FlagTypeDescriptionDefault
--agentstringattribute the events to this agent (with --namespace)none
--dry-runswitchfetch and report without appending or moving the cursornone
--endpointstringAPI base URL (default the provider's)none
--event-sourcestringcloudtrail: event source to import (repeatable; default bedrock.amazonaws.com, bedrock-agentcore.amazonaws.com; files: * for all)none
--key-envstringenv var holding the API key (default OPENAI_ADMIN_KEY; ANTHROPIC_COMPLIANCE_ACCESS_KEY, then ANTHROPIC_ADMIN_KEY)none
--ledgerstringledger FILE to append to (a dedicated imports ledger, or one no running gateway writes)none
--lookbackdurationfirst import without a cursor: how far back24h0m0s
--max-eventsintrefuse a window with more events (nothing is imported; narrow it with --until)50000
--namespacestringattribute the events to this MAQPNA namespace (for evidence packs of that system)none
--overlapdurationre-read this much before the cursor (late delivery); repeats are skipped by event ID15m0s
--raw-dirstringalso keep each raw event as DIR/SOURCE/SHA256.jsonnone
--regionstringcloudtrail: AWS region (default AWS_REGION)none
--sincestringwindow start: RFC3339, or a duration ago (72h); default the cursor minus --overlap, else --lookbacknone
--sourcestringcloudtrail, openai or anthropicnone
--statestringcursor file (default LEDGER.import-SOURCE.json)none
--typestringopenai: event type, anthropic: activity type to import (repeatable; default all)none
--untilstringwindow end, exclusive: RFC3339 or a duration ago (default now)none

The global flags (--context, -o, --no-color, ...) work with every command.

What happens when you run it#

  • Reads the audit ledger offline with --ledger FILE: ledger FILE to append to (a dedicated imports ledger, or one no running gateway writes).
  • --dry-run: fetch and report without appending or moving the cursor.
  • Prints a table by default; -o json or -o yaml print the data, and --jq EXPR filters the JSON.

Exit codes#

CodeMeaning
0success
1error (the message says what failed, with a hint when there is one)
2usage error: unknown flag, missing argument or bad value; the synopsis is printed
3a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command)