3
0

Add action recording for sensitive data search

This commit is contained in:
Denis Arh
2022-08-11 19:52:27 +02:00
parent 01f860f7f6
commit cb99d2999b
3 changed files with 27 additions and 1 deletions

View File

@@ -327,6 +327,8 @@ func (svc record) SearchSensitive(ctx context.Context) (set []types.SensitiveRec
namespaces types.NamespaceSet
modules types.ModuleSet
aProps = &recordActionProps{}
userID = auth.GetIdentityFromContext(ctx).Identity()
)
@@ -364,7 +366,7 @@ func (svc record) SearchSensitive(ctx context.Context) (set []types.SensitiveRec
return nil
}()
return set, err
return set, svc.recordAction(ctx, aProps, RecordActionSearchSensitive, err)
}
func (svc record) searchSensitive(ctx context.Context, userID uint64, namespace *types.Namespace, module *types.Module, filter types.RecordFilter) (out types.SensitiveRecordSet, err error) {

View File

@@ -452,6 +452,26 @@ func RecordActionSearch(props ...*recordActionProps) *recordAction {
return a
}
// RecordActionSearchSensitive returns "compose:record.searchSensitive" action
//
// This function is auto-generated.
//
func RecordActionSearchSensitive(props ...*recordActionProps) *recordAction {
a := &recordAction{
timestamp: time.Now(),
resource: "compose:record",
action: "searchSensitive",
log: "searched for records with sensitive data",
severity: actionlog.Info,
}
if len(props) > 0 {
a.props = props[0]
}
return a
}
// RecordActionLookup returns "compose:record.lookup" action
//
// This function is auto-generated.

View File

@@ -46,6 +46,10 @@ actions:
log: "searched for records"
severity: info
- action: searchSensitive
log: "searched for records with sensitive data"
severity: info
- action: lookup
log: "looked-up for a {{record}}"
severity: info