This repository has been archived by the owner on May 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update contribution guidelines * Add multi-entity attrs
- Loading branch information
Showing
7 changed files
with
263 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
openapi: 3.0.2 | ||
info: | ||
title: FastAPI | ||
version: 0.1.0 | ||
paths: | ||
/v1/claimsobject: | ||
post: | ||
summary: Request ClaimsObject | ||
operationId: read_entity_attribute_relationship_v1_entity__entityId__claimsobject_post | ||
requestBody: | ||
$ref: "#/components/requestBodies/ClaimsRequest" | ||
responses: | ||
'200': | ||
description: Successful Response | ||
content: | ||
application/json: | ||
schema: {} | ||
'422': | ||
description: Validation Error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/HTTPValidationError' | ||
'404': | ||
description: Entity Not Found Error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/HTTPValidationError' | ||
security: | ||
- OAuth2AuthorizationCodeBearer: [] | ||
components: | ||
schemas: | ||
AttributeObject: | ||
title: AttributeObject | ||
required: | ||
- attribute | ||
type: object | ||
properties: | ||
attribute: | ||
title: Attribute | ||
maxLength: 2083 | ||
minLength: 1 | ||
type: string | ||
format: uri | ||
example: | ||
attribute: https://eas.local/attr/ClassificationUS/value/Unclassified | ||
ClaimsObject: | ||
title: ClaimsObject | ||
required: | ||
- subjects | ||
- client_public_signing_key | ||
type: object | ||
properties: | ||
entities: | ||
title: Entities (min. 1) | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/EntitlementObject' | ||
client_public_signing_key: | ||
title: Requesting Entity Public Signing Key | ||
type: string | ||
tdf_spec_version: | ||
title: Version of the TDF spec this object maps to (optional) | ||
type: string | ||
EntitlementObject: | ||
title: EntitlementObject | ||
required: | ||
- entity_identifier | ||
- entity_attributes | ||
type: object | ||
properties: | ||
entity_identifier: | ||
title: Entity Identifier | ||
type: string | ||
entity_attributes: | ||
title: Entity Attributes | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/AttributeObject' | ||
HTTPValidationError: | ||
title: HTTPValidationError | ||
type: object | ||
properties: | ||
detail: | ||
title: Detail | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/ValidationError' | ||
ValidationError: | ||
title: ValidationError | ||
required: | ||
- loc | ||
- msg | ||
- type | ||
type: object | ||
properties: | ||
loc: | ||
title: Location | ||
type: array | ||
items: | ||
type: string | ||
msg: | ||
title: Message | ||
type: string | ||
type: | ||
title: Error Type | ||
type: string | ||
requestBodies: | ||
ClaimsRequest: | ||
description: Claims request body | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
oneOf: | ||
- type: object | ||
required: | ||
- primary_subject_id | ||
- secondary_entity_ids | ||
- client_public_signing_key | ||
maxProperties: 3 | ||
properties: | ||
primary_subject_id: | ||
title: Primary entity ID entitlements are being fetched for (e.g. `sub` in JWT token) | ||
type: string | ||
secondary_entity_ids: | ||
title: Secondary Entity Ids | ||
description: Array of additional entities that EntitlementObjects should be fetched for. | ||
type: array | ||
items: | ||
type: string | ||
client_public_signing_key: | ||
title: Requesting Client Public Signing Key | ||
type: string | ||
securitySchemes: | ||
OAuth2AuthorizationCodeBearer: | ||
type: oauth2 | ||
flows: | ||
authorizationCode: | ||
scopes: {} | ||
authorizationUrl: '' | ||
tokenUrl: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,41 @@ | ||
# Attribute Object | ||
|
||
## Summary | ||
An Attribute Object contains attribute information the TDF3 system uses to enforce attribute-based access control (ABAC). Attributes are used in both the [PolicyObject](PolicyObject.md) to define the attributes that a subject "needs" to gain access in an ABAC sense, and in the [ClaimsObject](ClaimsObject.md) to assert the attributes that an actor "has". | ||
Access decisions are made by comparing the attributes a subject has with the attributes a policy requires. | ||
An Attribute Object contains attribute information the TDF3 system uses to enforce attribute-based access control (ABAC). | ||
|
||
Attributes that a subject (or actor, or entity) "has" are referred to as "subject attributes". | ||
Attributes are used in both the [Policy Object](PolicyObject.md) to define the attributes that an entity "needs" to gain access to data in an ABAC sense, | ||
and in the [Entitlement Object](EntitlementObject.md) to assert the attributes that an entity "has". | ||
|
||
Attributes that subjects "need" in order to access data are referred to as "object attributes". | ||
Access decisions are made by comparing the attributes all entities have with the attributes a data policy requires. | ||
|
||
The _attribute_ field must be both unique and immutable as it is the reference id for the attribute. All of the other fields are mutable. The attribute string contains three pieces of information - the authority namespace, the attribute name, and the attribute value. | ||
Attributes that an entity (or actor, or subject) "has" are referred to as "entity entitlements" and are represented by [Entitlement Objects](EntitlementObject.md) | ||
|
||
When encrypting, the client determines which attributes a subject must have in order to decrypt the payload and applies those attributes to the file's [Policy Object](PolicyObject.md). | ||
Attributes that entities "need" in order to access data are referred to as "data attributes" and are represented by [Policy Objects](PolicyObject.md) | ||
|
||
The set of all entity entitlements involved in a request are referred to as "claims" and are represented by a [Claims Object](ClaimsObject.md) | ||
|
||
The _attribute_ field must be both globally unique and immutable as it is the reference id for the attribute. | ||
All of the other fields are mutable. The attribute string contains three pieces of information - the authority namespace, the attribute name, and the attribute value. | ||
|
||
When encrypting, the client determines which attributes an entity must have in order to decrypt the payload and applies those attributes to the file's [Policy Object](PolicyObject.md). | ||
|
||
When a decrypt is requested, the KAS checks the [Policy Object](PolicyObject.md) against the [Claims Object](ClaimsObject.md) from the requesting client to | ||
ensure the attributes that an entity "has" satisfies those that an entity "needs". | ||
|
||
If this check succeeds, the KAS permits a decrypt operation and returns a valid key which the client can decrypt and use to expose the file contents. | ||
|
||
The public key is used to wrap the object key or key splits on TDF3 file creation. On decrypt, the kasUrl defines where this key or key split can be rewrapped. | ||
|
||
The AttributeObject alone does not define how the KAS will compare a subject attribute to an object attribute when making an access decision. | ||
The KAS uses the namespaced object attributes in the [PolicyObject](PolicyObject.md) look up attribute policies from the cognizant authority | ||
The AttributeObject alone does not define how the KAS will compare an entity's attribute to an object attribute when making an access decision. | ||
The KAS uses the namespaced object attributes in the [Policy Object](PolicyObject.md) to look up attribute policies from the cognizant authority | ||
to make its policy decisions. Clients writing policies should use best available information from their organizations to select which AttributeObjects to include to protect the policy. | ||
|
||
## Example | ||
|
||
```javascript | ||
{ | ||
"attribute": "https://example.com/attr/classification/value/topsecret", | ||
"isDefault": true, | ||
"displayName": "classification", | ||
"pubKey": "pem encoded public key of the attribute", | ||
"kasUrl": "https://kas.example.com/", | ||
"tdfVersion:": "x.y.z" | ||
"attribute": "https://example.com/attr/classification/value/topsecret" | ||
} | ||
``` | ||
|
||
|Parameter|Type|Description|Required?| | ||
|---|---|---|---| | ||
|`attribute`|String|Also known as the "attribute url." The unique resource name for the attribute represented as a case-insensitive URL string. This field must be both unique and immutable as it is the reference id for the attribute. The attribute URL string contains three pieces of information - in the above example, the authority namespace (https://example.com), the attribute name (classification), and the attribute value (topsecret). |Yes| | ||
|`isDefault`|Boolean|If "true" this flag identifies the attribute as the default attribute. If missing (preferred) or false then the attribute is not the default attribute.|No| | ||
|`displayName`|String|A human-readable nickname for the attribute for convenience.|Yes| | ||
|`pubKey`|PEM|PEM encoded public key for this attribute. Often other attributes will use the same pubKey.|Yes| | ||
|`kasUrl`|URL|Base URL of a KAS that can make access control decisions for this attribute.|Yes| | ||
|`tdf_spec_version`|String|Semver version number of the TDF spec.|No| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.