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: content/docs/tutorials/github-action-data-masking-part1.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ By using GitHub Actions with Bytebase API, you can implement policy-as-code to a
20
20
This is Part 1 of our tutorial series on implementing automated database masking using GitHub Actions:
21
21
22
22
- Part 1: Column masking and masking exception with GitHub Actions (this one)
23
-
- Part 2: Masking Algorithm with GitHub Actions
24
-
- Part 3: Data Classification and Global Masking with GitHub Actions
23
+
- Part 2: [Masking Algorithm with GitHub Actions](/docs/tutorials/github-action-data-masking-part2)
24
+
- Part 3: [Data Classification and Global Masking with GitHub Actions](/docs/tutorials/github-action-data-masking-part3)
25
25
26
26
## Overview
27
27
@@ -102,7 +102,7 @@ In the GitHub workflow, find the step `Apply column masking`, which will apply t
102
102
--data @"$CHANGED_FILE")
103
103
```
104
104
105
-
By changing the files`masking/databases/**/**/column-masking.json`, create a PR and then merge, the change will be applied to the database.
105
+
By changing file`masking/databases/**/**/column-masking.json`, create a PR and then merge, the change will be applied to the database.
106
106
107
107
Log in Bytebase console, at the workspace level, click **Data Access > Data Masking**. Click **Explicit Masked Columns**, you can see the column masking is applied to the database.
108
108
@@ -121,7 +121,7 @@ In the GitHub workflow, find the step `Apply masking exception`, which will appl
121
121
--data @"$CHANGED_FILE")
122
122
```
123
123
124
-
By changing the files`masking/projects/**/masking-exception.json`, create a PR and then merge, the change will be applied to the database.
124
+
By changing file`masking/projects/**/masking-exception.json`, create a PR and then merge, the change will be applied to the database.
125
125
126
126
Log in Bytebase console, go to the project `Sample Project`, click **Database > Masking Access**, you can see the masking exception is applied to the database.
Copy file name to clipboardExpand all lines: content/docs/tutorials/github-action-data-masking-part2.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ In the [previous tutorial](/docs/tutorials/github-action-data-masking-part1), yo
18
18
This is Part 2 of our tutorial series on implementing automated database masking using GitHub Actions:
19
19
20
20
- Part 1: [Column masking and masking exception with GitHub Actions](/docs/tutorials/github-action-data-masking-part1)
21
-
- Part 2: Masking Algorithm with GitHub Actions(this one)
22
-
- Part 3: Data Classification and Global Masking with GitHub Actions
21
+
- Part 2: Masking Algorithm with GitHub Actions(this one)
22
+
- Part 3: [Data Classification and Global Masking with GitHub Actions](/docs/tutorials/github-action-data-masking-part3)
23
23
24
24
## Overview
25
25
@@ -36,16 +36,20 @@ The complete code for this tutorial is available at: [database-security-github-a
36
36
37
37
</HintBlock>
38
38
39
-
This tutorial skips the setup part, if you haven't set up the Bytebase and GitHub Action, please refer to the [previous tutorial](/docs/tutorials/github-action-data-masking-part1).
39
+
This tutorial skips the setup part, if you haven't set up the Bytebase and GitHub Action, please follow **Setup Instructions** section in the [previous tutorial](/docs/tutorials/github-action-data-masking-part1).
40
40
41
41
## Masking Algorithm
42
42
43
43
You may customize your own [data masking algorithm](/docs/security/data-masking/masking-algorithm/) with the help of a predefined masking type, such as Full mask, Range mask, MD5 mask and Inner/Outer mask.
44
44
45
-
In Bytebase console, go to **Data Access > Data Masking**, click **Masking Algorithm** and click **Add**. You can create a new masking algorithm with a name and description, and later it can be used in the definition of semantic types.
45
+
### In Bytebase console
46
+
47
+
Go to **Data Access > Data Masking**, click **Masking Algorithm** and click **Add**. You can create a new masking algorithm with a name and description, and later it can be used in the definition of semantic types.
In the GitHub workflow `bb-masking-2.yml`, find the step `Apply masking algorithm`, which will apply the masking algorithm to the database via API. All the masking algorithms should be defined in one file in the root directory of `masking/masking-algorithm.json`. The code it calls Bytebase API is as follows:
By changing file `masking/masking-algorithm.json`, you can apply the masking algorithm to the database. Go to Bytebase console, click **Data Access > Data Masking**, go to **Masking Algorithm** page, you can see the masking algorithm is applied to the database.
63
+
58
64
## Semantic Type
59
65
60
66
You may define [semantic types](/docs/security/data-masking/semantic-types/) and apply them to columns of different tables. Columns with the same semantic type will be masked with the same masking algorithm. For example, you may define a semantic type `mobile` and apply it to all the columns of phone number. Then you can define a masking algorithm `range 4-10` for the partial level masking for semantic type `mobile`.
61
67
62
-
In Bytebase console, go to **Data Access > Data Masking**, click **Semantic Types** and click **Add**. You can create a new semantic type with a name and description, and select the masking algorithm.
68
+
### In Bytebase Console
69
+
70
+
Go to **Data Access > Data Masking**, click **Semantic Types** and click **Add**. You can create a new semantic type with a name and description, and select the masking algorithm.
In the GitHub workflow, find the step `Apply semantic type`, which will apply the semantic type to the database via API. All the masking algorithms should be defined in one file in the root directory as `masking/semantic-type.json`. The code it calls Bytebase API is as follows:
74
+
### In GitHub Workflow
75
+
76
+
Find the step `Apply semantic type`, which will apply the semantic type to the database via API. All the masking algorithms should be defined in one file in the root directory as `masking/semantic-type.json`. The code it calls Bytebase API is as follows:
By changing file `masking/semantic-type.json`, you can apply the semantic type to the database. Go to Bytebase console, click **Data Access > Data Masking**, go to **Semantic Types** page, you can see the semantic type is applied to the database.
86
+
75
87
## Next Steps
76
88
77
89
Now you have successfully applied data masking algorithm and semantic type using GitHub Actions and Bytebase API. In the next part of this tutorial, you'll learn how to use data classification and global masking with GitHub Actions. Stay tuned!
In the [previous tutorial](/docs/tutorials/github-action-data-masking-part2), you learned how to customize both the masking algorithm and semantic types. In this tutorial, we will explore how to use data classification and global masking policy.
15
+
16
+
---
17
+
18
+
This is Part 3 of our tutorial series on implementing automated database masking using GitHub Actions:
19
+
20
+
- Part 1: [Column masking and masking exception with GitHub Actions](/docs/tutorials/github-action-data-masking-part1)
21
+
- Part 2: [Masking Algorithm with GitHub Actions](/docs/tutorials/github-action-data-masking-part2)
22
+
- Part 3: Data Classification and Global Masking with GitHub Actions(this one)
23
+
24
+
## Overview
25
+
26
+
In this tutorial, you'll learn how to automate data classification and global masking policy using GitHub Actions and the Bytebase API. This integration allows you to:
27
+
28
+
- Manage data classification and global masking policy as code
29
+
- Automatically apply masking policies when PRs are merged
30
+
31
+
<HintBlocktype="info">
32
+
33
+
The complete code for this tutorial is available at: [database-security-github-actions-example](https://github.com/bytebase/database-security-github-actions-example)
34
+
35
+
</HintBlock>
36
+
37
+
This tutorial skips the setup part, if you haven't set up the Bytebase and GitHub Action, please follow **Setup Instructions** section in the [previous tutorial](/docs/tutorials/github-action-data-masking-part1).
Find the step `Apply classification`, which will apply the classification to the database via API. All the classifications should be defined in one file in the root directory as `masking/classification.json`. The code it calls Bytebase API is as follows:
By changing file `masking/classification.json`, creating a PR and merging, you can apply the classification to the database. Go to Bytebase console, click **Data Access > Data Classification**, go to **Classification** page, you can see the classification is applied to the database.
Find the step `Apply global masking rule`, which will apply the global masking rule to the database via API. All the global masking rules should be defined in one file in the root directory as `masking/global-masking-rule.json`. The code it calls Bytebase API is as follows:
By changing file `masking/global-masking-rule.json`, creating a PR and merge, you can apply the global masking rule to the database. Go to Bytebase console, click **Data Access > Data Masking**, go to **Global Masking Rule** page, you can see the global masking rule is applied to the database.
76
+
77
+
## Summary
78
+
79
+
Through out this tutorial series, you have learned how to automate database masking policies, customize both the masking algorithm and semantic types, and use data classification and global masking policy using GitHub Actions and Bytebase API.
0 commit comments