Skip to content

Conversation

@tomsonpl
Copy link
Contributor

@tomsonpl tomsonpl commented Nov 7, 2025

ARP Cache Artifact

The ARP (Address Resolution Protocol) Cache artifact provides enriched network neighbor information by combining ARP cache entries with local network interface details. This comprehensive view is essential for investigating network communications, detecting ARP spoofing attacks, and understanding complete source-to-destination network endpoint relationships.


Core Forensic Artifacts Coverage

# Artifact OS Query File Description
9 ARP Cache All arp_cache_elastic b2c3d4e5 ARP cache with local interface details (local IP, local MAC). Equivalent to Windows.Network.ArpCache artifact

One query works in all platforms


🪟 ARP Cache with Local Interface Information

Description

Retrieves enriched ARP cache entries with local interface details including local IP addresses and MAC addresses. Combines ARP cache data with network interface configuration to provide complete neighbor relationship context. This enriched view helps investigate network communications, detect ARP spoofing, and understand both source and destination network endpoints. Equivalent to Windows.Network.ArpCache artifact functionality.

Detection Focus:

  • Network neighbor relationships with complete endpoint context
  • ARP spoofing detection through comprehensive cache analysis
  • Local and remote MAC address correlation
  • Network interface to ARP entry mapping
  • Persistent vs. active ARP entries identification
  • IPv4 and IPv6 neighbor cache monitoring

Result

Screenshot 2025-11-07 at 17 21 06

Returns comprehensive ARP cache entries including:

  • Remote IP addresses and MAC addresses
  • Local interface IP addresses and MAC addresses
  • Interface names for network context
  • Entry persistence status (Active/Persistent)
  • Address family identification (IPv4/IPv6)

Platform

all

Interval

3600 seconds (1 hour)

Query ID

arp_cache_elastic

ECS Field Mappings

  • destination.ipRemoteAddress
  • destination.macRemoteMACAddress
  • host.ipLocalAddress
  • host.macLocalMAC
  • network.nameInterfaceName
  • network.typeAddressFamily
  • tagsStore

SQL Query

-- ARP Cache with Local Interface Information
-- Provides complete network neighbor context by joining ARP cache with interface details
-- Source: arp_cache + interface_details + interface_addresses tables
-- Equivalent to Windows.Network.ArpCache artifact

WITH arp_entries AS (
    SELECT
        a.address AS RemoteAddress,
        a.mac AS RemoteMACAddress,
        a.interface AS InterfaceName,
        CASE
            WHEN a.permanent = '1' THEN 'Persistent'
            ELSE 'Active'
        END AS Store,
        CASE
            WHEN a.address LIKE '%:%' THEN 'ipv6'
            ELSE 'ipv4'
        END AS AddressFamily
    FROM arp_cache a
),
local_interfaces AS (
    SELECT
        id.interface,
        id.mac AS LocalMAC,
        ia.address AS LocalAddress
    FROM interface_details id
    LEFT JOIN interface_addresses ia ON id.interface = ia.interface
    WHERE id.mac IS NOT NULL
        AND ia.address IS NOT NULL
)
SELECT
    ae.RemoteAddress,
    ae.RemoteMACAddress,
    ae.InterfaceName,
    ae.Store,
    ae.AddressFamily,
    li.LocalAddress,
    li.LocalMAC
FROM arp_entries ae
LEFT JOIN local_interfaces li ON ae.InterfaceName = li.interface
ORDER BY ae.InterfaceName, ae.RemoteAddress;

@tomsonpl tomsonpl self-assigned this Nov 7, 2025
@tomsonpl tomsonpl marked this pull request as ready for review November 7, 2025 16:37
@tomsonpl tomsonpl requested a review from a team as a code owner November 7, 2025 16:37
@tomsonpl tomsonpl requested review from joeypoon and szwarckonrad and removed request for a team November 7, 2025 16:37
@elasticmachine
Copy link

💚 Build Succeeded

cc @tomsonpl

@andrewkroh andrewkroh added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:osquery_manager Osquery Manager labels Nov 7, 2025
],
"id": "arp_cache_elastic",
"interval": "3600",
"query": "-- ARP Cache with Local Interface Information\n-- Provides complete network neighbor context by joining ARP cache with interface details\n-- Source: arp_cache + interface_details + interface_addresses tables\n-- Equivalent to Windows.Network.ArpCache artifact\n\nWITH arp_entries AS (\n SELECT \n a.address AS RemoteAddress,\n a.mac AS RemoteMACAddress,\n a.interface AS InterfaceName,\n CASE \n WHEN a.permanent = '1' THEN 'Persistent'\n ELSE 'Active'\n END AS Store,\n CASE\n WHEN a.address LIKE '%:%' THEN 'ipv6'\n ELSE 'ipv4'\n END AS AddressFamily\n FROM arp_cache a\n),\nlocal_interfaces AS (\n SELECT \n id.interface,\n id.mac AS LocalMAC,\n ia.address AS LocalAddress\n FROM interface_details id\n LEFT JOIN interface_addresses ia ON id.interface = ia.interface\n WHERE id.mac IS NOT NULL\n AND ia.address IS NOT NULL\n)\nSELECT \n ae.RemoteAddress,\n ae.RemoteMACAddress,\n ae.InterfaceName,\n ae.Store,\n ae.AddressFamily,\n li.LocalAddress,\n li.LocalMAC\nFROM arp_entries ae\nLEFT JOIN local_interfaces li ON ae.InterfaceName = li.interface\nORDER BY ae.InterfaceName, ae.RemoteAddress;", "platform": "linux,darwin,windows",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to consider the address family when joining in the final table. Without the addition I added in this diff I saw two rows for each RemoteAddress, one with the IPv4 LocalAddress for the interface and one with the IPv6 LocalAddress.

WITH arp_entries AS (
 SELECT 
 a.address AS RemoteAddress,
 a.mac AS RemoteMACAddress,
 a.interface AS InterfaceName,

 CASE 
 WHEN a.permanent = '1' THEN 'Persistent'
 ELSE 'Active'
 END AS Store,

 CASE
 WHEN a.address LIKE '%:%' THEN 'ipv6'
 ELSE 'ipv4'
 END AS AddressFamily

 FROM arp_cache a
),
local_interfaces AS (
 SELECT 
 id.interface,
 id.mac AS LocalMAC,
- ia.address AS LocalAddress
+ ia.address AS LocalAddress,
+ CASE
+ WHEN
+ ia.address LIKE '%:%' THEN 'ipv6'
+ ELSE 'ipv4'
 END AS AddressFamily
 FROM interface_details id
 LEFT JOIN interface_addresses ia ON id.interface = ia.interface
 WHERE id.mac IS NOT NULL
 AND ia.address IS NOT NULL
)
SELECT 
 ae.RemoteAddress,
 ae.RemoteMACAddress,
 ae.InterfaceName,
 ae.Store,
 ae.AddressFamily,
 li.LocalAddress,
 li.LocalMAC
FROM arp_entries ae
-LEFT JOIN local_interfaces li ON ae.InterfaceName = li.interface
+LEFT JOIN local_interfaces li ON ae.InterfaceName = li.interface AND ae.AddressFamily = li.AddressFamily
ORDER BY ae.InterfaceName, ae.RemoteAddress

}
},
{
"key": "host.ip",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this and host.mac should be source.* fields. host says

ECS host.* fields should be populated with details about the host on which the event happened, or from which the measurement was taken.

I typically think of host as information about the collector, not the actual collected data. I wonder what the ECS team thinks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:osquery_manager Osquery Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants