RANGER-5341: Capture opCode in KMS access logs for EEK_OP operations #688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when the handleEncryptedKeyOp() method in KMS.java is invoked via the API, there is no visibility into whether the request is performing a decryptKey or reEncryptKey operation as same path gets logged for both operations as it hits the same method.
So after this patch opCode will be included in AccessLog pattern.
e.g In access logs we can see opcode appended
- - [] "GET /kms/v1/keys/names" 200 3 50 -
- - [] "GET /kms/v1/key/key1/_eek" 500 288 29 generate
- - [] "POST /kms/v1/keyversion/test-2@1/_eek" 400 176 16 reencrypt
- - [] "POST /kms/v1/keyversion/test-2@1/_eek" 400 176 14 decrypt
How was this patch tested?
Checked Access logs after hitting endpoints through Docker setup
Mvn local build