Skip to content

Add audit logs for network operations and key usage #2376

@leighmcculloch

Description

@leighmcculloch

What problem does your feature solve?

When using the CLI over time, there's no persistent record of:

  1. Network operations - What on-chain operations were performed, on which network, and when
  2. Key usage - What a key has been used to sign, including transactions and auth invocations

This makes it difficult to:

  • Review what transactions were submitted from a machine
  • Track how keys are being used across different operations
  • Audit signing activity for security or compliance purposes
  • Troubleshoot issues ("did I already deploy this?" or "what did I sign with this key?")

Note: There is an existing action log feature at stellar cache actionlog which is essentially an audit log of rpc interactions, but it's not very ergonomic and doesn't surface information in a way that can be easily parsed. This proposal would likely replace the action log.

What would you like to see?

Add audit logs that track CLI activity. Two types of logs could be considered:

1. Network Operations Log

  • Timestamp
  • Network (testnet, mainnet, etc.)
  • Command executed (deploy, invoke, etc.)
  • Send vs Simulation
  • Transaction hash (if successful)
  • Contract ID (if applicable)
  • Success/failure status

2. Key Usage Log

  • Timestamp
  • Key identifier (public key or alias)
  • Operation type (transaction signing, auth invocation signing)
  • Transaction hash or context
  • Network
  • What was being authorized (contract, function, etc.)

The audit logs could be stored in a standard location (e.g., ~/.config/stellar/audit/) and support displaying in different output formats (plain text, JSON) for easy parsing.

What alternatives are there?

  • Status quo: Users manually track operations or rely on shell history
  • External tooling: Use shell wrappers or scripts to log commands
  • Block explorer: Look up account history on-chain (doesn't capture failed attempts, local context, or which local key was used)

Related: #2375 (confirmation prompts for mainnet operations)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog (Not Ready)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions