From 8402a1d9d1e126ea30882ce25bb470693a0d3054 Mon Sep 17 00:00:00 2001 From: Justin Judd Date: Tue, 22 Mar 2022 16:40:00 -0600 Subject: [PATCH 1/5] Added Details field to Audit event entries Added the optional `details` field for the audit events. As there aren't details what all of the sub-fields are, adding different fields that we've seen in our logs. --- audit.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/audit.go b/audit.go index 041ffd77a..3e036d10f 100644 --- a/audit.go +++ b/audit.go @@ -39,6 +39,21 @@ type AuditEntry struct { UA string `json:"ua"` IPAddress string `json:"ip_address"` } `json:"context"` + Details struct { + NewValue interface{} `json:"new_value"` + PrevValue interface{} `json:"previous_value"` + PolicyName string `json:"policy_name"` + AuthenticationMode string `json:"authentication_mode"` + EntityIds string `json:"entity_ids"` + MobileOnly bool `json:"mobile_only"` + WebOnly bool `json:"web_only"` + NonSSOOnly bool `json:"non_sso_only"` + SucceededUsers string `json:"succeeded_users"` + FailedUsers string `json:"failed_users"` + ExportType string `json:"export_type"` + ExportStart string `json:"export_start_ts"` + ExportEnd string `json:"export_end_ts"` + } `json:"details"` } type AuditUser struct { From 82e0f3a144b7e1b1180a28f1e03dd4e3ce99c4bc Mon Sep 17 00:00:00 2001 From: Justin Judd Date: Tue, 22 Mar 2022 19:38:58 -0700 Subject: [PATCH 2/5] Go fmt --- audit.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/audit.go b/audit.go index 3e036d10f..df4efb44f 100644 --- a/audit.go +++ b/audit.go @@ -40,19 +40,19 @@ type AuditEntry struct { IPAddress string `json:"ip_address"` } `json:"context"` Details struct { - NewValue interface{} `json:"new_value"` - PrevValue interface{} `json:"previous_value"` - PolicyName string `json:"policy_name"` - AuthenticationMode string `json:"authentication_mode"` - EntityIds string `json:"entity_ids"` - MobileOnly bool `json:"mobile_only"` - WebOnly bool `json:"web_only"` - NonSSOOnly bool `json:"non_sso_only"` - SucceededUsers string `json:"succeeded_users"` - FailedUsers string `json:"failed_users"` - ExportType string `json:"export_type"` - ExportStart string `json:"export_start_ts"` - ExportEnd string `json:"export_end_ts"` + NewValue interface{} `json:"new_value"` + PrevValue interface{} `json:"previous_value"` + PolicyName string `json:"policy_name"` + AuthenticationMode string `json:"authentication_mode"` + EntityIds string `json:"entity_ids"` + MobileOnly bool `json:"mobile_only"` + WebOnly bool `json:"web_only"` + NonSSOOnly bool `json:"non_sso_only"` + SucceededUsers string `json:"succeeded_users"` + FailedUsers string `json:"failed_users"` + ExportType string `json:"export_type"` + ExportStart string `json:"export_start_ts"` + ExportEnd string `json:"export_end_ts"` } `json:"details"` } From 253ffb4bb1e20f4ea96dd24885912cea916bf543 Mon Sep 17 00:00:00 2001 From: Justin Judd Date: Fri, 22 Apr 2022 16:39:29 -0700 Subject: [PATCH 3/5] Accepting suggestion to change Details field PrevValue -> PreviousValue Co-authored-by: Naoki Kanatani --- audit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audit.go b/audit.go index df4efb44f..f545298be 100644 --- a/audit.go +++ b/audit.go @@ -41,7 +41,7 @@ type AuditEntry struct { } `json:"context"` Details struct { NewValue interface{} `json:"new_value"` - PrevValue interface{} `json:"previous_value"` + PreviousValue interface{} `json:"previous_value"` PolicyName string `json:"policy_name"` AuthenticationMode string `json:"authentication_mode"` EntityIds string `json:"entity_ids"` From e2b4a3f2d4914222c5d46b323c777b990389f4a7 Mon Sep 17 00:00:00 2001 From: Justin Judd Date: Sat, 23 Apr 2022 00:03:13 +0000 Subject: [PATCH 4/5] Removing details fields that aren't in java and python sdk libs. --- audit.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/audit.go b/audit.go index f545298be..9153ad08d 100644 --- a/audit.go +++ b/audit.go @@ -42,14 +42,9 @@ type AuditEntry struct { Details struct { NewValue interface{} `json:"new_value"` PreviousValue interface{} `json:"previous_value"` - PolicyName string `json:"policy_name"` - AuthenticationMode string `json:"authentication_mode"` - EntityIds string `json:"entity_ids"` MobileOnly bool `json:"mobile_only"` WebOnly bool `json:"web_only"` NonSSOOnly bool `json:"non_sso_only"` - SucceededUsers string `json:"succeeded_users"` - FailedUsers string `json:"failed_users"` ExportType string `json:"export_type"` ExportStart string `json:"export_start_ts"` ExportEnd string `json:"export_end_ts"` From 4dbc82c6590a8c11bfd0b82fe428df39b539e44b Mon Sep 17 00:00:00 2001 From: Justin Judd Date: Sat, 23 Apr 2022 00:04:19 +0000 Subject: [PATCH 5/5] go fmt --- audit.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/audit.go b/audit.go index 9153ad08d..a3ea7ebdf 100644 --- a/audit.go +++ b/audit.go @@ -40,14 +40,14 @@ type AuditEntry struct { IPAddress string `json:"ip_address"` } `json:"context"` Details struct { - NewValue interface{} `json:"new_value"` - PreviousValue interface{} `json:"previous_value"` - MobileOnly bool `json:"mobile_only"` - WebOnly bool `json:"web_only"` - NonSSOOnly bool `json:"non_sso_only"` - ExportType string `json:"export_type"` - ExportStart string `json:"export_start_ts"` - ExportEnd string `json:"export_end_ts"` + NewValue interface{} `json:"new_value"` + PreviousValue interface{} `json:"previous_value"` + MobileOnly bool `json:"mobile_only"` + WebOnly bool `json:"web_only"` + NonSSOOnly bool `json:"non_sso_only"` + ExportType string `json:"export_type"` + ExportStart string `json:"export_start_ts"` + ExportEnd string `json:"export_end_ts"` } `json:"details"` }