OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Incident Manager listing ignores domain policies — domain-restricted users see other domains' incidents

Open ShaileshParmar11 opened this issue 3 months ago • 1 comments

Follow-up to #24180, which covered the same class of problem (a domain-restricted user seeing metadata from outside their domain) for domain listings and lineage. The Incident Manager listing still has this gap.

What happens

A user restricted to their own domain via a hasDomain() / !hasDomain() policy sees failed test case incidents from every domain on the Incident Manager page. Opening one is correctly blocked, but the listed row already exposes the test case name, the table name and the full FQN.

Reported by community users on 1.12.1 and still reproducing on 1.12.13, 1.13.1 and 1.13.3. Also reproduces on current main.

Note that #21808 / commit 7c9d85ae2e added a user-supplied domain filter parameter to this endpoint. That is a filter the caller opts into, not policy enforcement, so it does not close this gap.

Root cause

RuleEvaluator#hasDomain short-circuits to true for list operations, because a listing has no single resource to evaluate the condition against:

if (resourceContext.getEntity() == null || resourceContext.getEntity().getId() == null) {
  LOG.info("hasDomain() - List operation detected (no specific resource), returning true for post-filtering");
  return true;
}

So !hasDomain() is false for every deny rule on a listing, and enforcement is deferred to "post-filtering" on the search query. For the incident listing that post-filtering never happens: EntityTimeSeriesRepository#listFromSearchWithOffset and #listLatestFromSearch call SearchRepository without a SubjectContext, so the existing RBACConditionEvaluator machinery never runs. latest=true goes through the aggregation path and is unfiltered for the same reason.

Consequence: no policy the administrator can write will restrict this listing.

Steps to reproduce

  1. Create domains A and B; put a table (and its test case) in B.
  2. Create an incident for that test case.
  3. Create a user in domain A holding a policy that denies ViewAll when !hasDomain() (the seeded DomainOnlyAccessRole works).
  4. Set searchSettings.globalSettings.enableAccessControl = true.
  5. As that user, GET /api/v1/dataQuality/testCases/testCaseIncidentStatus/search/list.

Expected: domain B's incident is absent. Actual: it is listed, with the test case name and full FQN. GET .../testCaseIncidentStatus/{id} on that same row returns 403.

Related

  • #24180 — same class, domain listings and lineage
  • #21808 — added the user-supplied domain filter parameter (not enforcement)

ShaileshParmar11 avatar Aug 19 '26 08:08 ShaileshParmar11

Hello @ShaileshParmar11, I see that the issue has been closed and fixed. Could you please confirm which version we should use to avoid experiencing this behavior?

AbanoubSamir004 avatar Aug 21 '26 09:08 AbanoubSamir004