You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/filter_policies/filter_policies.md
+32-12Lines changed: 32 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,33 @@
1
1
# Filter Policies
2
2
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.
4
5
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.
8
11
12
+
> There are [sample policies](sample_filter_policies.md) available for immediate use or customization to fit your
13
+
> use-cases.
9
14
10
15
### The Structure of a Policy
11
16
12
17
A policy:
13
18
14
19
* Must have a `name` that uniquely identifies it.
15
20
* 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.
17
23
* Can have an optional list of [terms](ignore-lists.md) or [patterns](ignoring-patterns.md).
18
24
* Can have encryption keys to support [encryption](filter-strategies.md#fpe) of sensitive information.
19
25
20
26
### An Example Policy
21
27
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.
23
31
24
32
```
25
33
{
@@ -45,21 +53,33 @@ The following is an example policy. In the example below you can see the [types
45
53
}
46
54
```
47
55
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.
49
60
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`.
51
64
52
65
### Applying a Policy to Text
53
66
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.
55
70
56
71
```
57
72
curl -k -X POST "https://localhost:8080/api/filter?c=context&p=email-and-phone-numbers" \
58
73
-d @file.txt -H Content-Type "text/plain"
59
74
```
60
75
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).
62
79
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.
64
83
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
0 commit comments