PiHole
PiHole Pack.#
This Integration is part of thePi-hole is a network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network. This integration was integrated and tested with version FTL5.2 of PiHole
#
Configure PiHole on Cortex XSOAR- Navigate to Settings > Integrations > Servers & Services.
- Search for PiHole.
- Click Add instance to create and configure a new integration instance.
Parameter | Description | Required |
---|---|---|
url | Server URL | True |
token | Auth Token | False |
insecure | Trust any certificate (not secure) | False |
proxy | Use system proxy settings | False |
- Click Test to validate the URLs, token, and connection.
#
CommandsYou can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.
#
pihole-get-versionReturns the version of the API
#
Base Commandpihole-get-version
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Version.version | string | Version info |
#
Command Example!pihole-get-version
#
Context Example#
Human Readable Output#
Results
version 3
#
pihole-get-typeReturns the backend used by the API (either PHP or FTL)
#
Base Commandpihole-get-type
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Type.type | string | Type information |
#
Command Example!pihole-get-type
#
Context Example#
Human Readable Output#
Results
type FTL
#
pihole-get-summaryrawGives statistics in raw format (no number formatting applied)
#
Base Commandpihole-get-summaryraw
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.SummaryRaw | string | Summary no formatting |
#
Command Example!pihole-get-summaryraw
#
Context Example#
Human Readable Output#
Results
ads_blocked_today ads_percentage_today clients_ever_seen dns_queries_all_types dns_queries_today domains_being_blocked gravity_last_updated privacy_level queries_cached queries_forwarded reply_CNAME reply_IP reply_NODATA reply_NXDOMAIN status unique_clients unique_domains 457 2.387296 15 19143 19143 85512 file_exists: true
absolute: 1597037232
relative: {"days": 2, "hours": 5, "minutes": 41}0 9086 9595 5811 8696 1664 1622 disabled 15 1551
#
pihole-get-overtimedata10minsData needed for generating the domains/ads over time graph on the Pi-hole web dashboard
#
Base Commandpihole-get-overtimedata10mins
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.OverTimeData10mins | string | Data over last 10mins |
#
Command Example!pihole-get-overtimedata10mins
#
Context Example#
Human Readable Output#
Results
ads_over_time domains_over_time 1597147500: 2
1597148100: 1
1597148700: 6
1597230300: 01597147500: 81
1597148100: 96
1597148700: 85
1597230300: 423
#
pihole-get-topitemsData needed for generating the Top Domain and Top Advertisers Lists
#
Base Commandpihole-get-topitems
#
InputArgument Name | Description | Required |
---|---|---|
limit | how many entries | Optional |
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.TopItems | string | Top Items |
#
Command Example!pihole-get-topitems
#
Context Example#
Human Readable Output#
Results
top_ads top_queries app-measurement.com: 180
iadsdk.apple.com: 64
pingma.qq.com: 50
api.segment.io: 22
notify.bugsnag.com: 12
logging.dhg.myharmony.com: 9
dhg-logging.us-east-1.elasticbeanstalk.com: 9
cf.iadsdk.apple.com: 9
www.google-analytics.com: 7
static.hotjar.com: 7www.google.com: 3153
agent-gateway-api-prod-eu.traps.paloaltonetworks.com: 1355
xyz: 903
ch-xyz.traps.paloaltonetworks.com: 815
gateway.icloud.com: 561
gsp-ssl.ls-apple.com.akadns.net: 387
gsp-ssl.ls.apple.com: 349
dc-xyz.traps.paloaltonetworks.com: 338
#
pihole-get-topclientsData needed for generating the Top Clients list
#
Base Commandpihole-get-topclients
#
InputArgument Name | Description | Required |
---|---|---|
limit | how many entries | Optional |
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.TopClients | string | Top Clients |
#
Command Example!pihole-get-topclients
#
Context Example#
Human Readable Output#
Results
top_sources 192.168.0.2: 5964
mymachine.local|192.168.0.20: 1627
192.168.0.1: 497
192.168.0.3: 338
localhost.localdomain|127.0.0.1: 336
#
pihole-get-forward-destinationsShows number of queries that have been forwarded and the target
#
Base Commandpihole-get-forward-destinations
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.ForwardDestinations | string | Fowarding destinations |
#
Command Example!pihole-get-forward-destinations
#
Context Example#
Human Readable Output#
Results
forward_destinations blocklist|blocklist: 2.39
cache|cache: 47.48
1.1.1.3: 25.42
1.0.0.3: 24.77
#
pihole-get-query-typesShows number of queries that the Pi-hole’s DNS server has processed
#
Base Commandpihole-get-query-types
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.QueryTypes | string | Query types |
#
Command Example!pihole-get-query-types
#
Context Example#
Human Readable Output#
Results
querytypes A (IPv4): 75.52
AAAA (IPv6): 15.08
ANY: 0
SRV: 0.6
SOA: 5.19
PTR: 3.13
TXT: 0.48
NAPTR: 0
MX: 0
DS: 0
RRSIG: 0
DNSKEY: 0
OTHER: 0
#
pihole-get-all-queriesGet DNS queries data
#
Base Commandpihole-get-all-queries
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.AllQueries | string | All Queries (a lot of data) |
#
Command Example!pihole-get-all-queries
#
Human Readable OutputThis command will return all queries. Its a big list in a file.
#
pihole-statusShow status of pihole action (enabled - disabled)
#
Base Commandpihole-status
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Status | string | Status |
#
Command Example!pihole-status
#
Context Example#
Human Readable Output#
Results
status disabled
#
pihole-enableEnable Pi-hole ad blocking
#
Base Commandpihole-enable
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Enable | string | Enabled blocking |
#
Command Example!pihole-enable
#
Context Example#
Human Readable Output#
Results
status enabled
#
pihole-disableused to disable pihole for certain amount of time
#
Base Commandpihole-disable
#
InputArgument Name | Description | Required |
---|---|---|
time | Time in seconds for blocking to be disabled | Optional |
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Disable | string | Disabled |
#
Command Example!pihole-disable
#
Context Example#
Human Readable Output#
Results
status disabled
#
pihole-get-versionsShow versions of all components
#
Base Commandpihole-get-versions
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Versions | string | Version info |
#
Command Example!pihole-get-versions
#
Context Example#
Human Readable Output#
Results
FTL_branch FTL_current FTL_latest FTL_update core_branch core_current core_latest core_update web_branch web_current web_latest web_update master v5.2 v5.2 false master v5.1.2 v5.1.2 false master v5.1.1 v5.1.1 false
#
pihole-get-topclientsblockedShows the top clients being blocked
#
Base Commandpihole-get-topclientsblocked
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.TopClientsBlocked | string | Top blocked clients |
#
Command Example!pihole-get-topclientsblocked
#
Context Example#
Human Readable Output#
ResultsNo entries.
#
pihole-get-cache-infoShow cache info
#
Base Commandpihole-get-cache-info
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.CacheInfo | string | Cache info |
#
Command Example!pihole-get-cache-info
#
Context Example#
Human Readable Output#
Results
cacheinfo cache-size: 10000
cache-live-freed: 0
cache-inserted: 99
#
pihole-get-recent-blockedShow most recent blocked domain
#
Base Commandpihole-get-recent-blocked
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.RecentBlocked | string | Recently blocked |
#
Command Example!pihole-get-recent-blocked
#
Context Example#
Human Readable Output#
Results
Data abc.xyz.com
#
pihole-get-overTimeDataQueryTypesGet data over time per query types
#
Base Commandpihole-get-overTimeDataQueryTypes
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.OverTimeDataQueryTypes | string | Over time query types |
#
Command Example!pihole-get-overTimeDataQueryTypes
#
Context Example#
Human Readable Output#
Results
over_time 1597147500: 87.34,
12.66
1597148100: 91.67,
8.33
1597148700: 90.12,
9.88
1597230300: 63.33,
36.67
#
pihole-get-client-namesGet client names
#
Base Commandpihole-get-client-names
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.ClientNames | string | Client names |
#
Command Example!pihole-get-client-names
#
Context Example#
Human Readable Output#
Results
clients {'name': 'mymachine1.local', 'ip': '192.168.0.1'},
{'name': 'mymachine2.local', 'ip': '192.168.0.2'},
{'name': 'mymachine3.local', 'ip': '192.168.0.3'}
#
pihole-get-over-time-data-clientsGet over time data clients
#
Base Commandpihole-get-over-time-data-clients
#
InputArgument Name | Description | Required |
---|
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.OverTimeDataClients | string | Over time client data |
#
Command Example!pihole-get-over-time-data-clients
#
Context Example#
Human Readable Output#
Results
over_time 1597147500: 0,
24,
41,
1,
2,
10,
2,
1,
0,
0,
0,
0,
0,
0,
0
1597148100: 0,
50,
33,
0,
3,
8,
1,
1,
0,
0,
0,
0,
0,
0,
0
1597148700: 0,
30,
5,
1,
3,
21,
0,
0,
25,
0,
0,
0,
0,
0,
0
1597230300: 367,
38,
0,
16,
2,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0
#
pihole-list-managementManage lists. Add or remove items from lists
#
Base Commandpihole-list-management
#
InputArgument Name | Description | Required |
---|---|---|
domain | Domain to be added or removed | Optional |
action | add or sub | Optional |
list | which list to interact with | Required |
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.List | string | Lists |
#
Command Example!pihole-list-management list=white action=add domain=paloaltonetworks.com
#
Context Example#
Human Readable Output#
Results
message success Added paloaltonetworks.com true
#
pihole-get-listGet all available lists from Pihole
#
Base Commandpihole-get-list
#
InputArgument Name | Description | Required |
---|---|---|
list | which list to get | Required |
#
Context OutputPath | Type | Description |
---|---|---|
PiHole.Lists | string | get a list data |
#
Command Example!pihole-get-list list=white
#
Context Example#
Human Readable Output#
Results
data {'id': 2, 'type': 0, 'domain': 'www.googleadservices.com', 'enabled': 1, 'date_added': 1593758659, 'date_modified': 1593758659, 'comment': None, 'groups': [0]},
{'id': 3, 'type': 0, 'domain': 'www.googletagmanager.com', 'enabled': 1, 'date_added': 1593758671, 'date_modified': 1593758671, 'comment': None, 'groups': [0]},
{'id': 8, 'type': 0, 'domain': 'google.com', 'enabled': 1, 'date_added': 1594876318, 'date_modified': 1594876318, 'comment': None, 'groups': [0]}