mirror of
https://github.com/gravitational/teleport
synced 2024-10-22 18:23:25 +00:00
c7b4934553
Teleport configuration now has a new field: NoAudit (false by default, which means audit is always on). When this option is set, Teleport will not record events and will not record sessions. It's implemented by adding "DiscardLogger" which implements the same interface as teh real logger, and it's plugged into the system instead. NOTE: this option is not exposed in teleport in any way: no config file, no switch, etc. I quickly needed it for Telecast.
30 lines
868 B
Go
30 lines
868 B
Go
package events
|
|
|
|
import (
|
|
"io"
|
|
"time"
|
|
|
|
"github.com/gravitational/teleport/lib/session"
|
|
)
|
|
|
|
// DiscardAuditLog is do-nothing, discard-everything implementation
|
|
// of IAuditLog interface used for cases when audit is turned off
|
|
type DiscardAuditLog struct {
|
|
}
|
|
|
|
func (d *DiscardAuditLog) EmitAuditEvent(eventType string, fields EventFields) error {
|
|
return nil
|
|
}
|
|
func (d *DiscardAuditLog) PostSessionChunk(sid session.ID, reader io.Reader) error {
|
|
return nil
|
|
}
|
|
func (d *DiscardAuditLog) GetSessionChunk(sid session.ID, offsetBytes, maxBytes int) ([]byte, error) {
|
|
return make([]byte, 0), nil
|
|
}
|
|
func (d *DiscardAuditLog) GetSessionEvents(sid session.ID, after int) ([]EventFields, error) {
|
|
return make([]EventFields, 0), nil
|
|
}
|
|
func (d *DiscardAuditLog) SearchEvents(fromUTC, toUTC time.Time, query string) ([]EventFields, error) {
|
|
return make([]EventFields, 0), nil
|
|
}
|