Skip to content

Commit

Permalink
Remove the action field from Policy manifests, add an OTHER match…
Browse files Browse the repository at this point in the history
… type (#291)

* Remove the `action` field from Policy manifests

Also removes all handling of this field, and any relevant documentation.

* Rename `inclusion` --> `matches`

* Add an `OTHER` match type to `MatchesEnum`

* Adhere to the established testing pattern

* updated the fidesctl policy

Co-authored-by: Thomas La Piana <tal103020@icloud.com>
  • Loading branch information
PSalant726 and Thomas La Piana authored Dec 22, 2021
1 parent 184ca24 commit a53db04
Show file tree
Hide file tree
Showing 16 changed files with 162 additions and 262 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Fides (*fee-dhez*, Latin: Fidēs) is an open-source tool that allows you to easi

## :rocket: Quick Start

1. Get running with Docker: First, ensure that you have `make` and `docker` installed locally, and clone the Fides repo. Then, from the fides directory, run the following commands:
1. Get running with Docker: First, ensure that you have `make` and `docker` installed locally, and clone the Fides repo. Then, from the fides directory, run the following commands:

<details>

Expand Down Expand Up @@ -113,7 +113,7 @@ Fides (*fee-dhez*, Latin: Fidēs) is an open-source tool that allows you to easi
```

</details>

Congratulations, you've successfully run your first fidesctl `evaluate` command!
3. Now, take a closer look at `demo_resources/demo_policy.yml` which describes an organization's privacy policy as code. This policy just includes one rule: fail if any system that uses contact information for marketing purposes.
Expand All @@ -130,19 +130,18 @@ Fides (*fee-dhez*, Latin: Fidēs) is an open-source tool that allows you to easi
name: Reject Direct Marketing
description: Disallow collecting any user contact info to use for marketing.
data_categories:
inclusion: ANY
matches: ANY
values:
- user.provided.identifiable.contact
data_uses:
inclusion: ANY
matches: ANY
values:
- advertising
data_subjects:
inclusion: ANY
matches: ANY
values:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
action: REJECT
```

</details>
Expand Down Expand Up @@ -170,8 +169,8 @@ Fides (*fee-dhez*, Latin: Fidēs) is an open-source tool that allows you to easi
<details>
<summary>Run <code>fidesctl evaluate</code> again</summary>
Re-run `fidesctl evaluate demo_resources` which will cause an evaluation failure! This is because your privacy policy has 1 rule that should fail if any system uses contact information for marketing purposes, and you've just updated your marketing system to start using contact information for marketing purposes.
Re-run `fidesctl evaluate demo_resources` which will cause an evaluation failure! This is because your privacy policy has 1 rule that should fail if any system uses contact information for marketing purposes, and you've just updated your marketing system to start using contact information for marketing purposes.

```bash
root@fa175a43c077:/fides/fidesctl# fidesctl evaluate demo_resources
Expand All @@ -198,7 +197,7 @@ We are committed to fostering a safe and collaborative environment, such that al
### Documentation
For more information on getting started with Fides, how to configure and set up Fides, and more about the Fides ecosystem of open source projects:
For more information on getting started with Fides, how to configure and set up Fides, and more about the Fides ecosystem of open source projects:
- Documentation: https://ethyca.github.io/fides/
- Tutorial: https://ethyca.github.io/fides/tutorial/
Expand Down
35 changes: 13 additions & 22 deletions docs/fides/docs/language/resources/policy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Policy

A Policy is your privacy policy as code, it lists a set of acceptable and non-acceptable rules and uses all 4 privacy attributes (`data_category`, `data_use`, `data_subject`, and `data_qualifier`). The purpose of the policy is to state what types of data are allowed for certain usages.
A Policy is your privacy policy as code, it lists a set of acceptable and non-acceptable rules and uses all 4 privacy attributes (`data_category`, `data_use`, `data_subject`, and `data_qualifier`). The purpose of the policy is to state what types of data are allowed for certain usages.
```
organization
|-> ** policy **
Expand All @@ -11,7 +11,7 @@ A Policy is your privacy policy as code, it lists a set of acceptable and non-ac

**fides_key**<span class="required"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_string_

A string token of your own invention that uniquely identifies this Policy. It's your responsibility to ensure that the value is unique across all of your Policy objects. The value may only contain alphanumeric characters and underbars (`[A-Za-z0-9_]`).
A string token of your own invention that uniquely identifies this Policy. It's your responsibility to ensure that the value is unique across all of your Policy objects. The value may only contain alphanumeric characters and underbars (`[A-Za-z0-9_]`).

**name**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_string_

Expand All @@ -35,23 +35,16 @@ The [Data Subjects](/fides/language/taxonomy/data_subjects/) privacy attribute d

**data_qualifier**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_string_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

The [Data Qualifier](/fides/language/taxonomy/data_qualifiers/) privacy attribute describes the acceptable or non-acceptable level of deidentification for this data.
The [Data Qualifier](/fides/language/taxonomy/data_qualifiers/) privacy attribute describes the acceptable or non-acceptable level of deidentification for this data.

**inclusion**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_enum_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
**matches**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_enum_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

* `ANY`
* `ALL`
* `NONE`
* `OTHER`

The inclusion criteria describes how you would like this rule to be evaluated. These basic logic gates determine whether the array of privacy attributes will be fully included (`ALL`), not included at all (`NONE`), or only included if at least 1 item in the array matches (`ANY`).

**action**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_enum_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

* `ACCEPT`
* `REJECT`
* `REQUIRE`

The action describes how the policy should be enforced. These basic actions determine how the rule will be enforced. At the moment, `REJECT` is the only supported action, but ACCEPT and REQUIRE will be supported in version 1.0+.
The matches criteria describes how you would like this rule to be evaluated. These basic logic gates determine whether the array of privacy attributes will be fully included (`ALL`), not included at all (`NONE`), only included if at least 1 item in the array matches (`ANY`), or excluded with any additional attributes included (`OTHER`).

**organization_fides_key**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_string_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default: `default_organization`

Expand All @@ -72,19 +65,18 @@ policy:
name: Reject Direct Marketing
description: Disallow collecting any user contact info to use for marketing.
data_categories:
inclusion: ANY
matches: ANY
values:
- user.provided.identifiable.contact
data_uses:
inclusion: ANY
matches: ANY
values:
- advertising
data_subjects:
inclusion: ANY
matches: ANY
values:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
action: REJECT
```
**Demo manifest file:** `/fides/fidesctl/demo_resources/demo_policy.yml`
Expand All @@ -105,25 +97,24 @@ POST /policy
"name": "Reject Direct Marketing",
"description": "Disallow collecting any user contact info to use for marketing.",
"data_categories": {
"inclusion": "ANY",
"matches": "ANY",
"values": [
"user.provided.identifiable.contact"
]
},
"data_uses": {
"inclusion": "ANY",
"matches": "ANY",
"values": [
"advertising"
]
},
"data_subjects": {
"inclusion": "ANY",
"matches": "ANY",
"values": [
"customer"
]
},
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"action": "REJECT"
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified"
}
]
}
Expand Down
15 changes: 6 additions & 9 deletions docs/fides/docs/tutorial/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ policy:
name: Minimize User Identifiable Data
description: Reject collecting any user identifiable data for uses other than system operations
data_categories:
inclusion: ANY
matches: ANY
values:
- user.provided.identifiable
- user.derived.identifiable
data_uses:
inclusion: ANY
matches: ANY
values:
- improve
- personalize
Expand All @@ -28,17 +28,16 @@ policy:
- collect
- train_ai_system
data_subjects:
inclusion: ANY
matches: ANY
values:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
action: REJECT

- fides_key: reject_sensitive_data
name: Reject Sensitive Data
description: Reject collecting sensitive user data for any use
data_categories:
inclusion: ANY
matches: ANY
values:
- user.provided.identifiable.biometric
- user.provided.identifiable.childrens
Expand All @@ -49,7 +48,7 @@ policy:
- user.provided.identifiable.religious_belief
- user.provided.identifiable.sexual_orientation
data_uses:
inclusion: ANY
matches: ANY
values:
- provide
- improve
Expand All @@ -59,11 +58,10 @@ policy:
- collect
- train_ai_system
data_subjects:
inclusion: ANY
matches: ANY
values:
- customer
data_qualifier: aggregated
action: REJECT
```
This demo application is built without any real controls on user data, so the Fides policy is relatively restrictive. The two rules can be interpreted respectfully as:
Expand All @@ -84,7 +82,6 @@ Policies use the following attributes:
| data_uses | List[DataRule] | The various categories of data processing and operations within your organization |
| data_subjects | List[DataRule] | The individual persons to whom you data rule pertains |
| data_qualifier | String | The acceptable or non-acceptable level of deidentification |
| action | Choice | A string, either `ACCEPT` or `REJECT` |

> For more detail on Policy resources, see the full [Policy resource documentation](../language/resources/policy.md).

Expand Down
7 changes: 3 additions & 4 deletions fidesctl/demo_resources/demo_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ policy:
- name: Reject Direct Marketing
description: Disallow collecting any user contact info to use for marketing.
data_categories:
inclusion: ANY
matches: ANY
values:
- user.provided.identifiable.contact
data_uses:
inclusion: ANY
matches: ANY
values:
- advertising
data_subjects:
inclusion: ANY
matches: ANY
values:
- customer
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
action: REJECT
7 changes: 3 additions & 4 deletions fidesctl/fides_resources/policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ policy:
- name: reject_non_system_data
description: Disallow any non-system data or uses.
data_categories:
inclusion: NONE
matches: OTHER
values:
- system.operations
data_uses:
inclusion: NONE
matches: OTHER
values:
- provide
data_subjects:
inclusion: NONE
matches: OTHER
values:
- anonymous_user
data_qualifier: aggregated
action: REJECT
Loading

0 comments on commit a53db04

Please sign in to comment.