Potential DGA Activity

A population analysis machine learning job detected potential DGA (domain generation algorithm) activity. Such activity is often used by malware command and control (C2) channels. This machine learning job looks for a source IP address making DNS requests that have an aggregate high probability of being DGA activity.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/09/14"
 3integration = ["dga", "endpoint", "network_traffic"]
 4maturity = "production"
 5min_stack_comments = "DGA package job ID and rule removal updates"
 6min_stack_version = "8.9.0"
 7updated_date = "2023/12/12"
 8
 9[rule]
10anomaly_threshold = 70
11author = ["Elastic"]
12description = """
13A population analysis machine learning job detected potential DGA (domain generation algorithm) activity. Such activity
14is often used by malware command and control (C2) channels. This machine learning job looks for a source IP address
15making DNS requests that have an aggregate high probability of being DGA activity.
16"""
17from = "now-45m"
18interval = "15m"
19license = "Elastic License v2"
20machine_learning_job_id = "dga_high_sum_probability"
21name = "Potential DGA Activity"
22setup = """## Setup
23
24The rule requires the Domain Generation Algorithm (DGA) Detection integration assets to be installed, as well as DNS events collected by integrations such as Elastic Defend, Network Packet Capture, or Packetbeat.  
25
26### DGA Detection Setup
27The DGA Detection integration consists of an ML-based framework to detect DGA activity in DNS events.
28
29#### Prerequisite Requirements:
30- Fleet is required for DGA Detection.
31- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
32- DNS events collected by the [Elastic Defend](https://docs.elastic.co/en/integrations/endpoint), [Network Packet Capture](https://docs.elastic.co/integrations/network_traffic) integration, or [Packetbeat](https://www.elastic.co/guide/en/beats/packetbeat/current/packetbeat-overview.html).
33- To install Elastic Defend, refer to the [documentation](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
34- To add the Network Packet Capture integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.
35- To set up and run Packetbeat, follow [this](https://www.elastic.co/guide/en/beats/packetbeat/current/setting-up-and-running.html) guide.
36
37#### The following steps should be executed to install assets associated with the DGA Detection integration:
38- Go to the Kibana homepage. Under Management, click Integrations.
39- In the query bar, search for Domain Generation Algorithm Detection and select the integration to see more details about it.
40- Under Settings, click Install Domain Generation Algorithm Detection assets and follow the prompts to install the assets.
41
42#### Ingest Pipeline Setup
43Before you can enable this rule, you'll need to enrich DNS events with predictions from the Supervised DGA Detection model. This is done via the ingest pipeline named `<package_version>-ml_dga_ingest_pipeline` installed with the DGA Detection package.
44- If using an Elastic Beat such as Packetbeat, add the DGA ingest pipeline to it by adding a simple configuration [setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html#pipelines-for-beats) to `packetbeat.yml`.
45- If adding the DGA ingest pipeline to an existing pipeline, use a [pipeline processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/pipeline-processor.html).
46
47#### Adding Custom Mappings
48- Go to the Kibana homepage. Under Management, click Stack Management.
49- Under Data click Index Management and navigate to the Component Templates tab.
50- Templates that can be edited to add custom components will be marked with a @custom suffix. Edit the @custom component template corresponding to the beat/integration you added the DGA ingest pipeline to, by pasting the following JSON blob in the "Load JSON" flyout:

{ "properties": { "ml_is_dga": { "properties": { "malicious_prediction": { "type": "long" }, "malicious_probability": { "type": "float" } } } } }

 1
 2### Anomaly Detection Setup
 3Before you can enable this rule, you'll need to enable the corresponding Anomaly Detection job. 
 4- Go to the Kibana homepage. Under Analytics, click Machine Learning.
 5- Under Anomaly Detection, click Jobs, and then click "Create job". Select the Data View containing your enriched DNS events. For example, this would be `logs-endpoint.events.*` if you used Elastic Defend to collect events, or `logs-network_traffic.*` if you used Network Packet Capture.
 6- If the selected Data View contains events that match the query in [this](https://github.com/elastic/integrations/blob/main/packages/dga/kibana/ml_module/dga-ml.json) configuration file, you will see a card for DGA under "Use preconfigured jobs".
 7- Keep the default settings and click "Create jobs" to start the anomaly detection job and datafeed.
 8"""
 9references = [
10    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
11    "https://docs.elastic.co/en/integrations/dga",
12    "https://www.elastic.co/security-labs/detect-domain-generation-algorithm-activity-with-new-kibana-integration",
13]
14risk_score = 21
15rule_id = "ff0d807d-869b-4a0d-a493-52bc46d2f1b1"
16severity = "low"
17tags = [
18    "Use Case: Domain Generation Algorithm Detection",
19    "Rule Type: ML",
20    "Rule Type: Machine Learning",
21    "Tactic: Command and Control",
22]
23type = "machine_learning"
24[[rule.threat]]
25framework = "MITRE ATT&CK"
26[[rule.threat.technique]]
27id = "T1568"
28name = "Dynamic Resolution"
29reference = "https://attack.mitre.org/techniques/T1568/"
30
31
32[rule.threat.tactic]
33id = "TA0011"
34name = "Command and Control"
35reference = "https://attack.mitre.org/tactics/TA0011/"

References

Related rules

to-top