-
Notifications
You must be signed in to change notification settings - Fork 18
Description
This proposal is to replace the "trusted apps" mechanism, and to augment the acl:origin mechanism in WAC, to allow resource owners to control the access different of their apps have to their different resources, by introducing the notions of
- access scopes (identified by tag patterns) for access modes for resources; and
- a mapping from apps to tag patterns.
The proposal allows each user to have independent mappings of apps to tag patterns, provided the resource server is configured to enforce the visiting users' app access preferences.
If this proposal resonates with folks, I'll prepare a more formal specification as a PR.
Assumptions
- access control to resources belongs to the resource owner/controller
- access control is interpreted and enforced by the resource server
- a user should be able to use whatever app she wishes to access resources
- a (determined) user can lie to a resource server about the identity of the app she's using
- corollary: a resource server can't force a (determined) user to use (or to not use) any particular app
- an app can't lie about its identity (specifically, it can't impersonate another app) without the help and approval of the user and her software agents (including her trusted web browser and/or trusted identity provider), or without the collusion (or malfunction) of the app being impersonated
- a resource owner/controller might wish to allow her own access for some classes of resources only to a subset of apps she uses, and to allow different apps access to different classes of resources
- a resource owner/controller might wish to allow other users to make independent choices of what apps are allowed access to different classes of resources (the classes assigned by the resource owner)
- the classifications of resources on one server by an owner are independent of classifications by other owners on other servers
- an app the user is using, by default, shouldn't be able to discover what other apps the user uses, nor what resource servers she accesses with those other apps
- a resource server, by default, shouldn't be able to discover what apps the user uses, other than those she uses to access that server, nor what other resource servers she accesses
Proposal
Note: acl:app is similar to acl:origin, only allowing finer-grained app identification (for example, with an OAuth2 redirect_uri), and allowing matching by prefix instead of exact match (so that acl:app "https://app.example/oauth/" matches an app-id of https://app.example/oauth/code). Other new terms in acl: used here are assumed for now to be obvious from context.
The resource owner/controller can specify one or more tag patterns in an acl:Authorization instead of an acl:origin or acl:app. Tag patterns can include wildcards (* and ? characters) and use traditional shell globbing rules to match. Example ACL:
# ACL for a container of chat messages, allowing
# read for all authenticated users who are using
# an app with a tag pattern that matches "Chat.Read" or "Photos.*".
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
[]
a acl:Authorization;
acl:mode acl:Read;
acl:agentClass acl:AuthenticatedAgent;
acl:accessTo <./>;
# apps the user has tagged "Chat.Read" or "Chat.*" or "*.Read" or
# "*" will be allowed.
acl:tag "Chat.Read";
# alternatively, apps the user has tagged "Photos.Anything" or "Photos.*"
# or "*" will also be allowed.
acl:tag "Photos.*";
acl:default <./> .
If any of the tag patterns that the user has assigned to the app that she's using matches any of the tag patterns in the acl:Authorization, then it's as if there was an acl:app match. Note that there is no global vocabulary of tags/scopes; tags are arbitrary, and what tags to assign to authorizations is entirely at the discretion of a resource owner. Tags SHOULD have the same meaning at least across resources in the same origin and realm.
The user associates tag patterns for the combination of an app, resource server origin, and security realm (the name of the protection space; that is, the realm authentication parameter of the WWW-Authenticate HTTP response header) in an App Authorization document. Tag patterns here can also include wildcards (* and ?) and use the same globbing as tags in ACLs. Here is an example App Authorization document assigning tag patterns Books.Read and Chat.* to app https://app.example/oauth/code when accessing server https://mike.example's realm /auth/:
# this is world-readable but has an unguessable URI like
# <https://mike.example/wac/app-auth/b6d88441302c07700743b8d793ae2a8a.ttl#it>
# in a non-listable container.
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
<#it>
a acl:AppAuthorization;
acl:resourceServer [
acl:origin <https://mike.example>;
acl:realm "/auth/"
];
acl:app "https://app.example/oauth/code";
acl:tag "Books.Read", "Chat.*" .
The URI for the App Authorization document MUST be in (at a sub-path of) an acl:appAuthorizations in the user's profile (otherwise the resource server MUST ignore it):
# this is the user's profile document
<#me> acl:appAuthorizations </wac/app-auth/> .
This container/directory SHOULD be configured to allow read of App Authorization documents by anyone and any origin; however, to protect the user's privacy (specifically, what apps the user uses and what resource servers the user accesses with those apps) including from other apps the user uses, listing the container's contents should be restricted to only the user, and then to only the user's trusted authorization management app.
The method by which an app discovers its App Authorization URIs is to be determined. I envision that each app will have an App Authorizations index file, generated and maintained by the user's trusted authorization management app, stored in a non-listable container, with a URI derived from the app's identifier, and readable only by the user and only when using that app, mapping between App Authorization URIs and resource servers, for example:
# App Authorizations index file for app "https://app.example/oauth/code".
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
</wac/app-auth/b6d88441302c07700743b8d793ae2a8a.ttl#it>
acl:resourceServer [ acl:origin <https://mike.example>; acl:realm "/auth/" ] .
</wac/app-auth/4f20846c1179e604048a589583dd6f9c.ttl#it>
acl:resourceServer [ acl:origin <https://other.example>; acl:realm "Other Server" ] .
The non-listable container for App Authorization index files SHOULD return identical HTTP 403 responses both for accesses to non-existent index files and for accesses to existing index files which are not for the user∙app requesting it, so that an adversary (other user or other app) can't probe for index files to discover what apps the user might use.
The method by which the tag vocabulary being used by a server is communicated to the user or to the user's trusted authorization management app is to be determined. I envision that a method could integrate with the HTTP Privilege Request Protocol.
To associate tags with a Bearer access token, the app sets the app_authorizations key in the proof-token/POPToken to be the URI of the App Authorization appropriate for this server∙realm. The server verifies the App Authorization URI as being in one of the user's acl:appAuthorizations containers, and (re)loads/revalidates this document at least as often as the user's profile document. The server applies any tag patterns in this document that are for this server∙realm and the app being used, to match against tags in acl:Authorizations for which the user would otherwise be permitted.