auditor

package
v0.0.0-...-64130a5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []string

All return all registered auditors

func Register

func Register(name string, driver Provider)

Register adds an auditor with given name to registry

Types

type Auditor

type Auditor interface {

	// All msg between piper and upstream will be put into the hook
	// nil for ignore
	GetUpstreamHook() Hook

	// All msg between piper and downstream will be put into the hook
	// nil for ignore
	GetDownstreamHook() Hook

	// Will be called when connection closed
	Close() error
}

Auditor holds Hooks for upstream and downstream

type Hook

type Hook func(conn ssh.ConnMetadata, msg []byte) ([]byte, error)

Hook is called after ssh connection pipe is established and all msg will be put into the hook and msg will be converted to the return value of this func

type Provider

type Provider interface {
	registry.Plugin

	// Will be called when piped connection established
	// nil for no Auditor needed for this connection
	Create(ssh.ConnMetadata) (Auditor, error)
}

Provider is a factory for Auditor

func Get

func Get(name string) Provider

Get returns an auditor by name, return nil if not found

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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