[metadata]
creation_date = "2020/02/18"
maturity = "production"
updated_date = "2020/11/03"

[rule]
author = ["Elastic"]
description = """
This rule detects when an internal network client sends DNS traffic directly to the Internet. This is atypical behavior
for a managed network, and can be indicative of malware, exfiltration, command and control, or, simply,
misconfiguration. This DNS activity also impacts your organization's ability to provide enterprise monitoring and
logging of DNS, and opens your network to a variety of abuses and malicious communications.
"""
false_positives = [
    """
    Exclude DNS servers from this rule as this is expected behavior. Endpoints usually query local DNS servers defined
    in their DHCP scopes, but this may be overridden if a user configures their endpoint to use a remote DNS server.
    This is uncommon in managed enterprise networks because it could break intranet name resolution when split horizon
    DNS is utilized. Some consumer VPN services and browser plug-ins may send DNS traffic to remote Internet
    destinations. In that case, such devices or networks can be excluded from this rule when this is expected behavior.
    """,
]
index = ["filebeat-*", "packetbeat-*"]
language = "kuery"
license = "Elastic License"
name = "DNS Activity to the Internet"
references = [
    "https://www.us-cert.gov/ncas/alerts/TA15-240A",
    "https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-81-2.pdf",
]
risk_score = 47
rule_id = "6ea71ff0-9e95-475b-9506-2580d1ce6154"
severity = "medium"
tags = ["Elastic", "Network", "Threat Detection", "Command and Control"]
type = "query"

query = '''
event.category:(network or network_traffic) and (event.type:connection or type:dns) and (destination.port:53 or event.dataset:zeek.dns)
  and source.ip:(
    10.0.0.0/8 or
    172.16.0.0/12 or
    192.168.0.0/16
  ) and
  not destination.ip:(
    10.0.0.0/8 or
    127.0.0.0/8 or
    169.254.0.0/16 or
    172.16.0.0/12 or
    192.168.0.0/16 or
    224.0.0.0/4 or
    255.255.255.255 or
    "::1" or
    "FE80::/10" or
    "FF00::/8")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

