对敏感配置文件信息进行混淆处理
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
连接器 SDK 包含 SensitiveDataCodec
功能,可让您对配置文件中的信息进行编码和解码。要对配置文件中的敏感信息进行模糊处理,请执行以下操作:
使用 -DsecurityLevel=OBFUSCATED
和 com.google.enterprise.cloudsearch.sdk.config.SensitiveDataCodec
参数运行连接器。
此命令会请求获取配置文件中的敏感配置参数,例如包含数据源密码的 sharepoint.password
参数。
java -DsecurityLevel=OBFUSCATED -cp google-cloudsearch-csv-connector-v1-0.0.5.jar com.google.enterprise.cloudsearch.sdk.config.SensitiveDataCodec
此命令会输出经过混淆处理的值(类似于 obf:Pm1saUwfSUJb5sPblTjPUw==
)。
在配置文件中,添加模糊处理值代替敏感字符串。例如:
sharepoint.password=obf:Pm1saUwfSUJb5sPblTjPUw==
您还可以将密钥对与您从 Java 密钥库选择的密钥配合使用。例如:
java -DsecurityLevel=ENCRYPTED -Djavax.net.ssl.keyStore=encryptKeyStore.jks -Djavax.net.ssl.keyStorePassword=testtest -Djavax.net.ssl.keyStoreType=JKS -Dalias=testkeypair -cp google-cloudsearch-csv-connector-v1-0.0.5.jar com.google.enterprise.cloudsearch.sdk.config.SensitiveDataCodec
如果您使用的是自己的密钥,则必须在运行连接器时传递类似的参数。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Obfuscate sensitive configuration file information\n\nThe connector SDK contains `SensitiveDataCodec` functionality allowing you to\nencode and decode information your configuration file. To obfuscate\nsensitive information in your configuration file:\n\n1. Run your connector with the `-DsecurityLevel=OBFUSCATED` and\n `com.google.enterprise.cloudsearch.sdk.config.SensitiveDataCodec` parameters.\n This command requests the sensitive configuration parameter in your\n configuration file, such as a `sharepoint.password` parameter containing a\n password to a data source.\n\n java -DsecurityLevel=OBFUSCATED -cp google-cloudsearch-csv-connector-v1-0.0.5.jar com.google.enterprise.cloudsearch.sdk.config.SensitiveDataCodec\n\n This command outputs an obfuscated value similar to `obf:Pm1saUwfSUJb5sPblTjPUw==`.\n2. In your configuration file, add the obfuscated value in place of the\n sensitive string. For example:\n\n sharepoint.password=obf:Pm1saUwfSUJb5sPblTjPUw==\n\nYou can also use a key pair with your own keys from Java Keystore. For example: \n\n java -DsecurityLevel=ENCRYPTED -Djavax.net.ssl.keyStore=encryptKeyStore.jks -Djavax.net.ssl.keyStorePassword=testtest -Djavax.net.ssl.keyStoreType=JKS -Dalias=testkeypair -cp google-cloudsearch-csv-connector-v1-0.0.5.jar com.google.enterprise.cloudsearch.sdk.config.SensitiveDataCodec\n\nIf you are using your own keys, you must pass similar parameters while\nrunning your connector."]]