Commit Graph

12 Commits

Author SHA1 Message Date
Peter Wilson
93f18cbd7a
VAULT-19046: Audit eventlogger escape hatch (#22344)
* add escape hatch to use feature flag for reversion of audit behavior

* Setup pipeline which ends with a NoopSink

* explicitly call out old way of running test

* old behavior for audit trail tests

* More manual forcing of tests to legacy audit system

* Add NOTE: to suggest that the feature flag is temporary
2023-08-17 21:20:30 +01:00
hashicorp-copywrite[bot]
0b12cdcfd1
[COMPLIANCE] License changes (#22290)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License.

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUS-1.1

* Fix test that expected exact offset on hcl file

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Sarah Thompson <sthompson@hashicorp.com>
Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
2023-08-10 18:14:03 -07:00
Mike Palmiotto
4c8cc87794
Automatically track subloggers in allLoggers (#22038)
* Automatically track subloggers in allLoggers

This PR introduces a new interface called `SubloggerAdder` for tracking
allLoggers across startup phases.

The interface enables us to register a single `SubloggerHook` during
initial logger creation and hand off management of `allLoggers` during
the three phases we need to handle:

- Before `CoreConfig` is created, the `SubloggerHook`
  (`AppendToAllLoggers`) appends new subloggers to
  `ServerCommand.allLoggers`.

- After `CoreConfig` is created and before `NewCore` returns, new subloggers
  are added to `CoreConfig.AllLoggers`. Intermediate state must also be
  kept in sync within NewCore to track new subloggers before we return
  to the server command and register the `Core.SubloggerAdder`
  implementation.

- After `NewCore` returns to the server command, we register Core as the
  implementer of `ServerCommand.SubloggerAdder` ensuring that all new
  subloggers are appended to `Core.allLoggers`.

* Wire up the sublogger hook in NewTestLogger
2023-08-08 17:47:09 +00:00
Peter Wilson
30114d0038
Moved HeaderFormatter to an Option for NewEntryFormatter, updated tests (#22116) 2023-07-28 17:07:20 +01:00
Marc Boudreau
769fe0b67d
VAULT-17079: Adding Hash Function and HeaderAdjuster to EntryFormatter (#22042)
* add hashfunc field to EntryFormatter struct and adjust NewEntryFormatter function and tests

* add HeaderAdjuster interface and require it in EntryFormatter
dquote> adjust all references to NewEntryFormatter to include a HeaderAdjuster parameter

* replace use of hash function in AuditedHeadersConfig's ApplyConfig method with Salter interface instance

* fixup! replace use of hash function in AuditedHeadersConfig's ApplyConfig method with Salter interface instance

* review feedback

* Go doc typo

* add another test function

---------

Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2023-07-27 12:31:52 -04:00
Nick Cabatoff
dc06bb9496
Make TestLogger an InterceptLogger and use it a little more widely. (#22030) 2023-07-24 09:35:39 -04:00
Peter Wilson
31074bc448
VAULT-18284: Audit refactor packages (#21972)
* initial git mv to rename 'audit' packages

* remove 'Audit' prefix from structs inside audit package

* refactor of event/audit pacakges

* EventFormatter => EntryFormatter

* 'AuditFormat' => EntryFormat

* Use NewFormatterConfig func

---------

Co-authored-by: Marc Boudreau <marc.boudreau@hashicorp.com>
2023-07-20 13:32:06 -04:00
Marc Boudreau
7103bc2cdb
VAULT-17078: Add useEventLogger Argument to Audit Factory Functions (#21962)
* add useEventLogger argument to audit Factory functions

* adjusting Factory functions defined in tests

* fixup! adjusting Factory functions defined in tests
2023-07-20 11:23:21 -04:00
Peter Wilson
637679a327
VAULT-17080: refactor prior to introducing JSON formatting nodes for audit (#21708)
* Split out interfaces for salter/formatter/writer
2023-07-11 15:30:24 +01:00
divyaac
9ace8751ff
Ent only ADP Metrics (#21681)
* Ent only ADP Metrics

* Added change log

* Changed changelog name

* Restored previous impl

* Moved to mount_util

* Change impl

* Add same file

* Moved to registry_util

* Edited corehelpers mock registry

* Edited chagnelog

* Edited changelog

* Edited build tag

* Added back function

* Delete core.go.rej

* Edited mount

* Changed spacing
2023-07-10 10:28:42 -07:00
Hamid Ghaf
e55c18ed12
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00
Nick Cabatoff
970ed07b04
Vault test cluster helper refactorings, mostly audit related (#18928)
* Move some test helper stuff from the vault package to a new helper/testhelpers/corehelpers package.  Consolidate on a single "noop audit" implementation.
2023-02-01 08:33:16 -05:00