이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다. 현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.
이용 가능:
Logs|Traces
Overview
The Sensitive Data Scanner processor scans logs or Contact your account manager to request access. to detect and redact or hash sensitive information such as PII, PCI, and custom sensitive data. You can pick from Datadog’s library of predefined rules, or input custom Regex rules to scan for sensitive data.
You can set up the pipeline and processor in the UI, API, or Terraform.
In the Define rule target and conditions section, select if you want to scan the Entire Event, Specific Attributes, or Exclude Attributes in the dropdown menu.
If you are scanning the entire event, you can optionally exclude specific attributes from getting scanned. Use path notation (outer_key.inner_key) to access nested keys. For specified attributes with nested data, all nested data is excluded.
If you are scanning specific attributes, specify which attributes you want to scan. Use path notation (outer_key.inner_key) to access nested keys. For specified attributes with nested data, all nested data is scanned.
For Define actions on match, select the action you want to take for the matched information. Note: Redaction, partial redaction, and hashing are all irreversible actions.
Redact: Replaces all matching values with the text you specify in the Replacement text field.
Partially Redact: Replaces a specified portion of all matched data. In the Redact section, specify the number of characters you want to redact and which part of the matched data to redact.
Hash: Replaces all matched data with a unique identifier. The UTF-8 bytes of the match are hashed with the 64-bit fingerprint of FarmHash.
Optionally, click Add Field to add tags you want to associate with the matched events.
Add a name for the scanning rule.
Optionally, add a description for the rule.
Click Save.
Add additional keywords
After adding scanning rules from the library, you can edit each rule separately and add additional keywords to the keyword dictionary.
In the Sensitive Data Scanner processor with the rule you want to edit, click Manage Scanning Rules.
Toggle Use recommended keywords if you want the rule to use them. Otherwise, add your own keywords to the Create keyword dictionary field. You can also require that these keywords be within a specified number of characters of a match. By default, keywords must be within 30 characters before a matched value.
Click Update.
In the Define match conditions section, specify the regex pattern to use for matching against events in the Define the regex field. See Writing Effective Grok Parsing Rules with Regular Expressions for more information.
Sensitive Data Scanner supports Perl Compatible Regular Expressions (PCRE), but the following patterns are not supported:
Backreferences and capturing sub-expressions (lookarounds)
Arbitrary zero-width assertions
Subroutine references and recursive patterns
Conditional patterns
Backtracking control verbs
The \C “single-byte” directive (which breaks UTF-8 sequences)
The \R newline match
The \K start of match reset directive
Callouts and embedded code
Atomic grouping and possessive quantifiers
Enter sample data in the Add sample data field to verify that your regex pattern is valid.
For Create keyword dictionary, add keywords to refine detection accuracy when matching regex conditions. For example, if you are scanning for a sixteen-digit Visa credit card number, you can add keywords like visa, credit, and card. You can also require that these keywords be within a specified number of characters of a match. By default, keywords must be within 30 characters before a matched value.
In the Define rule target and conditions section, select if you want to scan the Entire Event, Specific Attributes, or Exclude Attributes in the dropdown menu.
If you are scanning the entire event, you can optionally exclude specific attributes from getting scanned. Use path notation (outer_key.inner_key) to access nested keys. For specified attributes with nested data, all nested data is excluded.
If you are scanning specific attributes, specify which attributes you want to scan. Use path notation (outer_key.inner_key) to access nested keys. For specified attributes with nested data, all nested data is scanned.
For Define actions on match, select the action you want to take for the matched information. Note: Redaction, partial redaction, and hashing are all irreversible actions.
Redact: Replaces all matching values with the text you specify in the Replacement text field.
Partially Redact: Replaces a specified portion of all matched data. In the Redact section, specify the number of characters you want to redact and which part of the matched data to redact.
Hash: Replaces all matched data with a unique identifier. The UTF-8 bytes of the match is hashed with the 64-bit fingerprint of FarmHash.
Optionally, click Add Field to add tags you want to associate with the matched events.
Use outer_key.inner_key to reference the key with the value inner_value.
Use outer_key.a.double_inner_key to reference the key with the value double_inner_value.
To specify a nested field with a literal . in the attribute key, wrap the key in escaped quotes in the search query. For example, the search query "service.status":disabled matches the event {"service.status": "disabled"}.
Set up the processor using Terraform
You can use the Datadog Observability Pipeline Terraform resource to set up a pipeline with the Sensitive Data Scanner processor. To add a rule to the Sensitive Data Scanner processor using Terraform:
Repeat steps 1 and 2 for all library rules you want to add.
Full configuration example
If you want to use the Sensitive Data Scanner processor to scan for AWS Access Key IDs and US Social Security Numbers, and redact them by replacing them with the string ***:
In your Datadog Observability Pipeline resource’s Sensitive Data Scanner processor, use the Sensitive Data Scanner rules defined in the data sources.
data"datadog_sensitive_data_scanner_standard_pattern""aws_access_key"{filter="AWS Access Key ID Scanner"}data"datadog_sensitive_data_scanner_standard_pattern""us_ssn"{filter="US Social Security Number Scanner"}resource"datadog_observability_pipeline""sensitive_data_pipeline"{name="Sensitive Data Pipeline"config{source{id="source-0"datadog_agent{}}processor_group{display_name="Processors"enabled=trueid="group-0"include="*"inputs=["source-0"]processor{display_name="Sensitive Data Scanner"enabled=trueid="processor-sds-0"include="*"sensitive_data_scanner{rule{name="Redact AWS Access Key IDs"tags=[]on_match{redact{replace="***"}}pattern{library{id=data.datadog_sensitive_data_scanner_standard_pattern.aws_access_key.iduse_recommended_keywords=true}}scope{all=true}}rule{name="Redact US SSNs"tags=[]on_match{redact{replace="***"}}pattern{library{id=data.datadog_sensitive_data_scanner_standard_pattern.us_ssn.iduse_recommended_keywords=true}}scope{all=true}}}}}destination{id="destination-0"inputs=["group-0"]datadog_logs{}}}}
Best practices to optimize performance
The Sensitive Data Scanner processor is CPU intensive. Use the following best practices to optimize performance.
View scanning rule usage with the Observability Pipelines Overview dashboard
Observability Pipelines includes an out-of-the-box Observability Pipelines Overview dashboard with a Sensitive data found by Observability Pipelines section. Use the widgets in that section to see which scanning rules are matching data.
Use the template variables (pipeline_id, host, worker_uuid, component_type, component_kind, component_id) at the top of the dashboard to scope the view to a specific pipeline or Worker.
Use the time selector to scope to a wider time frame.
Use the following widgets to evaluate your Sensitive Data Scanner processors’ scanning rule usage:
Logs containing sensitive data per scanning rule: Lists each rule by name (for example, visa_card_scanner_1x16_1x19_digits or redact_ipv4) with the number of matches over the selected time frame. Rules with high counts are actively matching data. This is the primary widget to see which rules are in use.
Total count of logs containing sensitive data: Shows the total volume of sensitive data matched across all rules.
Logs containing sensitive data by Pipeline: Shows matching logs that contain sensitive data. You can scope matches down by pipeline_id, which helps you see whether logs containing sensitive data is found in all pipelines or only in specific pipelines.
Logs containing sensitive data per host: Breaks down sensitive data matches by Worker host. Use this widget to confirm coverage across your deployment.
Patterns containing sensitive information and List of logs containing sensitive data: Shows the log patterns and sample events where sensitive data was found.
After you identify rules with no matches over a representative time frame, confirm they are not needed and remove them. See Delete a rule.
Note: A rule with zero matches means the rule did not match in the selected time frame, not that the rule is invalid.
Only enable rules you need
Rules that are enabled but not used consume unnecessary resources. Check the Sensitive Data Scanner processor to view how many matches each rule has had over the past 24 hours.
Only scan the events and fields that need to be scanned for sensitive data
The time it takes the Sensitive Data Scanner to scan an event roughly scales with the size of the event. To optimize processor performance:
If you know the types of events you want to scan, define a processor query that only sends the events you want to the processor.
Reduce scanning time by targeting specific event attributes for scanning or excluding event attributes from being scanned. See the Define rule target and conditions step in Set up the processor.
Evaluate and benchmark performance optimizations
Use the pipelines.component_latency_seconds metric to:
Benchmark processor performance when you add a rule
Evaluate performance after making optimization changes, such as reducing the number of fields being scanned and removing unused rules
To view the pipelines.component_latency_seconds metric:
In the metric field, enter pipelines.component_latency_seconds.
In the from field, enter the tag component_id:<COMPONENT_ID>, where <COMPONENT_ID> is the ID for your Sensitive Data Scanner processor.
Note: pipelines.component_latency_seconds is a distribution metric so you must enable percentiles for that metric. See Enabling advanced query functionality for instructions.
Use the component_id tag to filter or group by individual components.
The component_type tag is sensitive_data_scanner for Sensitive Data Scanner processor metrics.
pipelines.sds_rule_matched_total
Description: The number of events that matched a Sensitive Data Scanner rule. Tagged with the matching rule name.
Metric type: count
pipelines.scanned_events
Description: The number of events scanned by the Sensitive Data Scanner engine.
Metric type: count
pipelines.scanning.match_count
Description: The number of matches found by the Sensitive Data Scanner.
Metric type: count
pipelines.scanning.suppressed_match_count
Description: The number of matches suppressed by the Sensitive Data Scanner.
Metric type: count
pipelines.scanning.duration
Description: Accumulated wall-clock time, in seconds, spent scanning events. Use this metric to benchmark processor performance and evaluate optimizations.
Metric type: count
pipelines.scanning.cpu_duration
Description: Accumulated CPU time, in seconds, spent scanning events.
Metric type: count
pipelines.scanner.total_count
Description: The number of Sensitive Data Scanner processors currently running.
Metric type: gauge
pipelines.scanner.total_regexes
Description: The number of regexes held across all Sensitive Data Scanners.