Skip to content

Commit a77cf30

Browse files
authored
fix(core): improve KASR docs and add spellcheck GHA to pipeline (#323)
Resolves #335 Resolves #337
1 parent 5afd6b6 commit a77cf30

File tree

7 files changed

+222
-20
lines changed

7 files changed

+222
-20
lines changed

.github/spellcheck.ignore

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
AllOf
2+
AnyOf
3+
Auth
4+
CLI's
5+
Changelog
6+
ConditionGroup
7+
CoolTool
8+
Decrypt
9+
ERS
10+
FQNs
11+
Hostname
12+
JSON
13+
JWT
14+
KASes
15+
KASs
16+
LDAP
17+
MacOS
18+
NPM
19+
Namespace
20+
Nano
21+
OIDC
22+
OpenTDF
23+
PDP
24+
PKCE
25+
README
26+
RadService
27+
SCS
28+
SDK
29+
ShinyThing
30+
TDF
31+
TDF'd
32+
TDFd
33+
TDFs
34+
TLS
35+
TODO
36+
TUI
37+
URI
38+
Unassign
39+
acmeco
40+
args
41+
attr
42+
auth
43+
cli
44+
clientId
45+
clientSecret
46+
config
47+
data-centric
48+
decrypt
49+
decryptable
50+
decrypted
51+
dev
52+
encodings
53+
enum
54+
https
55+
idP
56+
jq
57+
json
58+
jwt
59+
kas
60+
kas-url-path
61+
kasg
62+
kasr
63+
keychain
64+
keycloak
65+
keyring
66+
localhost
67+
namespace
68+
namespaces
69+
nano
70+
ns
71+
otdfctl
72+
performant
73+
poc
74+
pubkey
75+
quickstart
76+
resm
77+
resolvers
78+
scs
79+
sm
80+
stdin
81+
stdout
82+
stdout
83+
subcommand
84+
subcs
85+
subm
86+
submap
87+
tdf
88+
tdf-type
89+
tls
90+
tls-no-verify
91+
txt
92+
unassign
93+
unassignment
94+
upsert
95+
uri
96+
with-client-creds
97+
with-client-creds-file
98+
yaml

.github/workflows/spellcheck.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'spellcheck'
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- LICENSE
9+
- CODEOWNERS
10+
- '.gitignore'
11+
- '**/*.go'
12+
13+
jobs:
14+
spellcheck:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: matheus23/[email protected]
19+
with:
20+
files-to-check: '**/*.md'
21+
files-to-exclude: 'CHANGELOG.md'
22+
words-to-ignore-file: './.github/spellcheck.ignore'

docs/man/policy/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ command:
1414

1515
Manage policies within the platform.
1616

17-
Policy is a set of rules that are enforced by the platform. Specific to the the data centric
17+
Policy is a set of rules that are enforced by the platform. Specific to the the data-centric
1818
security, policy revolves around data attributes (referred to as attributes). Within the context
1919
of attributes are namespaces, values, subject-mappings, resource-mappings, key-access-server grants,
2020
and other key elements.

docs/man/policy/kas-grants/_index.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ they can be assigned grants to various attribute objects (namespaces, definition
1515

1616
> See `kas-registry` command within `policy` to manage the KASs known to the platform.
1717
18-
Grants are utilized by the platform at two important points when engaging with a TDF.
18+
Key Access Grants are associations between a registered KAS (see KAS Registry docs) and an Attribute.
19+
20+
An attribute can be assigned a KAS Grant on its namespace, its definition, or any one of its values.
21+
22+
Grants enable key split behaviors on TDFs with attributes, which can be useful for various collaboration scenarios around shared policy.
23+
24+
> [!WARNING]
25+
> KAS Grants are considered experimental, as grants to namespaces are not fully utilized within encrypt/decrypt flows at present.
1926
2027
## Utilization
2128

@@ -26,7 +33,7 @@ is found to be permissible):
2633
1. look up the attributes on the TDF within the platform
2734
2. find any associated grants for those attributes' values, definitions, namespaces
2835
3. retrieve the public key of each KAS granted to those attribute objects
29-
4. determine based on the specificity matrix below which keys to utilize
36+
4. determine based on the specificity matrix below which keys to utilize in splits
3037

3138
## Specificity
3239

@@ -47,3 +54,69 @@ Grants to Attribute Objects:
4754

4855
> Note:
4956
> A namespace grant may soon be required with deprecation of a default KAS/platform key.
57+
58+
## Split Scenarios
59+
60+
### AnyOf Split
61+
62+
`Bob` and `Alice` want to share data equally, but maintain their ability to decrypt the data without sharing each other’s private keys.
63+
64+
With KAS Grants, they can define a key split where the shared data is wrapped with both of their public keys and AnyOf logic, meaning that each partner could decrypt the data with just one of those keys.
65+
66+
If `Bob` assigns a grant between Bob's running/registered KAS to a known attribute value, and `Alice` defines a grant of Alice's running/registered KAS to the same attribute value,
67+
any data encrypted in a TDF will be decryptable with a key released by _either_ of their Key Access Servers.
68+
69+
Attribute A: `https://conglomerate.com/attr/organization/value/acmeco`
70+
71+
Attribute B: `https://conglomerate.com/attr/organization/value/example_inc`
72+
73+
| Attribute | Namespace | Definition | Value |
74+
| --------- | ---------------- | ------------ | ----------- |
75+
| A | conglomerate.com | organization | acmeco |
76+
| B | conglomerate.com | organization | example_inc |
77+
78+
**Attribute KAS Grant Scenarios**
79+
80+
1. Bob & Alice represent individual KAS Grants to attributes on TDF'd data
81+
2. Note that the attributes A and B are of _the same definition and namespace_
82+
83+
| Definition: organization | Value: acmeco | Value: example_inc | Split |
84+
| ------------------------ | ------------- | ------------------ | ----- |
85+
| Bob, Alice | - | - | OR |
86+
| - | Bob, Alice | - | OR |
87+
| - | - | Bob, Alice | OR |
88+
| - | Bob | Alice | OR |
89+
90+
### AllOf Split
91+
92+
Unlike the `AnyOf` split above, this time `Bob` and `Alice` want to make sure _both_ of their keys must be granted for data in a TDF
93+
to be decrypted. With KAS Grants, they can define a key split where the shared data is wrapped with both of their public keys and
94+
AllOf logic, meaning that neither partner can decrypt the data with just one of those keys.
95+
96+
To accomplish this, they each define KAS Grants between their KASes and policy attributes, and TDF data with at least two attributes -
97+
one assigned a KAS Grant to Bob's KAS and another assigned a KAS Grant to Alice's KAS.
98+
99+
Both KASes will need to permit access and release payload keys for the data TDF'd with multiple attributes assigned KAS Grants to be accessible and decrypted.
100+
101+
Attribute A: `https://conglomerate.com/attr/organization/value/acmeco`
102+
103+
Attribute B: `https://conglomerate.com/attr/department/value/sales`
104+
105+
| Attribute | Namespace | Definition | Value |
106+
| --------- | ---------------- | ------------ | --------- |
107+
| A | conglomerate.com | organization | acmeco |
108+
| A | conglomerate.com | department | marketing |
109+
110+
**Attribute KAS Grant Scenarios**
111+
112+
1. Bob & Alice represent individual KAS Grants to attributes on TDF'd data
113+
2. Note that the attributes A and B are of _the same namespace but different definitions_
114+
115+
| Definition: A | Value: A | Definition: B | Value: B | Split |
116+
| ------------- | -------- | ------------- | -------- | ----- |
117+
| Bob | - | Alice | - | AND |
118+
| Bob | - | - | Alice | AND |
119+
| - | Bob | - | Alice | AND |
120+
121+
> [!NOTE]
122+
> Any KAS Grants to attributes of different definitions or namespaces will be `AND` splits.

docs/man/policy/kas-registry/create.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ can be retrieved for the registered KAS under the `remote` key, such as `https:/
4444
"pem": "<your PEM certificate>",
4545
// key identifier
4646
"kid": "<your key id>",
47-
// algorithm (either: 1 for rsa:2048, 2 for ec:secp256r1)
47+
// key algorithm (see table below)
4848
"alg": 1
4949
}
5050
]
@@ -54,7 +54,16 @@ can be retrieved for the registered KAS under the `remote` key, such as `https:/
5454

5555
The JSON value passed to the `--public-keys` flag stores the set of public keys for the KAS.
5656

57-
The PEM value should contain everything `-----BEGIN CERTIFICATE-----\nMIIB...5Q=\n-----END CERTIFICATE-----\n`.
57+
1. The `"pem"` value should contain the entire certificate `-----BEGIN CERTIFICATE-----\nMIIB...5Q=\n-----END CERTIFICATE-----\n`.
58+
59+
2. The `"kid"` value is a named key identifier, which is useful for key rotations.
60+
61+
3. The `"alg"` specifies the key algorithm:
62+
63+
| Key Algorithm | `alg` Value |
64+
| -------------- | ----------- |
65+
| `rsa:2048` | 1 |
66+
| `ec:secp256r1` | 5 |
5867

5968
### Local
6069

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Create a new subject mapping
2+
title: Create a new subject mapping
33
command:
44
name: create
55
aliases:
@@ -11,30 +11,30 @@ command:
1111
description: The ID of the attribute value to map to a subject set
1212
shorthand: a
1313
required: true
14-
default: ""
14+
default: ''
1515
- name: action-standard
1616
description: The standard action to map to a subject set
1717
enum:
1818
- DECRYPT
1919
- TRANSMIT
2020
shorthand: s
2121
required: true
22-
default: ""
22+
default: ''
2323
- name: action-custom
2424
description: The custom action to map to a subject set
2525
shorthand: c
2626
required: false
27-
default: ""
27+
default: ''
2828
- name: subject-condition-set-id
29-
description: Known pre-existing Subject Condition Set Id
29+
description: Known preexisting Subject Condition Set Id
3030
required: true
31-
default: ""
31+
default: ''
3232
- name: subject-condition-set-new
3333
description: JSON array of Subject Sets to create a new Subject Condition Set associated with the created Subject Mapping
3434
required: false
35-
default: ""
35+
default: ''
3636
- name: label
3737
description: "Optional metadata 'labels' in the format: key=value"
3838
shorthand: l
39-
default: ""
40-
---
39+
default: ''
40+
---

docs/man/policy/subject-mappings/update.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Update a subject mapping
2+
title: Update a subject mapping
33
command:
44
name: update
55
aliases:
@@ -16,20 +16,20 @@ command:
1616
- TRANSMIT
1717
shorthand: s
1818
required: true
19-
default: ""
19+
default: ''
2020
- name: action-custom
2121
description: The custom action to map to a subject set
2222
shorthand: c
2323
required: false
24-
default: ""
24+
default: ''
2525
- name: subject-condition-set-id
26-
description: Known pre-existing Subject Condition Set Id
26+
description: Known preexisting Subject Condition Set Id
2727
required: true
28-
default: ""
28+
default: ''
2929
- name: label
3030
description: "Optional metadata 'labels' in the format: key=value"
3131
shorthand: l
32-
default: ""
32+
default: ''
3333
- name: force-replace-labels
3434
description: Destructively replace entire set of existing metadata 'labels' with any provided to this command
3535
default: false

0 commit comments

Comments
 (0)