-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Change Proposal] Ability to add privileges for all data streams of a specific type #315
Comments
An alternative approach is using |
Is this an existing flag? Where can I learn more about it? Ideally, a logging-related input integration would only have access to |
No, I just made it up :-) Alternative it could |
Thanks for highlighting this use case. We have a few discussions this week around ingest node routing (eg. elastic/elasticsearch#63798) and I think I can provide a more helpful response here after we've had those. |
@joshdover Did you have a chance to think about this again? This issue is a blocker for full event routing and also the lightweight event routing required for an ECS logging integration (elastic/integrations#2972). |
There is currently work ongoing here around input packages: #325 I expect the packages that need this feature are normally input packages as for integrations packages, the data streams are mostly predefined. Now I'm torn if there should be a config param in the package spec itself for this or if Fleet should so magic around it. I'm leaning towards package a package spec flag as it would allow Fleet to know in advance that a certain package requires much more permissions and also warn the user about it. |
I'm wondering if instead, this should actually be solved with an index / data stream setting rather than with granting Agents explicit access to every data stream that an ingest pipeline may route to. This would allow us to further decouple the data collection from the ingest processing. Otherwise, every time a routing ingest pipeline adds or removes a new destination data stream, we'll need to update the API keys for every agent sending data to the routing data stream. Generating API keys has non-trivial performance overhead and when we're talking about 100k+ agents, rolling out an API key change could take quite a bit of time and put a large load on the cluster. Due to this delay, we'd need to also change the order of operations to update all the Agent API keys first, then update the routing ingest pipeline. Otherwise, data could be dropped. I'm imagining a setting like |
I don't think updates are required when the API keys have permissions for
I think that could work, too. However, it would conflate index-level settings with API Key permissions which makes it harder to reason about what you can do with a given API key. Not sure if the ES team would be happy with that. Also, I don't see why that would be preferable over an integration being able to request permissions for |
Got it, if we don't expect to ever have finer-grained privileges for these types of packages, I guess going with a purely package-based approach is fine then. Probably an option What if we put this next to Felix are you comfortable opening a PR for the package-spec change? Once we have agreement on the spec change we can create the implementation tasks. |
Here's the PR: #327 |
Hey @joshdover what's the progress on this? Is there any blocker? |
@felixbarny We still haven't made progress on elastic/kibana#115032 yet which is blocking this. It was a stretch goal for 8.4. @jen-huang @kpollich any progress made here? |
Thanks for the update. Seems like it doesn't make it to 8.4 then. Could we add this as a non-stretch goal to 8.5? |
We weren't able to get to this in 8.4. I'll add it to our 8.5 planning doc. |
APM Server would like to make use of this, or a variation on it, to satisfy elastic/kibana#134971 We wouldn't need to write to arbitrary datasets, only to arbitrary namespaces. Should I open a new issue for this? |
I would like to see us moving forward on this. My suggestion is to start with a simple solution that should work for apm-server but also input packages. The basic idea is that a package can opt-in to having the default permissions meaning permissions for If this becomes a problem, we can still follow up with more fine grained permissions. We should keep in mind, AFAIK apm-server standalone had more permissions in the past (including things like setup templates). There is a concern around the upgrade. Can we warn users if they add an integration with these permissions? Should we? |
+1 on a more generically useful name than
After our last discussions, I'm a little less concerned about expanding privileges for Agents as it hasn't historically been an issue for Beats users. We have advertised that agents will receive an API key with the minimum privileges required, but I haven't seen many user questions about this. We could consider some sort of explanation text in the integration policy upgrade flow which shows the privilege change that will happen. One problem with the APM package specifically is that this is upgraded during stack upgrade without user interaction, so there's not a chance to show this to the user. I'd argue we just defer on this problem. On an execution note, we are starting work on the Kibana blocker to enable any variation of this feature: elastic/kibana#115032 |
I don't know if this will add and help to the discussion but here it goes. I jut dealt with a user that is pulling kubernetes metrics and log data through elastic-agent. The agent monitors a cluster but that cluster has different pods doing different work for different applications and apparently different apps within a same pod. The user has not access to make changes on how the agent is deployed so they can only segment the data based on the fields they are receiving from the already installed agents. Hacky workaround Dropping here for considerations. |
I've updated the package spec PR Now, there are two dedicated flags: |
Currently, the data stream permissions are specific to the dataset that an integration defines.
For example, when adding a custom log integration, you'll have to specify the
data_stream.dataset
, for examplefoo
, and an API key will be generated with the permissions to send data tologs-foo-default
.This is limiting for integrations that define a data stream that routes events to other data streams. See:
Example: a log line like this gets sent to the
logs-ecs_router-default
data stream:The default ingest pipeline for
logs-ecs_router-default
parses the JSON within the message and uses thedata_stream.dataset
from the log message to route the message to thelogs-foo-default
data stream (by overriding the_index
field).The issue is that this will lead to a security exception as the API key used to ingest the data only has permissions to ingest data to
logs-ecs_router-default
.This is also an issue for the Azure springcloudlogs integration: All logs are always sent to the
springcloudlogs
data stream, even if the logs are from different application and, thus, should ideally be routed to their own data streams. Other examples are CloudWatch, k8s logs, PCF logs, and httpjson.This relates to the discussions about input-only packages but is an independent and decoupled task.
What I'm proposing is to add a flag to the package spec that behaves similar to
dataset_is_prefix
package-spec/versions/1/data_stream/manifest.spec.yml
Lines 129 to 132 in d017330
But instead of just adding
.*
to the index permissions, the flag will allow access to all data streams of a given type, such aslogs-*-*
.@ruflin @mtojek @joshdover
The text was updated successfully, but these errors were encountered: