Repository navigation
fix(security): access control hardening - #37796
Conversation
…d metric fields A column read returns a column's profile only to a caller holding ViewDataProfile on the table and its custom metrics only to one holding ViewTests, as the table's own reads do, and still returns the columns otherwise. The rule is recorded in ADR:2026-11-12-a-column-read-leaves-out-fields-the-caller-may-not-view.
…arch access policies The asset counts now search as their asset listings do, for the caller, so the counts match the listings when search access control is on.
The soft delete updates that attachment by id. The prefix-wide update it used is removed.
The fork lists controls with the control repository's own fields and keeps those of the source framework, since the control listing does not filter by framework.
… patched A patch loads the file's folder, which is kept out of the stored JSON, so the FQN derived from the patched file still starts with the folder's.
The graph explorer endpoint answers admins only, so the table page offers the tab to admins when RDF is enabled.
A server removed from an MCP service by an update keeps its key in the external store until the service is hard-deleted, and then the key is removed with the others.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Distributions that build on the shared DAO still call it; only the soft delete here stops using it.
manerow
left a comment
There was a problem hiding this comment.
Thanks for this. The new checks look right to me. I left three comments inline that I'd like resolved before merging. Two are about data that released versions already wrote, and these fixes go into the 2.1 backport, so they matter there too. The third is about fields=* on the column search endpoints returning less than the caller may see.
Released versions stored a file edited inside a folder under its bare name, in its FQN and its nameHash alike. A 2.1.0 data migration step derives each file's FQN from its folder link, as setFullyQualifiedName does, and rewrites the FQN and nameHash together where they differ. Tags under the stored FQN move with it, the file is reindexed, and soft-deleted files are included. A file whose derived FQN another file holds is left as it is and logged, and a rewrite applies only while the file still holds the FQN the scan read. The step is in 2.1.0 because that is the newest migration version on main and it is not released yet, so the 2.1 backport carries the same files. A database on 2.0 runs it with the rest of 2.1.0. One on a 2.1.0 release candidate reruns the 2.1.0 data migration because its code changed, and runOnce keeps the step to one run. The FQN and hash are computed in Java, so MySQL and PostgreSQL share the step.
A column search returns tags, custom metrics and extension for *, so * is read as those three, and each is kept when the caller holds its operation: tags reach a caller with ViewTests or ViewDataProfile alone. The other column reads return none of them for *, so it is left out there. The decision record is amended to match.
| .bind("tagFQNHash", FullyQualifiedName.buildHash(tag.getTagFQN())) | ||
| .execute(); | ||
| } | ||
| dao.tagUsageDAO().updateTargetFQNHash(storedFqn, derivedFqn); |
There was a problem hiding this comment.
updateTargetFQNHash moves every tag_usage row whose targetFQNHash is the hash of the stored FQN, and the delete loop above it matches rows the same way. tag_usage doesn't record which entity a row belongs to. The stored FQN here is the file's bare name, which is also a root-level FQN, so other entities can own rows under it. Root folders and metrics store the raw name as their FQN. Root services, glossaries, domains and data products do too, for a name without dots or quotes. All of them carry tags.
For example: a tagged root folder Finance, and a file named Finance inside Archive that an edit damaged on 2.0.x. The repair deletes the folder's tags that the file already has under Archive.Finance, then moves the rest of the folder's tags onto the file. The folder ends up with no tags, nothing records that loss, and the file gains tags it never had. The step runs once, so nothing puts them back.
I'd like this resolved before merge, so the repair only moves tag rows that belong to the file it repairs.
There was a problem hiding this comment.
Fixed in cf3bd1b. The repair no longer touches a tag row it can't show is the file's.
- Before it moves anything, the step looks the bare name up in every registered entity table, by each table's name hash, live and soft-deleted rows alike. That covers root folders, metrics, services, glossaries, domains and data products without a list of types.
- If nothing else has that FQN, every row under it is the file's, and the rows move as before.
- If another entity has it, the file's FQN and
nameHashare still repaired. No row under the bare name is moved, copied or deleted, and the duplicate cleanup does not run. A WARN names the file, both FQNs and the other entity's type and id, for repair by hand. A type that can't be looked up counts as sharing.
I checked whether the file's own records could prove which rows are its own. Its versions do store tags, but a version saved after the damaging edit lists every row under the bare FQN, the other entity's included, and one row can be the tag of both. So the step leaves them all.
Tests in ContextFileFqnRepairMigrationIT cover your Finance example: a root folder with two tags, one of which the file also has under Archive.Finance. A second case does the same with a root glossary. After the step:
- the other entity shows exactly the tags it showed before
- the number of rows under the bare name is unchanged
- the file's FQN and hash are repaired
- the file has only its own tag
The folder case was RED on the previous commit, where the folder ended with no tags. The case where nothing else has the bare name also asserts now that no row is left under it. All of it is green on MySQL/Elasticsearch and on Postgres/OpenSearch.
tag_usage keys a row by FQN, not by entity, and a file's bare name can be another entity's FQN: a root folder, service, glossary, domain or metric named like the file. Before moving the rows under the bare name, the repair looks the name up in every registered entity table. When another entity has it, the file's FQN and nameHash are still repaired, every row under the bare name stays where it is, and the file, both FQNs and the other entities are logged for repair by hand. The file's versions cannot settle whose rows they are: a version saved after the edit lists every tag under the bare name, and one row can be the tag of both.
Code Review ✅ Approved 🔴 High risk 2 closed / 2 findingsThe Context Center upgrade migration rewrites file FQNs, name hashes, and tag_usage rows; incorrect matching could misplace tags or disrupt entity lookup. Hardens access control across column reads, tag and glossary-term asset counts, attachment soft delete, AI governance framework forks, Context Center file FQNs, and Knowledge Graph tab visibility, addressing the duplicated column field-to-operation map and the FQN repair that moved tag_usage rows belonging to other root entities. No open issues remain. ✅ 2 closed✅ Quality: ColumnFieldAccess adds a second field→operation map, against ADR 11-03
✅ Bug: FQN repair moves tag_usage rows that belong to other root entities
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
A batch of access-control hardening fixes from 2.1 release testing, one commit per area:
Each commit carries its own regression tests. Details are tracked internally.
Addresses open-metadata/openmetadata-collate#7797
Addresses open-metadata/openmetadata-collate#7963
Needs a 2.1 backport after review.
Type of change:
Checklist:
🤖 Generated with Claude Code
Review follow-up (2026-11-14)
Column custom-metric access now derives its required operation from
ViewOperationsinstead of duplicating the table mapping. A regression changes the registered operation and checks that the column endpoint follows it. Focused unit run: 26 passed; UI: 153 passed; MySQL/Elasticsearch integration run: 56 passed; PostgreSQL/OpenSearch search-access integration run: 5 passed.Summary by Gitar
tag_usagerowsprofileandcustomMetricsfields the caller may not viewThis will update automatically on new commits.


Confidence Score: 5/5
The PR appears safe to merge; the previous tag-loss issue is addressed and no new actionable issues were found.Summary
This PR tightens access checks for column fields and asset counts, fixes attachment deletion and framework copying, preserves folder names when editing Context Center files, and limits the Knowledge Graph tab to admins.
Reviews (3) · Last reviewed commit: "fix(context-center): leave tag rows anot..." · Reviewed by Greptile