Skip to content

Commit df8e156

Browse files
authored
Add filter priority (#195)
* #56 Adding a priority property to each filter.
1 parent 11462b9 commit df8e156

File tree

54 files changed

+768
-521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+768
-521
lines changed

docs/docs/filter_policies/filter_policies.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
# Filter Policies
22

3-
The types of sensitive information identified by Phileas and how that information is de-identified are controlled through policies. A policy is a file stored under Phileas’s `policies` directory, which by default is located at `/opt/Phileas/policies/`. You can have an unlimited number of policies.
3+
The types of sensitive information identified by Phileas and how that information is de-identified are controlled
4+
through policies.
45

5-
Each policy has a `name` that is used by Phileas to apply the appropriate de-identification methods. The `name` is passed to Phileas’s [API](filtering-api.md) along with the text to be filtered when submitting text to Phileas. This provides flexibility and allows you to de-identify different types of documents in differing manners with a single instance of Phileas. For example, you may have a policy for bankruptcy documents and a separate policy for financial documents.
6-
7-
> There are [sample policies](sample_filter_policies.md) available for immediate use or customization to fit your use-cases.
6+
Each policy has a `name` that is used by Phileas to apply the appropriate de-identification methods. The `name` is
7+
passed to Phileas’s [API](filtering-api.md) along with the text to be filtered when submitting text to Phileas. This
8+
provides flexibility and allows you to de-identify different types of documents in differing manners with a single
9+
instance of Phileas. For example, you may have a policy for bankruptcy documents and a separate policy for financial
10+
documents.
811

12+
> There are [sample policies](sample_filter_policies.md) available for immediate use or customization to fit your
13+
> use-cases.
914
1015
### The Structure of a Policy
1116

1217
A policy:
1318

1419
* Must have a `name` that uniquely identifies it.
1520
* Must have a list of `identifiers` that are filters for sensitive information.
16-
* Each `identifier` , or filter, can have zero or more [filter strategies](filter-strategies.md). A filter strategy tells Phileas how to manipulate that type of sensitive information when it is identified.
21+
* Each `identifier` , or filter, can have zero or more [filter strategies](filter-strategies.md). A filter strategy
22+
tells Phileas how to manipulate that type of sensitive information when it is identified.
1723
* Can have an optional list of [terms](ignore-lists.md) or [patterns](ignoring-patterns.md).
1824
* Can have encryption keys to support [encryption](filter-strategies.md#fpe) of sensitive information.
1925

2026
### An Example Policy
2127

22-
The following is an example policy. In the example below you can see the [types of sensitive information](filters_README.md) that are enabled and the strategy for manipulating each type when found. This policy identifies email addresses and phone numbers and redacts each with the format given.
28+
The following is an example policy. In the example below you can see
29+
the [types of sensitive information](filters_README.md) that are enabled and the strategy for manipulating each type
30+
when found. This policy identifies email addresses and phone numbers and redacts each with the format given.
2331

2432
```
2533
{
@@ -45,21 +53,33 @@ The following is an example policy. In the example below you can see the [types
4553
}
4654
```
4755

48-
When an email address is identified by this policy, the email address is replaced with the text `{{{REDACTED-email-address}}}`. The `%t` gets replaced by the type of the filter. Likewise, when a phone number is found it is replaced with the text `{{{REDACTED-phone-number}}}`. You are free to change the redaction formats to whatever fits your use-case. See [Filter Strategies](filter-strategies.md) for all replacement options.
56+
When an email address is identified by this policy, the email address is replaced with the text
57+
`{{{REDACTED-email-address}}}`. The `%t` gets replaced by the type of the filter. Likewise, when a phone number is found
58+
it is replaced with the text `{{{REDACTED-phone-number}}}`. You are free to change the redaction formats to whatever
59+
fits your use-case. See [Filter Strategies](filter-strategies.md) for all replacement options.
4960

50-
The name of the policy is `email-and-phone-numbers`. Policies can be named anything you like but their names must be unique from all other policies. As a best practice, the policy should be saved as `[name].json`, e.g. `email-and-phone-numbers.json`.
61+
The name of the policy is `email-and-phone-numbers`. Policies can be named anything you like but their names must be
62+
unique from all other policies. As a best practice, the policy should be saved as `[name].json`, e.g.
63+
`email-and-phone-numbers.json`.
5164

5265
### Applying a Policy to Text
5366

54-
To use this policy we will save it as `/opt/Phileas/profiles/email-and-phone-numbers.json`. We must restart Phileas for the new profile to be available for use. To apply the policy we will pass the policy's name to Phileas when making a filter request, as shown in the example request below.
67+
To use this policy we will save it as `/opt/Phileas/profiles/email-and-phone-numbers.json`. We must restart Phileas for
68+
the new profile to be available for use. To apply the policy we will pass the policy's name to Phileas when making a
69+
filter request, as shown in the example request below.
5570

5671
```
5772
curl -k -X POST "https://localhost:8080/api/filter?c=context&p=email-and-phone-numbers" \
5873
-d @file.txt -H Content-Type "text/plain"
5974
```
6075

61-
In this command, we have provided the parameter `p` along with a value that is the name of the policy we want to use for this request. If we had multiple policies in Phileas we could choose a different policy for this request simply by changing the name given to the parameter `p`. For more details see Phileas’s [API](filtering-api.md).
76+
In this command, we have provided the parameter `p` along with a value that is the name of the policy we want to use for
77+
this request. If we had multiple policies in Phileas we could choose a different policy for this request simply by
78+
changing the name given to the parameter `p`. For more details see Phileas’s [API](filtering-api.md).
6279

63-
Phileas will process the contents of `file.txt` by applying the policy named `email-and-phone-numbers`. As we saw in the policy above, this policy redacts email addresses and phone numbers. Phileas will return the redacted text in response to the API call.
80+
Phileas will process the contents of `file.txt` by applying the policy named `email-and-phone-numbers`. As we saw in the
81+
policy above, this policy redacts email addresses and phone numbers. Phileas will return the redacted text in response
82+
to the API call.
6483

65-
To manipulate the sensitive information by methods other than redaction, see the [Filter Strategies](filter-strategies.md).
84+
To manipulate the sensitive information by methods other than redaction, see
85+
the [Filter Strategies](filter-strategies.md).

0 commit comments

Comments
 (0)