-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Fleet] [Message Signing] Respond with a generic error when rotate key pair fails #156144
[Fleet] [Message Signing] Respond with a generic error when rotate key pair fails #156144
Conversation
305736c
to
83eefa2
Compare
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
review changes @dasansol92 follow up of elastic/pull/155864
83eefa2
to
5778d80
Compare
Pinging @elastic/fleet (Team:Fleet) |
@@ -41,6 +41,6 @@ export const rotateKeyPairHandler: FleetRequestHandler< | |||
}); | |||
} catch (error) { | |||
logger.error(error.meta); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we log the whole error instead of error.meta
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, why not. I'll update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 723461e
review changes @nchaulet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @ashokaditya |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check that the error obj is logged correctly? I guess logger
will take care of json obj stringify but just in case. Other than that this looks good, thanks for the changes!
…y pair fails (elastic#156144) ## Summary Responds with a generic error message for the rotate key pair API, instead of a trace message of where the error was generated. We log the detailed errors and this is to avoid a chance of any sensitive data (key generation details) being exposed through the API response. follow up of elastic/pull/155864 ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 13486f5)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ate key pair fails (#156144) (#156188) # Backport This will backport the following commits from `main` to `8.8`: - [[Fleet] [Message Signing] Respond with a generic error when rotate key pair fails (#156144)](#156144) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ashokaditya","email":"1849116+ashokaditya@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-04-28T15:17:06Z","message":"[Fleet] [Message Signing] Respond with a generic error when rotate key pair fails (#156144)\n\n## Summary\r\n\r\nResponds with a generic error message for the rotate key pair API,\r\ninstead of a trace message of where the error was generated.\r\n\r\nWe log the detailed errors and this is to avoid a chance of any\r\nsensitive data (key generation details) being exposed through the API\r\nresponse.\r\n\r\nfollow up of /pull/155864\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"13486f50deb6070f4e9ab00de63827caf0ed6040","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","Team:Defend Workflows","OLM Sprint","v8.8.0","v8.9.0"],"number":156144,"url":"https://github.com/elastic/kibana/pull/156144","mergeCommit":{"message":"[Fleet] [Message Signing] Respond with a generic error when rotate key pair fails (#156144)\n\n## Summary\r\n\r\nResponds with a generic error message for the rotate key pair API,\r\ninstead of a trace message of where the error was generated.\r\n\r\nWe log the detailed errors and this is to avoid a chance of any\r\nsensitive data (key generation details) being exposed through the API\r\nresponse.\r\n\r\nfollow up of /pull/155864\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"13486f50deb6070f4e9ab00de63827caf0ed6040"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156144","number":156144,"mergeCommit":{"message":"[Fleet] [Message Signing] Respond with a generic error when rotate key pair fails (#156144)\n\n## Summary\r\n\r\nResponds with a generic error message for the rotate key pair API,\r\ninstead of a trace message of where the error was generated.\r\n\r\nWe log the detailed errors and this is to avoid a chance of any\r\nsensitive data (key generation details) being exposed through the API\r\nresponse.\r\n\r\nfollow up of /pull/155864\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"13486f50deb6070f4e9ab00de63827caf0ed6040"}}]}] BACKPORT--> Co-authored-by: Ashokaditya <1849116+ashokaditya@users.noreply.github.com>
Summary
Responds with a generic error message for the rotate key pair API, instead of a trace message of where the error was generated.
We log the detailed errors and this is to avoid a chance of any sensitive data (key generation details) being exposed through the API response.
follow up of /pull/155864
Checklist