Repository navigation
Revert "Revert "Check access rights in the TimeSeries table functions"" - #119282
alexey-milovidov wants to merge 1 commit into
Conversation
|
Workflow [PR], commit [fcc113f] Summary: ❌
AI ReviewSummaryThis revert restores privilege checks for the Findings
Tests
Final VerdictNot ready to merge. The new checks close the |
| { | ||
| const auto * target = tryGetTarget(target_kind); | ||
|
|
||
| /// An inner target carries a UUID or nothing at all, and the name of a non-Atomic one is derived from |
There was a problem hiding this comment.
05137 already grants on the real inner table name (.inner_id.tags.<uuid>), so returning empty here is not just a comment mismatch: it forces every caller down the "look the inner table up first, authorize later" path. If an inner target has been dropped, timeSeriesSamples() / timeSeriesTags() / timeSeriesMetrics() and timeSeriesSelector() now return UNKNOWN_TABLE to a user who only has privileges on the outer TimeSeries table, which still leaks target existence.
We need a pre-lookup identity for inner targets as well (derived .inner_id.*, plus the legacy .inner.data.* samples fallback in Ordinary databases), otherwise the new access check remains incomplete for inner tables.
| /// Authorized here rather than where this storage is created, so that a persistent table built over this | ||
| /// table function is authorized on every read, with the reader's own grants. Before the table is | ||
| /// resolved, so that an unauthorized reader learns nothing about it. | ||
| checkAccessToTimeSeriesTable(config.time_series_storage_id, context, AccessType::SELECT); |
There was a problem hiding this comment.
This still only authorizes the outer TimeSeries table. A few lines later readImpl() calls getTargetTableID() / getTargetTable() for the samples and tags targets before any SELECT check on those targets, so SELECT ... FROM timeSeriesSelector(...) still leaks UNKNOWN_TABLE when one of the hidden targets has been dropped.
The new tests only cover the DESCRIBE path (ts_tags_gone). The read path for timeSeriesSelector() and, transitively, prometheusQuery() / prometheusQueryRange() remains open. We need the same pre-lookup target authorization here that getConfiguration() now does for SHOW COLUMNS, but with the exact columns the generated queries require so the column-scoped grants from 05137 keep working.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
|
Checking access rights for TimeSeries needs to be fixed manually, I'll do that |
Reverts #119281
Workflow [PR]
Sync PR [sync-upstream/pr/119282]