为敏感数据创建自定义类别

如果没有能够检测您特定领域敏感数据的 原生语义类别,您可以为您的敏感数据创建一个自定义类别。

通过定义自定义分类器来实现自定义语义类别。自定义分类器具有以下属性:

  • 识别数据类型的自定义语义类别;例如 medical_codeemployee_id

  • Snowflake 算法用于检测您的敏感数据的正则表达式。

  • 预定义的隐私类别之一。

工作原理

Snowflake provides the CUSTOM_CLASSIFIER class in the SNOWFLAKE.DATA_PRIVACY schema to enable data engineers to extend their data classification capabilities based on their own knowledge of their data. After you create an instance of the class, you can call a method on the instance to define your custom semantic category, specify the privacy category, and specify regular expressions to match column value patterns while optionally matching the column name.

重要

敏感数据分类存储的是自定义分类器的定义,而不是引用。如果更改自定义分类器,必须使用 SET_CUSTOM_CLASSIFIERS 方法将分类配置文件更新为新的定义。

有关使用 CUSTOM_CLASSIFIER 类创建和使用自定义分类器的示例,请参阅 示例

注意事项

Choose a warehouse that matches the size of the data you are classifying:

  • 无需担心处理时间:超小型仓库。

  • 表中最多有 100 列:小型仓库。

  • 表中有 101 到 300 列:中型仓库。

  • 表中有超过 300 列:大型仓库。

Threshold for custom categories

用于对自定义类别进行分类的算法使用 评分规则 来评估自定义分类器的正则表达式,以确定要推荐哪个语义类别。

The scoring rule uses a default threshold value of 0.8, which equates to high confidence in terms of what the recommended category should be. Eighty percent of the data in the sample must match the regular expressions that you add to the instance. The algorithm compares the score for a column against the threshold value and recommends a category that corresponds to one of the following:

  • 非国际系统标签

  • 国际系统标签

  • Custom classifier tag

您可以对实例调用 custom_classifier!ADD_REGEX 方法,来指定自定义分类实例的阈值。

备注

两个自定义分类器的分数可能会相同。在这种情况下,可通过评估以下内容来解决分数相同的问题:

  • 各自自定义类别之间的匹配百分比。

  • 自定义类别名称之间的字母顺序。

在这种情况下,获胜类别将成为推荐类别,其余类别将成为备选类别。

下表汇总了评分算法和推荐标签:

提供的名称匹配器

值匹配 >= 阈值

名称匹配

建议

True

True

True

自定义类别

False

True

Snowflake 类别

True

False

Snowflake 类别

False

False

Snowflake 类别

False

True

不适用

自定义类别

False

不适用

Snowflake 类别

复制和克隆

  • 复制数据库时,也将复制 CUSTOM_CLASSIFIER 类的实例。

  • 克隆包含实例的架构时,也将克隆 CUSTOM_CLASSIFIER 类的实例。

语言: 中文