audit

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package audit implements a mechanism for writing auditable events to an audit log.

Typical use would be for tracking sensitive operations like private key usage (NewPrincipal), or sensitive RPC method invocations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrincipal

func NewPrincipal(ctx *context.T, auditor Auditor) security.Principal

NewPrincipal returns a security.Principal implementation that logs all private key operations of 'wrapped' to 'auditor' (i.e., all calls to BlessSelf, Bless, MintDischarge and Sign).

Types

type Auditor

type Auditor interface {
	Audit(ctx *context.T, entry Entry) error
}

Auditor is the interface for writing auditable events.

type Entry

type Entry struct {
	// Method being invoked.
	Method string
	// Arguments to the method.
	// Any sensitive data in the arguments should not be included,
	// even if the argument was provided to the real method invocation.
	Arguments []interface{}
	// Result of the method invocation.
	// A common use case is to audit only successful method invocations.
	Results []interface{}

	// Timestamp of method invocation.
	Timestamp time.Time
}

Entry is the information logged on each auditable event.

func (Entry) String

func (e Entry) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL