Skip to content

[Fields Metadata] Restrict access to integration fields by privileges#199774

Merged
tonyghiani merged 6 commits intoelastic:mainfrom
tonyghiani:fields-metadata-privileges
Nov 19, 2024
Merged

[Fields Metadata] Restrict access to integration fields by privileges#199774
tonyghiani merged 6 commits intoelastic:mainfrom
tonyghiani:fields-metadata-privileges

Conversation

@tonyghiani
Copy link
Copy Markdown
Contributor

@tonyghiani tonyghiani commented Nov 12, 2024

📓 Summary

Related to #198349

Disabling authorization on fields metadata find API implies every user would have access to the integration fields since we use the internal user to retrieve the package information.

On the other hand, requiring API root-level privileges for fleet and fleetv2 would restrict more use cases since other apps might rely on this service to consume field metadata from ECS only, with no need for integration permissions (Discover, etc.).

To keep the door open to all these use cases, we'll check the available user privileges on a per-request basis and allow integration fields only when they have access to fleet and integrations, without fully restricting the service.

Screen.Recording.2024-11-12.at.12.38.05.mov

@tonyghiani tonyghiani added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Team:obs-onboarding Observability Onboarding Team labels Nov 12, 2024
@tonyghiani tonyghiani requested a review from a team as a code owner November 12, 2024 12:20
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fieldsMetadata 44 45 +1
Unknown metric groups

API count

id before after diff
fieldsMetadata 44 45 +1

History

Copy link
Copy Markdown
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

LGTM 👨🏼‍🔬

@tonyghiani tonyghiani merged commit 45056f3 into elastic:main Nov 19, 2024
@tonyghiani tonyghiani deleted the fields-metadata-privileges branch November 19, 2024 08:00
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11908618373

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2024
…elastic#199774)

## 📓 Summary

Related to elastic#198349

Disabling authorization on fields metadata `find API` implies every user
would have access to the integration fields since we use the internal
user to retrieve the package information.

On the other hand, requiring API root-level privileges for `fleet` and
`fleetv2` would restrict more use cases since other apps might rely on
this service to consume field metadata from ECS only, with no need for
integration permissions (Discover, etc.).

To keep the door open to all these use cases, we'll check the available
user privileges on a per-request basis and allow integration fields only
when they have access to fleet and integrations, without fully
restricting the service.

https://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
(cherry picked from commit 45056f3)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 19, 2024
…ileges (#199774) (#200676)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fields Metadata] Restrict access to integration fields by privileges
(#199774)](#199774)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2024-11-19T08:00:22Z","message":"[Fields
Metadata] Restrict access to integration fields by privileges
(#199774)\n\n## 📓 Summary\r\n\r\nRelated to #198349 \r\n\r\nDisabling
authorization on fields metadata `find API` implies every user\r\nwould
have access to the integration fields since we use the internal\r\nuser
to retrieve the package information.\r\n\r\nOn the other hand, requiring
API root-level privileges for `fleet` and\r\n`fleetv2` would restrict
more use cases since other apps might rely on\r\nthis service to consume
field metadata from ECS only, with no need for\r\nintegration
permissions (Discover, etc.).\r\n\r\nTo keep the door open to all these
use cases, we'll check the available\r\nuser privileges on a per-request
basis and allow integration fields only\r\nwhen they have access to
fleet and integrations, without fully\r\nrestricting the
service.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"45056f3abb268048e27ac297e4f9238ac86dba69","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-logs"],"title":"[Fields
Metadata] Restrict access to integration fields by
privileges","number":199774,"url":"https://github.com/elastic/kibana/pull/199774","mergeCommit":{"message":"[Fields
Metadata] Restrict access to integration fields by privileges
(#199774)\n\n## 📓 Summary\r\n\r\nRelated to #198349 \r\n\r\nDisabling
authorization on fields metadata `find API` implies every user\r\nwould
have access to the integration fields since we use the internal\r\nuser
to retrieve the package information.\r\n\r\nOn the other hand, requiring
API root-level privileges for `fleet` and\r\n`fleetv2` would restrict
more use cases since other apps might rely on\r\nthis service to consume
field metadata from ECS only, with no need for\r\nintegration
permissions (Discover, etc.).\r\n\r\nTo keep the door open to all these
use cases, we'll check the available\r\nuser privileges on a per-request
basis and allow integration fields only\r\nwhen they have access to
fleet and integrations, without fully\r\nrestricting the
service.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"45056f3abb268048e27ac297e4f9238ac86dba69"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199774","number":199774,"mergeCommit":{"message":"[Fields
Metadata] Restrict access to integration fields by privileges
(#199774)\n\n## 📓 Summary\r\n\r\nRelated to #198349 \r\n\r\nDisabling
authorization on fields metadata `find API` implies every user\r\nwould
have access to the integration fields since we use the internal\r\nuser
to retrieve the package information.\r\n\r\nOn the other hand, requiring
API root-level privileges for `fleet` and\r\n`fleetv2` would restrict
more use cases since other apps might rely on\r\nthis service to consume
field metadata from ECS only, with no need for\r\nintegration
permissions (Discover, etc.).\r\n\r\nTo keep the door open to all these
use cases, we'll check the available\r\nuser privileges on a per-request
basis and allow integration fields only\r\nwhen they have access to
fleet and integrations, without fully\r\nrestricting the
service.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"45056f3abb268048e27ac297e4f9238ac86dba69"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…elastic#199774)

## 📓 Summary

Related to elastic#198349 

Disabling authorization on fields metadata `find API` implies every user
would have access to the integration fields since we use the internal
user to retrieve the package information.

On the other hand, requiring API root-level privileges for `fleet` and
`fleetv2` would restrict more use cases since other apps might rely on
this service to consume field metadata from ECS only, with no need for
integration permissions (Discover, etc.).

To keep the door open to all these use cases, we'll check the available
user privileges on a per-request basis and allow integration fields only
when they have access to fleet and integrations, without fully
restricting the service.


https://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants