Search in sources :

Example 1 with AccountTelemetryConfig

use of com.sequenceiq.environment.configuration.telemetry.AccountTelemetryConfig in project cloudbreak by hortonworks.

the class AccountTelemetryServiceTest method createAccountTelemetryConfig.

private AccountTelemetryConfig createAccountTelemetryConfig() {
    AccountTelemetryConfig config = new AccountTelemetryConfig();
    List<AnonymizationRule> defaultRules = new ArrayList<>();
    defaultRules.add(createRule("\\b([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-\\._]*[A-Za-z0-9])@(([A-Za-z0-9]|" + "[A-Za-z][A-Za-z0-9\\-]*[A-Za-z0-9])\\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])\\b", "email@redacted.host"));
    defaultRules.add(createRule("\\d{4}[^\\w]\\d{4}[^\\w]\\d{4}[^\\w]\\d{4}", "XXXX-XXXX-XXXX-XXXX"));
    defaultRules.add(createRule("\\d{3}[^\\w]\\d{2}[^\\w]\\d{4}", "XXX-XX-XXXX"));
    defaultRules.add(createRule("FPW\\:\\s+[\\w|\\W].*", "FPW: [REDACTED]"));
    defaultRules.add(createRule("cdpHashedPassword=.*[']", "[CDP PWD ATTRS REDACTED]"));
    config.setRules(defaultRules);
    return config;
}
Also used : AnonymizationRule(com.sequenceiq.common.api.telemetry.model.AnonymizationRule) AccountTelemetryConfig(com.sequenceiq.environment.configuration.telemetry.AccountTelemetryConfig) ArrayList(java.util.ArrayList)

Aggregations

AnonymizationRule (com.sequenceiq.common.api.telemetry.model.AnonymizationRule)1 AccountTelemetryConfig (com.sequenceiq.environment.configuration.telemetry.AccountTelemetryConfig)1 ArrayList (java.util.ArrayList)1