[Roles] Added error reasons for role malformed message#239098
[Roles] Added error reasons for role malformed message#239098elena-shostak merged 8 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-security (Team:Security) |
rgodfrey-elastic
left a comment
There was a problem hiding this comment.
Looks really good! I added a couple comments to the code but I'll leave it up to you if you want to make those changes.
I also have a couple general comments/questions:
- Are you missing labels for v9.2 and v9.3? I was told to add those to my one and only PR lol
- Are there any validations that prevent these bad roles from getting saved in the first place? It's great to display the extra context when there are errors but preventing them from being stored would probably be more valuable.
...gement/roles/edit_role/privileges/kibana/transform_error_section/transform_error_section.tsx
Outdated
Show resolved
Hide resolved
...gement/roles/edit_role/privileges/kibana/transform_error_section/transform_error_section.tsx
Show resolved
Hide resolved
yeah, added for v9.2 and v9.3 is current main, so no need to backport for it. Thanks!
Validations are performed if you create a role using kibana endpoint, but since they are not present at the es level we can still come up with this malformed issues |
rgodfrey-elastic
left a comment
There was a problem hiding this comment.
Looks good! and thanks for addressing my questions!
|
Starting backport for target branches: 8.18, 8.19, 9.0, 9.1, 9.2 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
|
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
(cherry picked from commit 762bed0)
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
(cherry picked from commit 762bed0)
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
(cherry picked from commit 762bed0)
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
(cherry picked from commit 762bed0)
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
(cherry picked from commit 762bed0)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… (#239410) # Backport This will backport the following commits from `main` to `8.19`: - [[Roles] Added error reasons for role malformed message (#239098)](#239098) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-16T17:13:28Z","message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","enhancement","Feature:Users/Roles/API Keys","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.18.9","v8.19.6","v9.0.9"],"title":"[Roles] Added error reasons for role malformed message","number":239098,"url":"https://github.com/elastic/kibana/pull/239098","mergeCommit":{"message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.18","8.19","9.0"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239098","number":239098,"mergeCommit":{"message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
#239412) # Backport This will backport the following commits from `main` to `9.1`: - [[Roles] Added error reasons for role malformed message (#239098)](#239098) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-16T17:13:28Z","message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","enhancement","Feature:Users/Roles/API Keys","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.18.9","v8.19.6","v9.0.9"],"title":"[Roles] Added error reasons for role malformed message","number":239098,"url":"https://github.com/elastic/kibana/pull/239098","mergeCommit":{"message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.18","8.19","9.0"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239098","number":239098,"mergeCommit":{"message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
#239413) # Backport This will backport the following commits from `main` to `9.2`: - [[Roles] Added error reasons for role malformed message (#239098)](#239098) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-16T17:13:28Z","message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","enhancement","Feature:Users/Roles/API Keys","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.18.9","v8.19.6","v9.0.9"],"title":"[Roles] Added error reasons for role malformed message","number":239098,"url":"https://github.com/elastic/kibana/pull/239098","mergeCommit":{"message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.18","8.19","9.0"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239098","number":239098,"mergeCommit":{"message":"[Roles] Added error reasons for role malformed message (#239098)\n\n## Summary\n\nAdded error reasons for role malformed message.\n\n### How to test\n\n<details>\n <summary>1. Create a couple of malformed roles</summary>\n \n ```\n POST _security/role\n {\n \"roles\": {\n \"malformed-reserved-privileges-wrong-app-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-space-privileges-global-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"space_read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-global-privileges-space-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\"\n ],\n \"resources\": [\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-base-feature-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"all\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-invalid-resource-format-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"invalid:resource:format\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-duplicated-resources-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"space:default\",\n \"space:default\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n },\n \"malformed-reserved-privileges-mixed-role\": {\n \"cluster\": [],\n \"remote_cluster\": [],\n \"indices\": [],\n \"applications\": [\n {\n \"application\": \"kibana-.kibana\",\n \"privileges\": [\n \"reserved_ml_admin\",\n \"feature_dashboard.read\"\n ],\n \"resources\": [\n \"*\"\n ]\n }\n ],\n \"run_as\": [],\n \"metadata\": {},\n \"transient_metadata\": {\n \"enabled\": true\n }\n }\n }\n }\n ```\n</details>\n\n2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the\ndisplayed error messages.\n\nThe code block for kibana applications has been added underneath the\nmessage as well.\n<img width=\"613\" height=\"309\" alt=\"Screenshot 2025-10-15 at 14 59 58\"\nsrc=\"https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be\"\n/>\n\n\n| Error Reason | Client Message |\n| ------------- | ------------- |\n| `RESERVED_PRIVILEGES_WRONG_APP` | <img width=\"608\" height=\"225\"\nalt=\"Screenshot 2025-10-15 at 12 39 04\"\nsrc=\"https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29\"\n/> |\n| `GLOBAL_PRIVILEGES_SPACE` | <img width=\"578\" height=\"204\"\nalt=\"Screenshot 2025-10-15 at 12 43 20\"\nsrc=\"https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c\"\n/>|\n| `GLOBAL_RESOURCE_MIXED` | <img width=\"388\" height=\"184\"\nalt=\"Screenshot 2025-10-15 at 12 38 36\"\nsrc=\"https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f\"\n/>|\n| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width=\"478\" height=\"186\"\nalt=\"Screenshot 2025-10-15 at 12 42 59\"\nsrc=\"https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa\"\n/> |\n| `INVALID_RESOURCE_FORMAT ` | <img width=\"435\" height=\"195\"\nalt=\"Screenshot 2025-10-15 at 12 47 05\"\nsrc=\"https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0\"\n/> |\n| `DUPLICATED_RESOURCES ` | <img width=\"390\" height=\"190\"\nalt=\"Screenshot 2025-10-15 at 12 48 26\"\nsrc=\"https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c\"\n/> |\n| `SPACE_PRIVILEGES_GLOBAL` | <img width=\"398\" height=\"188\"\nalt=\"Screenshot 2025-10-15 at 12 50 14\"\nsrc=\"https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8\"\n/> |\n| `RESERVED_PRIVILEGES_MIXED` | <img width=\"566\" height=\"203\"\nalt=\"Screenshot 2025-10-15 at 12 53 54\"\nsrc=\"https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100\"\n/>|\n| `DISABLED_FEATURE_PRIVILEGES` | <img width=\"382\" height=\"198\"\nalt=\"Screenshot 2025-10-15 at 12 54 41\"\nsrc=\"https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc\"\n/> |\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n__Closes: https://github.com/elastic/kibana/issues/224053__\n\n## Release Note\nEnhanced the error message to include detailed information about why the\nrole is considered malformed.","sha":"762bed0ce1e9acb305e51f14b81d167467c7a9ed"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
## Summary
Added error reasons for role malformed message.
### How to test
<details>
<summary>1. Create a couple of malformed roles</summary>
```
POST _security/role
{
"roles": {
"malformed-reserved-privileges-wrong-app-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-space-privileges-global-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"space_read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-global-privileges-space-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all"
],
"resources": [
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-base-feature-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"all",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-invalid-resource-format-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"invalid:resource:format"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-duplicated-resources-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"feature_dashboard.read"
],
"resources": [
"space:default",
"space:default"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
},
"malformed-reserved-privileges-mixed-role": {
"cluster": [],
"remote_cluster": [],
"indices": [],
"applications": [
{
"application": "kibana-.kibana",
"privileges": [
"reserved_ml_admin",
"feature_dashboard.read"
],
"resources": [
"*"
]
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {
"enabled": true
}
}
}
}
```
</details>
2. Go to Stack Management -> Roles -> [MALFORMED_ROLE] and check the
displayed error messages.
The code block for kibana applications has been added underneath the
message as well.
<img width="613" height="309" alt="Screenshot 2025-10-15 at 14 59 58"
src="https://github.com/user-attachments/assets/9dea2b55-031a-484f-87e1-4a183d3db3be"
/>
| Error Reason | Client Message |
| ------------- | ------------- |
| `RESERVED_PRIVILEGES_WRONG_APP` | <img width="608" height="225"
alt="Screenshot 2025-10-15 at 12 39 04"
src="https://github.com/user-attachments/assets/be2d79da-2f4c-4529-9f80-e08dd1301e29"
/> |
| `GLOBAL_PRIVILEGES_SPACE` | <img width="578" height="204"
alt="Screenshot 2025-10-15 at 12 43 20"
src="https://github.com/user-attachments/assets/f9a5f2a2-fb13-4d2b-bc31-d28ea67cf48c"
/>|
| `GLOBAL_RESOURCE_MIXED` | <img width="388" height="184"
alt="Screenshot 2025-10-15 at 12 38 36"
src="https://github.com/user-attachments/assets/4854a4f1-197a-45de-a57e-14d3bf291a5f"
/>|
| `BASE_FEATURE_PRIVILEGES_MIXED ` | <img width="478" height="186"
alt="Screenshot 2025-10-15 at 12 42 59"
src="https://github.com/user-attachments/assets/0c63547e-05b1-485d-97da-a2df5955baaa"
/> |
| `INVALID_RESOURCE_FORMAT ` | <img width="435" height="195"
alt="Screenshot 2025-10-15 at 12 47 05"
src="https://github.com/user-attachments/assets/b2448a23-ba7f-44d7-8621-95293946d3f0"
/> |
| `DUPLICATED_RESOURCES ` | <img width="390" height="190"
alt="Screenshot 2025-10-15 at 12 48 26"
src="https://github.com/user-attachments/assets/ba8c982c-4e46-471f-b891-d73fc8526f1c"
/> |
| `SPACE_PRIVILEGES_GLOBAL` | <img width="398" height="188"
alt="Screenshot 2025-10-15 at 12 50 14"
src="https://github.com/user-attachments/assets/0b3f1fa6-7b40-4586-bf20-cb0dabff71d8"
/> |
| `RESERVED_PRIVILEGES_MIXED` | <img width="566" height="203"
alt="Screenshot 2025-10-15 at 12 53 54"
src="https://github.com/user-attachments/assets/c063f965-18be-460b-821f-c814a8d08100"
/>|
| `DISABLED_FEATURE_PRIVILEGES` | <img width="382" height="198"
alt="Screenshot 2025-10-15 at 12 54 41"
src="https://github.com/user-attachments/assets/a42bbacd-0df7-4ceb-85fb-457e7b28abbc"
/> |
### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
__Closes: https://github.com/elastic/kibana/issues/224053__
## Release Note
Enhanced the error message to include detailed information about why the
role is considered malformed.
Summary
Added error reasons for role malformed message.
How to test
1. Create a couple of malformed roles
The code block for kibana applications has been added underneath the message as well.

RESERVED_PRIVILEGES_WRONG_APPGLOBAL_PRIVILEGES_SPACEGLOBAL_RESOURCE_MIXEDBASE_FEATURE_PRIVILEGES_MIXEDINVALID_RESOURCE_FORMATDUPLICATED_RESOURCESSPACE_PRIVILEGES_GLOBALRESERVED_PRIVILEGES_MIXEDDISABLED_FEATURE_PRIVILEGESChecklist
release_note:*label is applied per the guidelinesbackport:*labels.Closes: #224053
Release Note
Enhanced the error message to include detailed information about why the role is considered malformed.