|
| 1 | +# Dynamic Data Masking |
| 2 | + |
| 3 | +Docs: https://www.bytebase.com/docs/security/data-masking/overview/ |
| 4 | + |
| 5 | +## Workspace-level policies and settings |
| 6 | + |
| 7 | +### Global masking rule |
| 8 | + |
| 9 | +Docs: https://www.bytebase.com/docs/security/data-masking/global-masking-rule/ |
| 10 | + |
| 11 | +API: https://api.bytebase.com/#tag/orgpolicyservice/PATCH/v1/policies/{policy} |
| 12 | + |
| 13 | +```bash |
| 14 | +curl --request PATCH "${bytebase_url}/v1/policies/masking_rule?allow_missing=true&update_mask=payload" \ |
| 15 | + --header 'Authorization: Bearer '${bytebase_token} \ |
| 16 | + --data @global-masking-rule.json |
| 17 | +``` |
| 18 | + |
| 19 | +### Data classification |
| 20 | + |
| 21 | +Docs: https://www.bytebase.com/docs/security/data-masking/data-classification/ |
| 22 | + |
| 23 | +API: https://api.bytebase.com/#tag/settingservice/PATCH/v1/settings/{setting} |
| 24 | + |
| 25 | +```bash |
| 26 | +curl --request PATCH ${bytebase_url}/v1/settings/bb.workspace.data-classification \ |
| 27 | + --header 'Authorization: Bearer '${bytebase_token} \ |
| 28 | + --data @data-classification.json |
| 29 | +``` |
| 30 | + |
| 31 | +### Masking algorithm |
| 32 | + |
| 33 | +Docs: https://www.bytebase.com/docs/security/data-masking/masking-algorithm/ |
| 34 | + |
| 35 | +API: https://api.bytebase.com/#tag/settingservice/PATCH/v1/settings/{setting} |
| 36 | + |
| 37 | +```bash |
| 38 | +curl --request PATCH ${bytebase_url}/v1/settings/bb.workspace.masking-algorithm \ |
| 39 | + --header 'Authorization: Bearer '${bytebase_token} \ |
| 40 | + --data @masking-algorithm.json |
| 41 | +``` |
| 42 | + |
| 43 | +### Semantic type |
| 44 | + |
| 45 | +Docs: https://www.bytebase.com/docs/security/data-masking/semantic-types/ |
| 46 | + |
| 47 | +API: https://api.bytebase.com/#tag/settingservice/PATCH/v1/settings/{setting} |
| 48 | + |
| 49 | +```bash |
| 50 | +curl --request PATCH ${bytebase_url}/v1/settings/bb.workspace.semantic-types \ |
| 51 | + --header 'Authorization: Bearer '${bytebase_token} \ |
| 52 | + --data @semantic-type.json |
| 53 | +``` |
| 54 | + |
| 55 | +## Project-level masking exception |
| 56 | + |
| 57 | +Project-level masking exception to overrule the workspace-level setting. |
| 58 | + |
| 59 | +https://github.com/bytebase/api-example/tree/main/data-security/masking/projects/project-sample |
| 60 | + |
| 61 | +## Schema configuration |
| 62 | + |
| 63 | +Configure metadata such as masking level, classification, semantic type at the table/column level. |
| 64 | + |
| 65 | +https://github.com/bytebase/api-example/tree/main/data-security/masking/databases |
0 commit comments