Data Access¶
Sensitive information may be contained in log data, so for security reasons, even within the same business organization, it is necessary to finely divide data access permissions. The Data Access feature of Guance first sets the data access range for target visitors based on the index of different sources at the member role level. In addition, to further protect data, tools such as regular expressions and desensitization fields can be used to "re-edit" the data on the basis of restricted access, ensuring that sensitive information is properly handled without sacrificing data value.
On the Logs > Data Access page, you can start creating new rules in the following two ways:
Click the Create button in the upper left corner of the page;
If there are historical access rules on the current page, click the icon next to the rule operation to clone the existing rule.
Configuration¶
- Define the name of the current rule;
- Enter a description for the current rule;
-
Select Indexes. The optional range includes log indices within the current workspace (including default log indices, custom indices, and bound external indices) as well as all authorized viewable indices;
-
Define the access range of log data under the current rule;
-
Add fields that need to be desensitized; optional; multiple selections allowed;
-
Use regular expressions to desensitize sensitive information in field content;
-
Select the member roles to which the current access rule can be applied, including default roles within the system and self-built roles; multiple selections allowed;
- You can click the preview in the lower right corner to view the visual display effect of the current data access rule in the explorer;
- Click save.
Config Instructions¶
Range of Data Access¶
Data Range: Members within the access rule can only access the selected field information.
The logical relationship between different fields can be customized to choose Any (OR) or All (AND);
-
Default to All (AND), which supports switching to Any (OR):
-
Logical relationship examples are as follows:
-
Example 1: (Default AND)
- host=[host1,host2] AND service = [service1,service2];
-
Example 2: (Switched to Any OR)
- host=[host1,host2] OR service = [service1,service2].
-
-
Filter values through
Tags/Attributes
, including positive filtering, negative filtering, fuzzy matching, reverse fuzzy matching, existence and non-existence, and other filtering methods.
Desensitization with Regex¶
When setting access rules, even though the data range has been defined, additional measures are still needed to prevent the leakage of sensitive or unnecessary information. At this time, desensitization fields or regular expressions can be used to further process the data to strengthen data protection.
On the configuration page, in addition to directly adding individual desensitization fields, if you need to further desensitize a part of the content in the log message
, such as not displaying token or IP information, you can meet this need by adding regular expressions.
- Configure multiple regular expressions, up to 10 expressions can be configured under one access rule;
- Disable or enabling a regular expression, and subsequent applications and previews will only adapt to the enabled regular expressions for desensitization;
- Directly edit or delete a regular expression here;
- Drag and drop to move the position of the regular expression, and when data matches this desensitization rule, the regular expression is applied in the order from top to bottom for desensitization processing;
- Directly create a new regular expression here:
In the pop-up window, input the required information.
If you check Apply to Rule, the rule will be directly added below the regular expression.
Roles and Query Rights¶
Simple Case¶
Assuming a member only holds one role, such as read-only
, after selecting this role, the system will only desensitize the view for this role.
If you choose the "All" role, all roles except Owner will be affected by desensitization.
Note:
- Default roles have all log data query permissions when data access rules are not configured;
- Based on the foundation of user roles having log data query permissions, log data access rules can take effect;
- After role matching rules, you can only continue to add filters within the range of the rule configuration, and if you query beyond this range, the data will return empty.
Multi-Role Permission¶
If a member has multiple roles (as below) and each role's query permission coverage range is different, the final data query permission of the member will adopt the highest permission under the role.
Multi-Rule Permission¶
In the case of complex and multi-level business data, we need to set multiple access rules to adapt to different data access needs.
- The relationship between multiple filters in one rule: the relationship between multiple values of the same key is OR, and the relationship between different keys is AND;
- The relationship between multiple rules is OR.
So, if:
Rule 1: host = [Host1,Host2] AND service = [Service1,Service2] Rule 2: host = [Host3,Host4] AND source = [Source1,Source2]
A role has both of the above permission rules, the actual data will display Rule 1 OR Rule 2
to achieve a union effect.
The actual data range that can be seen is:
(Host = [Host1,Host2] AND Service = [Service1,Service2]) OR (Host = [Host3,Host4] AND Source = [Source1,Source2])
If a role has multiple permission rules, and Rule 1 includes a desensitization rule, then all data returned under all permission rules will be affected by the desensitization rule.
Config Example¶
- Select the index
default
; - Set the data range to
host:myClient111
andservice:datakit_service
; - We do not set desensitization fields here, directly write the regular expression
tkn_[\da-z]*
, which means encryptingtoken
information; - Finally, assign the current access rule to all
Read-only
members in the current workspace. - Click save. If necessary, you can click Preview in the lower left corner to view the desensitization effect.
The above access rule is for all Read-only
members within the current workspace, who can only access the data with host:myClient111
and service:datakit_service
under the log index default
, and all token
information in this type of data is not visible.
Use Case¶
When data access rules are in effect, members' snapshot data is automatically filtered to match their permissions. If the snapshot includes unauthorized data, it's filtered out, allowing members to view only data they're allowed to access.
List Operations¶
-
View: Directly view the index associated with the rule, data query conditions, desensitization status, and the number of roles and corresponding member numbers.
-
Only display rules related to me:
-
The system defaults to "Off", which means that by default, the list will display all data access rules;
-
After enabling this button, the list will only display data access rules associated with the current account role.
-
-
Enable/Disable Rules: When a rule is disabled, the access query range of log data for different roles is unrestricted, and it is restored when the rule is enabled.
-
Modify the current rule's name, description, bound index, filter conditions, and authorized roles, etc.
- Copy the current rule.
- Audit: That is, the operation records related to this rule.
- Delete the rule.
- Enable, disable and delete multiple rules in batches.