-
Notifications
You must be signed in to change notification settings - Fork 105
We need to be able to restrict the whisper importer utility to a single org #1334
Comments
I think this problem needs a bit more thought. |
That's a good idea. If we support the same authentication mechanism that the normal metric ingestion uses maybe we won't need to deploy the importer-writer every time we need it for a customer on the shared instance. The shared instance could just always have an importer-writer pod running, and if a customer wants to import data they'd simply run the importer-reader with the same authentication key that they use for ingest. |
How about this: 0e0a5cd |
i don't think we should move auth into any of the mt services |
I agree with @Dieterbe. Authentication should continue to remain out-of-scope for metrictank. In addition to just gating access, we also need to ensure that the orgId used in archives matches the orgId of the authenticated user. For metrics, we currently handle this in tsdb-gw. We could also handle it there for the importer, but that would mean that the gateway needs to decode the archives and validate that the correct orgId is being used (we could also potentially just modify the orgId in archives before forwarding to the importer, we do that for metrics). But this seems like unnecessary overhead for archives. Instead i think we could design it like so: importer-writer should have a cli flag for orgId enforcement. If enabled then importer-writer will expect requests to have a 'x-org-id' header. The value of the header will be the orgId that should be used to validate archives (i am undecided as to whether we should reject or just rewrite). For GrafanaCloud we then just need to add a proxy route to tsdb-gw for the importer, with the "x-org-id" header being added before proxying the request. This is exactly what we do for graphite/* requests. |
I see 3 main options: enforce proper orgid in tsdbgw-auth (rewriting orgid based on auth like ingest)
enforce proper orgid in imporer-writer via a cli flag
enforce proper orgid in imporer-writer by tsdbgw specifying it to importer-writer (e.g. via the http x-org-id header)
Note also that the ArchiveRequest not only contains an orgid in its MetricData property, but each contained ChunkWriteRequest has an orgid in the AMKey.
|
I do agree with this. The only change we need is to use
|
I like |
This is now involving 3 PRs (and I'll need to create one for raintank/schema too): |
I have done more testing of this on Friday (and added a bunch of fixes). If you get a chance, these two are still waiting for review: #1335 |
With all this discussion having happened I think a synopsis is worthwhile. Seems it all boils down to:
|
that's correct as you described. the only PR left to merge is the MT one (#1335), the HM-API & tsdb are already merged |
Currently when we spin up the importer-writer utility, then it will just write all the chunk write requests it receives into the defined keyspace. But we need to be able to limit which orgs we want to write to, in order to not accidentally write into the wrong one.
The text was updated successfully, but these errors were encountered: