feat(elasticsearch-logger): encrypt headers field at rest#13612
Open
shreemaan-abhishek wants to merge 1 commit into
Open
feat(elasticsearch-logger): encrypt headers field at rest#13612shreemaan-abhishek wants to merge 1 commit into
shreemaan-abhishek wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures secrets placed in the elasticsearch-logger plugin’s headers configuration are encrypted at rest in etcd by adding headers to the plugin schema’s encrypt_fields. It also updates the English/Chinese plugin documentation and adds a regression test to confirm headers are decrypted via Admin API responses while remaining encrypted in etcd storage.
Changes:
- Add
headerstoencrypt_fieldsin theelasticsearch-loggerplugin schema so each header value is encrypted/decrypted via the generic data-encryption mechanism. - Add a test that verifies
headers.Authorizationis plaintext when read through the Admin API and ciphertext when read directly from etcd. - Update en/zh docs to state
headersvalues are encrypted at rest and to reflect the updatedencrypt_fieldslist.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apisix/plugins/elasticsearch-logger.lua | Adds headers to encrypt_fields so header values are encrypted at rest in etcd. |
| t/plugin/elasticsearch-logger.t | Adds a data-encryption test case verifying decrypt-on-read via Admin API and encrypted storage in etcd for headers. |
| docs/en/latest/plugins/elasticsearch-logger.md | Documents that headers values are encrypted at rest and updates the encrypt_fields note accordingly. |
| docs/zh/latest/plugins/elasticsearch-logger.md | Same documentation update as English version for headers encryption and encrypt_fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The
elasticsearch-loggerplugin recently gained a customheadersfield (#12994) that can carry secret-bearing values such asAuthorizationorX-API-Key. Until now onlyauth.passwordwas listed inencrypt_fields, so those header secrets were stored in plaintext in etcd.This PR adds
headerstoencrypt_fieldsso every header value is encrypted with AES at rest, while runtime requests still send the decrypted values.encrypt_fieldsalready supports map-of-strings fields, so each value underheadersis encrypted/decrypted individually.Docs (en + zh) and a data-encryption test for
headersare included.Which issue(s) this PR fixes:
Checklist