Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding info logging to display the hashed encryptionKey & adding test… #139874

Merged

Conversation

kc13greiner
Copy link
Contributor

@kc13greiner kc13greiner commented Aug 31, 2022

… cases

Summary

Screen Shot 2022-08-31 at 5 26 57 PM

Adding logging to display a hashed value of the supplied encryptionKey

Release Notes

Debugging - Hashed encryption key now logged on Kibana start-up to help users solve conflicting encryptionKey configurations

@kc13greiner kc13greiner added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! release_note:feature Makes this part of the condensed release notes v8.5.0 labels Aug 31, 2022
@kc13greiner kc13greiner marked this pull request as ready for review September 7, 2022 11:55
@kc13greiner kc13greiner requested a review from a team as a code owner September 7, 2022 11:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@kc13greiner kc13greiner linked an issue Sep 7, 2022 that may be closed by this pull request
@azasypkin azasypkin added release_note:enhancement and removed release_note:feature Makes this part of the condensed release notes labels Sep 8, 2022
.update(config.encryptionKey)
.digest('base64');

this.logger.info(`Hashed 'encryptionKey' for this instance: ${hashedEncryptionKey}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit/question - do we want to refer to the yml field path (xpack.encryptedSavedObjects.encryptionKey) just for clarity of where the setting is located?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ you can technically figure this out by reading which plugin wrote the log message, but I think spelling out the entire path would be easier to parse (and search for in logs!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! Added in latest commit!

Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Kurt
Would there be any benefit to spitting out hashes for the other encryption keys as well? Not sure if we have the same sort of troubleshooting issues with those like we do with SO's.

@kc13greiner
Copy link
Contributor Author

LGTM Kurt Would there be any benefit to spitting out hashes for the other encryption keys as well? Not sure if we have the same sort of troubleshooting issues with those like we do with SO's.

@jeramysoucy maybe this is something we could add to Discussions for the weekly sync?

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kc13greiner kc13greiner merged commit b474a45 into elastic:main Sep 12, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 12, 2022
@kc13greiner kc13greiner deleted the feature/log_hashed_encryptionKey branch September 12, 2022 15:41
@kc13greiner kc13greiner added backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development and removed backport:skip This commit does not require backporting labels Sep 12, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 12, 2022
elastic#139874)

* Adding info logging to display the hashed encryptionKey & adding test cases

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Fixing test logger

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Adding config path for message

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit b474a45)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 139874

Questions ?

Please refer to the Backport tool documentation

@kc13greiner kc13greiner restored the feature/log_hashed_encryptionKey branch September 12, 2022 16:23
kibanamachine added a commit that referenced this pull request Sep 12, 2022
#139874) (#140532)

* Adding info logging to display the hashed encryptionKey & adding test cases

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Fixing test logger

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Adding config path for message

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit b474a45)

Co-authored-by: Kurt <kc13greiner@users.noreply.github.com>
@kc13greiner
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kc13greiner added a commit to kc13greiner/kibana that referenced this pull request Sep 14, 2022
elastic#139874)

* Adding info logging to display the hashed encryptionKey & adding test cases

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Fixing test logger

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Adding config path for message

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit b474a45)

# Conflicts:
#	x-pack/plugins/encrypted_saved_objects/server/plugin.test.ts
kc13greiner added a commit that referenced this pull request Sep 19, 2022
…ng test… (#139874) (#140759)

* Adding info logging to display the hashed encryptionKey & adding test… (#139874)

* Adding info logging to display the hashed encryptionKey & adding test cases

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Fixing test logger

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Adding config path for message

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit b474a45)

# Conflicts:
#	x-pack/plugins/encrypted_saved_objects/server/plugin.test.ts

* Fixing type issue

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kc13greiner kc13greiner deleted the feature/log_hashed_encryptionKey branch January 26, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development release_note:enhancement Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.17.7 v8.4.2 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[encryptedSavedObjects] log hash of encryption key at startup
7 participants