Validation and handling of http audit event destinations
What does this MR do and why?
Added handling and validation of custom http audit event streaming destinations.
Following changes were added:
- Config json schema added for http destinations, which does following:
- Requires a field named url which should be a correct http or https url with max length of 255 characters.
- A json object headers, which can be null or empty or can contain hash of all headers in format
{ key: { value: 'value', active: true }}
. There is limit of maximum 20 headers.
- Validation of HTTP url in config of destinations:
- For group level external audit event destinations:
- No two destinations belonging to same group can have same url in their configs.
- Two destinations can have same url in config if they belong to different groups.
- For instance level destinations, no two destinations can have same url in their configs.
- For group level external audit event destinations:
- Secret token:
- Validation: If secret token is provided then the length should be between 16 to 24 characters.
- Auto generation of secret token for http destinations if not provided.
- Earlier secret token was a required field in
ee/app/graphql/mutations/audit_events/group/audit_event_streaming_destinations/create.rb
, now it is optional for destinations with category http, as in that case it can be auto generated too. - Earlier we were not allowing secret_token to be queried for
ee/app/graphql/types/audit_events/audit_event_streaming_destination_interface.rb
, now for http destinations it will return the token and for other type of destinations it will return empty string.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Check-list can found in this comment with query examples
Related to #436607 (closed)
Edited by Andrew Jung