Documentation
¶
Index ¶
- Constants
- type AuditLog
- type ClientGetter
- type Entry
- func (e *Entry) Save()
- func (e *Entry) SaveForMultipleClients(clients []*clientdata.Client)
- func (e *Entry) WithClient(c *clientdata.Client) *Entry
- func (e *Entry) WithClientID(cid string) *Entry
- func (e *Entry) WithHTTPRequest(req *http.Request) *Entry
- func (e *Entry) WithID(id interface{}) *Entry
- func (e *Entry) WithRequest(request interface{}) *Entry
- func (e *Entry) WithResponse(response interface{}) *Entry
- type NotAllowedError
- type Provider
- type RotationProvider
- type SQLiteProvider
- func (p *SQLiteProvider) Close() error
- func (p *SQLiteProvider) Count(ctx context.Context, options *query.ListOptions) (int, error)
- func (p *SQLiteProvider) List(ctx context.Context, options *query.ListOptions) ([]*Entry, error)
- func (p *SQLiteProvider) OldestTimestamp(ctx context.Context) (time.Time, error)
- func (p *SQLiteProvider) Save(e *Entry) error
- type Status
Constants ¶
View Source
const ( ActionCreate = "create" ActionDelete = "delete" ActionUpdate = "update" ActionExecuteStart = "execute.start" ActionExecuteDone = "execute.done" ActionSuccess = "success" ActionFailed = "failed" )
View Source
const ( ApplicationAuthUser = "auth.user" ApplicationAuthUserMe = "auth.user.me" ApplicationAuthUserMeToken = "auth.user.me.token" //nolint:gosec ApplicationAuthUserTotP = "auth.user.totp" ApplicationAuthUserGroup = "auth.user.group" ApplicationAuthAPISession = "auth.api.session" ApplicationAuthAPISessions = "auth.api.sessions" ApplicationClient = "client" ApplicationClientACL = "client.acl" ApplicationClientAuth = "client.auth" ApplicationClientGroup = "client.group" ApplicationClientTunnel = "client.tunnel" ApplicationClientCommand = "client.command" ApplicationClientScript = "client.script" ApplicationLibraryCommand = "library.command" ApplicationLibraryScript = "library.script" ApplicationVault = "vault" ApplicationSchedule = "schedule" ApplicationUploads = "uploads" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLog ¶
type AuditLog struct {
// contains filtered or unexported fields
}
func New ¶
func New(l *logger.Logger, cg ClientGetter, dataDir string, cfg config.Config, dataSourceOptions sqlite.DataSourceOptions) (*AuditLog, error)
type ClientGetter ¶
type ClientGetter interface {
GetByID(id string) (*clientdata.Client, error)
}
type Entry ¶
type Entry struct { Timestamp time.Time `db:"timestamp" json:"timestamp"` Username string `db:"username" json:"username"` RemoteIP string `db:"remote_ip" json:"remote_ip"` Application string `db:"application" json:"application"` Action string `db:"action" json:"action"` ID string `db:"affected_id" json:"affected_id"` ClientID string `db:"client_id" json:"client_id"` ClientHostName string `db:"client_hostname" json:"client_hostname"` Request string `db:"request" json:"request"` Response string `db:"response" json:"response"` // contains filtered or unexported fields }
func (*Entry) SaveForMultipleClients ¶
func (e *Entry) SaveForMultipleClients(clients []*clientdata.Client)
func (*Entry) WithClient ¶
func (e *Entry) WithClient(c *clientdata.Client) *Entry
func (*Entry) WithClientID ¶
func (*Entry) WithRequest ¶
func (*Entry) WithResponse ¶
type NotAllowedError ¶
type NotAllowedError struct {
Msg string
}
func (*NotAllowedError) Error ¶
func (e *NotAllowedError) Error() string
type RotationProvider ¶
type RotationProvider struct {
// contains filtered or unexported fields
}
func (*RotationProvider) Close ¶
func (r *RotationProvider) Close() error
func (*RotationProvider) Count ¶
func (r *RotationProvider) Count(ctx context.Context, l *query.ListOptions) (int, error)
func (*RotationProvider) List ¶
func (r *RotationProvider) List(ctx context.Context, l *query.ListOptions) ([]*Entry, error)
func (*RotationProvider) Save ¶
func (r *RotationProvider) Save(e *Entry) error
type SQLiteProvider ¶
type SQLiteProvider struct {
// contains filtered or unexported fields
}
func (*SQLiteProvider) Close ¶
func (p *SQLiteProvider) Close() error
func (*SQLiteProvider) Count ¶
func (p *SQLiteProvider) Count(ctx context.Context, options *query.ListOptions) (int, error)
func (*SQLiteProvider) List ¶
func (p *SQLiteProvider) List(ctx context.Context, options *query.ListOptions) ([]*Entry, error)
func (*SQLiteProvider) OldestTimestamp ¶
func (*SQLiteProvider) Save ¶
func (p *SQLiteProvider) Save(e *Entry) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.