forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudit.go
38 lines (32 loc) · 886 Bytes
/
audit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package services
import (
"context"
"github.com/Velocidex/ordereddict"
config_proto "www.velocidex.com/golang/velociraptor/config/proto"
)
// The Audit Manager is responsible for receiving and dispatching
// audit events. Velociraptor audits user actions and forwards them to
// the audit manager for logging.
type AuditManager interface {
LogAudit(
ctx context.Context,
config_obj *config_proto.Config,
principal, operation string,
details *ordereddict.Dict) error
}
func LogAudit(
ctx context.Context,
config_obj *config_proto.Config,
principal, operation string,
details *ordereddict.Dict) error {
org_manager, err := GetOrgManager()
if err != nil {
return err
}
audit_manager, err := org_manager.Services(config_obj.OrgId).AuditManager()
if err != nil {
return err
}
return audit_manager.LogAudit(ctx, config_obj,
principal, operation, details)
}