以下 DLP 策略通常用于保护上传和下载文件中的敏感数据。它们是使用 DLP Profile 选择器构建的 Gateway HTTP 策略。
在使用这些策略之前,请先完成扫描 HTTP 流量的前提条件。
当您想要在执行阻止之前监控敏感数据的流向时,请使用 Allow(允许) 操作。在 Gateway HTTP 策略中,所有匹配项(包括 Allow)都会记录在您的 HTTP 请求日志中。这使您能够在不中断用户的情况下掌握敏感数据传输的情况。
以下示例在用户与文件共享应用程序交互时,记录与您启用的 Financial Information(财务信息) DLP 配置式条目匹配的任何上传或下载。
| 选择器 | 运算符 | 值 | 逻辑 | 操作 |
|---|---|---|---|---|
| DLP Profile(DLP 配置文件) | in(属于) | Financial Information(财务信息) | And(与) | Allow(允许) |
| Content Categories(内容类别) | in(属于) | File Sharing(文件共享) |
根据文件类型阻止文件上传或下载。
| 选择器 | 运算符 | 值 | 逻辑 | 操作 |
|---|---|---|---|---|
| 上传文件类型 (Upload File Types) | in(属于) | Microsoft Office Word 文档 (docx) | 且 (And) | 阻止 (Block) |
| 下载文件类型 (Download File Types) | in(属于) | PDF (pdf) |
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rules" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"name": "Block file types",
"description": "Block the upload or download of files based on their type",
"enabled": true,
"action": "block",
"filters": [
"http"
],
"traffic": "any(http.upload.file.types[*] in {\"docx\"}) and any(http.download.file.types[*] in {\"pdf\"})",
"identity": "",
"device_posture": ""
}'有关 DLP 可以扫描的文件格式的更多信息,请参阅受支持的文件类型。
您可以通过向策略添加基于身份的条件来配置基于单个用户或组的访问权限。这些选择器与来自您配置的身份提供程序的用户属性进行匹配。
以下示例仅阻止合同工(contractor)向文件共享应用上传/从文件共享应用下载 Financial Information。不在 Contractors 组中的用户不受此策略影响。
| 选择器 | 运算符 | 值 | 逻辑 | 操作 |
|---|---|---|---|---|
| DLP Profile(DLP 配置文件) | in(属于) | Financial Information(财务信息) | And(与) | Block(阻止) |
| Content Categories(内容类别) | in(属于) | File Sharing(文件共享) | And(与) | |
| User Group Names(用户组名称) | in(属于) | Contractors(合同工) |
许多 Android 应用程序(例如 Google Drive)使用 证书固定(certificate pinning),这与 Gateway TLS 解密不兼容。这些应用程序会验证它们是否直接连接到自己的服务器,并会拒绝 Gateway 的检测证书。如果需要,您可以创建 Do Not Inspect(不检查)策略,以便该应用程序可以在 Android 上继续运行:
-
设置检查 Android 操作系统的 OS 版本设备姿态检查。
-
在 Gateway 中创建以下 HTTP 策略:
选择器 运算符 值 逻辑 操作 Application(应用) in(属于) Google Drive And(与) Do Not Inspect(不检查) Passed Device Posture Checks(已通过设备姿态检查) in(属于) OS Version Android(Android 操作系统版本)
Android 用户现在可以使用该应用,但该应用流量将完全绕过 Gateway 检测 — 包括 DLP 扫描、HTTP 日志记录和防病毒扫描。
在您的 DLP 日志中,您可能会发现某些站点经常触发不代表实际数据泄露的 DLP 检测(误报)。要免除这些站点的 DLP 扫描:
-
创建主机名或 URL 列表。
-
使用
not in list(不在列表中)运算符从您的 DLP 策略中排除该列表,该运算符引用您在步骤 1 中创建的列表:选择器 运算符 值 逻辑 操作 DLP Profile(DLP 配置文件) in(属于) Financial Information(财务信息) And(与) Block(阻止) Application(应用) in(属于) Google Drive And(与) Domain(域) not in list(不在列表中) Do not DLP - SSN