-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Resolves UI Breaks from Malformed Roles #131915
Resolves UI Breaks from Malformed Roles #131915
Conversation
… to role transform function. Resolves 124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly.
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/kibana-security (Team:Security) |
ACK: will review today |
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.
Looks great, thank you for the exemplary PR i.e. clear and detailed description, steps to verify changes, unit tests and logs!
Note: I think we should backport this fix to 7.17 as well.
value: transformResult, | ||
}; | ||
} catch (e) { | ||
logger.error(`Error transforming Elasticsearch role: ${getDetailedErrorMessage(e)}`); |
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.
Thanks for adding logs! These are immensely helpful when we need to debug anything like this in production.
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
* Adds catch of exceptions from PrivilegeSerializer deserialize methods to role transform function. Resolves 124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly. * Adds logger to role transform functions * File accidentally not saved prior to last commit (cherry picked from commit f4eb311) # Conflicts: # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts
* Adds catch of exceptions from PrivilegeSerializer deserialize methods to role transform function. Resolves 124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly. * Adds logger to role transform functions * File accidentally not saved prior to last commit (cherry picked from commit f4eb311) # Conflicts: # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts # x-pack/plugins/security/server/routes/authorization/roles/get.ts # x-pack/plugins/security/server/routes/authorization/roles/get_all.ts
* Adds catch of exceptions from PrivilegeSerializer deserialize methods to role transform function. Resolves 124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly. * Adds logger to role transform functions * File accidentally not saved prior to last commit
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
* Resolves UI Breaks from Malformed Roles (#131915) * Adds catch of exceptions from PrivilegeSerializer deserialize methods to role transform function. Resolves 124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly. * Adds logger to role transform functions * File accidentally not saved prior to last commit (cherry picked from commit f4eb311) # Conflicts: # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fix import and linting errors. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* Resolves UI Breaks from Malformed Roles (#131915) * Adds catch of exceptions from PrivilegeSerializer deserialize methods to role transform function. Resolves 124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly. * Adds logger to role transform functions * File accidentally not saved prior to last commit (cherry picked from commit f4eb311) # Conflicts: # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.test.ts # x-pack/plugins/security/server/authorization/roles/elasticsearch_role.ts # x-pack/plugins/security/server/routes/authorization/roles/get.ts # x-pack/plugins/security/server/routes/authorization/roles/get_all.ts * Fixed import and test issues.
Resolves #124808 where malformed Elasticsearch roles cause Kibana users and roles UIs to not display correctly.
Overview
This PR adds a catch for exceptions thrown in deserialization of Elasticsearch roles during transformation into Kibana format. This provides an additional case to set the transform success flag to false and return from the operation gracefully when a malformed role is encountered, keeping the Kibana Roles and Users UI's intact.
This PR also adds an additional logger parameter to the transform functions, allowing the details of a thrown exception to be logged where previously only a generic message would appear to the Kibana user.
Add "feature_securitySolutionCases.a;;" to a user role
Apply the user role via API
Try to go to Management > Security > Roles or to Management > Security > Users
An error will be illustrated bottom right of the screen
Testing
6. Delete the 'test' role.