Skip to content

Commit 1847825

Browse files
authored
Merge pull request #5455 from deads2k/objectref-guidance
add guidance about avoiding cross namespace references from namespaced resource
2 parents 665f4ea + 86550d6 commit 1847825

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

contributors/devel/sig-architecture/api-conventions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,26 @@ kind `Foo` by just the name (within the current namespace, if a namespaced
876876
resource), or should be called `fooRef`, and should contain a subset of the
877877
fields of the `ObjectReference` type.
878878

879+
Object references on a namespaced type should usually refer only to objects in
880+
the same namespace. Because namespaces are a security boundary, cross namespace
881+
references can have unexpected impacts, including:
882+
1. leaking information about one namespace into another namespace. It's natural to place status messages or even bits of
883+
content about the referenced object in the original. This is a problem across namespaces.
884+
2. potential invasions into other namespaces. Often references give access to a piece of referred information, so being
885+
able to express "give me that one over there" is dangerous across namespaces without additional work for permission checks
886+
or opt-in's from both involved namespaces.
887+
3. referential integrity problems that one party cannot solve. Referencing namespace/B from namespace/A doesn't imply the
888+
power to control the other namespace. This means that you can refer to a thing you cannot create or update.
889+
4. unclear semantics on deletion. If a namespaced resource is referenced by other namespaces, should a delete of the
890+
referenced resource result in removal or should the referenced resource be force to remain.
891+
5. unclear semantics on creation. If a referenced resource is created after its reference, there is no way to know if it
892+
is the one that is expected or if it is a different one created with the same name.
893+
894+
Built-in types and ownerReferences do not support cross namespaces references.
895+
If a non-built-in types chooses to have cross-namespace references the semantics of the edge cases above should be
896+
clearly described and the permissions issues should be resolved.
897+
This could be done with a double opt-in (an opt-in from both the referrer and the refer-ee) or with secondary permissions
898+
checks performed in admission.
879899

880900
TODO: Plugins, extensions, nested kinds, headers
881901

0 commit comments

Comments
 (0)