Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Initial migration and model updates for AuditLog improvements * feat: populate actor_email for existing audit_logs * chore: Fix audit log docs to show the actual response object instead of a generic response * feat: Log Requester IP for source and actor email with audit logs * wip: createUser audit logging via middleware * chore: refactor audit logging to trigger from LoggingMiddleware based on the presence of specific context This commit mostly contains the logic to make this method for audit logging work. The only audit log event that works in this commit is CreateUser * wip: Successfully creating audit logs from middleware. Capturing failure cases. * feat: Capture DB errors in audit logs * chore: remove debug logging * chore: Refactor setting of status to receiver function * wip: All "simple" audit context endpoints updated for middeware * fix: Fix a few bugs found during testing * fix: Remove doc for non-existent POST /api/v2/saml endpoint * wip: Refactor to simplify setting of AuditCtx in endpoints * fix: registration issue after rebase * tasks 6 and 7 for #345 (#357) * updated IP address parsing * added tests for IP parsing, changed IP delimiter to comma * redo IP parsing for changed requirements (#362) * feat: audit log steel thread (#364) * chore: clean up old approach to reduce noise * chore: cleanup audit logging interface for new usages * chore: fix existing tests (audit integration test needs new target) * chore: improve integration config defaults * feat: add audit logging to UpdateUser This adds a new `AuditableContext` method to the Database, which wraps the Gorm Transaction method with some auditing context and ensures the two phase commit of the audit log is run * feat: add audit logging to DeleteSAMLProvider fix: use actual AuditData instead of the direct model * feat: CreateAssetGroup and DeleteAssetGroup are now back to auditable fix: broken tests * feat: plumb commitID for real this time fix: incorrect formatting of audit log action names fix: additional test fixes * fix: additional test fixes * review comments --------- Co-authored-by: Irshad Ahmed <[email protected]> * chore: steel thread cleanup (#365) * BED-3858 - Fix not ingesting tenant count during azure analysis (#328) Co-authored-by: Irshad Ahmed <[email protected]> * ESC9a Edge Composition (#354) * feat: esc9a post * test: add esc9 test * chore: add harness files * fix: regen schema after merge * chore: fix small nits * chore: cleanup cert template new function * chore: add missing props * wip: 9a composition * fix: treat failure to grab properties as true * wip: esc9a composition * wip: esc9a composition * feat+chore: add depth controls to dawgs patterns * wip: esc9a composition * fix: do not drop the current segment if the next pattern is optional * wip: esc9a composition * fix: update other continuations to respect depth correctly * wip: edge comp * fix: swap * chore: remove unnecessary logs * feat: esc9a post * test: add esc9 test * chore: fix small nits * wip: 9a composition * wip: esc9a composition * wip: esc9a composition * feat+chore: add depth controls to dawgs patterns * wip: esc9a composition * fix: do not drop the current segment if the next pattern is optional * wip: esc9a composition * fix: update other continuations to respect depth correctly * wip: edge comp * fix: swap * chore: remove unnecessary logs * test: add test covering esc9a edge comp * chore: revert random re-ordering * chore: handle negative min/max depth on continuations --------- Co-authored-by: John Hopper <[email protected]> * docs: Add to ESC3 abuse info (#350) * docs: add note in ESC6 abuse info (#356) * feat: Add ADCS pre-built queries (#342) Co-authored-by: Rohan Vazarkar <[email protected]> * feat: esc6a edge composition (#359) * feat: esc6a edge composition * chore: allow composition accordion to show for 6a * fix: add trustedby rel to path4 pattern, use outboundwithdepth for optional memberof traversal * chore: update dcfor pattern to use outboundwithdepth for optional group membership * ESC10a Post Processing (#360) * wip: initial ESC10a post * test: all the tests for esc10a * chore: add edges to post processed * chore: add harnessgen script * test: remove edges from harness * chore: don't exit loop if we hit an error, continue instead * chore: log and continue * feat: filter out ESC3 false positives (#351) * feat: filter out ESC3 false positives * fix: handle esc3 filtering without retraversal * fix: handle esc3 filtering without retraversal * fix: handle esc3 filtering without retraversal * chore: rename function for re-use * chore: log and continue --------- Co-authored-by: rvazarkar <[email protected]> Co-authored-by: Rohan Vazarkar <[email protected]> * chore: patch EULAAcceptance bypass to only run if the current user is set to false * fix: incorrect usage of RemoteAddr fix: unnecessary AuditData() calls fix: use pointers for AuditEntry.Model assignments so successful actions can record updated fields like ID --------- Co-authored-by: mistahj67 <[email protected]> Co-authored-by: Irshad Ahmed <[email protected]> Co-authored-by: Rohan Vazarkar <[email protected]> Co-authored-by: John Hopper <[email protected]> Co-authored-by: Jonas Bülow Knudsen <[email protected]> Co-authored-by: Ulises Rangel <[email protected]> Co-authored-by: rvazarkar <[email protected]> * add eula_accepted to user audit data (#371) * audit logs for auth tokens and secrets (#372) * audit logs for auth tokens and secrets * feat: UpdateAssetGroup, UpdateAssetGroupSelector, DeleteAssetGroupSelector, CreateSAMLIdentityProvider, and UpdateSAMLIdentityProvider have audit log support (#374) chore: remove unused RemoveAssetGroupSelector method chore: update tests and mocks to account for interface changes * more auth handlers for audit log (#373) * chore: update documentation for our new commit_id field and `intent` status * Generate audit log entries on unauthorized access attempts (#375) * feat: create an audit log record when unauthorized access is attempted * chore: Only log unauthorized write access * chore: add audit logging to remaining auth middleware * test: Fix middleware/auth_test to support new audit log changes * chore: change source column to TEXT It was previously sized to only account for max 1 IPv6 address, but our design changes mean it could now be any length * chore: rename audit_log.source as 'source' is a reserved keyword in postgres * chore: add additional fields to user.AuditData * Refactored unauthorized access audit logging: (#381) * Refactored unauthorized access audit logging: - moved audit logging responsibility to Authorizer interface - cleaned up injections of *db through several layers of code (no longer necessary) - minor cleanup and support work --------- Co-authored-by: Alyx Holms <[email protected]> Co-authored-by: Irshad Ajmal Ahmed <[email protected]> Co-authored-by: mistahj67 <[email protected]> Co-authored-by: Rohan Vazarkar <[email protected]> Co-authored-by: John Hopper <[email protected]> Co-authored-by: Jonas Bülow Knudsen <[email protected]> Co-authored-by: Ulises Rangel <[email protected]> Co-authored-by: rvazarkar <[email protected]> Co-authored-by: Cody Bentley <[email protected]>
- Loading branch information