How to create custom application DNS for subdomain and domain name
362
Created On 12/30/20 02:42 AM - Last Modified 10/28/26 16:08 PM
Objective
Objective: To have granular control over security policy (separated over custom-application) when performing DNS query for the different subdomain
Security Policy 1: Client querying to zoom.us
Security Policy 2: Client querying to paloaltonetworks.zoom.us
Environment
"User-querying-zoom-dn; index: 2" {
from L3-Trust;
source any;
source-region none;
to L3-Untrust;
destination any;
destination-region none;
user any;
category any;
application/service 0:dns-zoom-dot-us/any/any/any;
action allow;
icmp-unreachable: no
terminal yes;
}
"User-querying-panw-zoom; index: 3" {
from L3-Trust;
source any;
source-region none;
to L3-Untrust;
destination any;
destination-region none;
user any;
category any;
application/service 0:dns-panw-zoom/any/any/any;
action allow;
icmp-unreachable: no
terminal yes;
}
Procedure
1) Create a custom Application with Parent App as "dns" for domain name
# show vsys vsys1 application dns-zoom-dot-us
dns-zoom-dot-us {
default {
port udp/53;
}
signature {
zoom-us {
and-condition {
"And Condition 1" {
or-condition {
"Or Condition 1" {
operator {
pattern-match {
pattern \x047a6f6f6d02757300\x;
context dns-req-section;
}
}
}
}
}
}
scope protocol-data-unit;
order-free no;
}
}
subcategory infrastructure;
category networking;
technology client-server;
risk 1;
parent-app dns;
}
2) Create custom Application for sub-domain with Parent application set to "None"
# show vsys vsys1 application dns-panw-zoom
dns-panw-zoom {
signature {
panw-zoom {
and-condition {
"And Condition 1" {
or-condition {
"Or Condition 1" {
operator {
pattern-match {
pattern \x1070616c6f616c746f6e6574776f726b73047a6f6f6d02757300\x;
context dns-req-section;
}
}
}
}
}
}
scope protocol-data-unit;
order-free no;
}
}
subcategory infrastructure;
category networking;
technology client-server;
risk 1;
default {
port udp/53;
}
}
Side Note
1) For other examples of custom application ID and signature string context, please review the official documentation below
Custom Application IDs and Signatures: String Context
https://docs.paloaltonetworks.com/pan-os/u-v/custom-app-id-and-threat-signatures/custom-application-and-threat-signatures/custom-signature-contexts/string-contexts.html
2) For this very example, the article below explains how to define pattern based on the specific DNS query
Custom Application IDs and Signatures: dns-req-section
https://docs.paloaltonetworks.com/pan-os/u-v/custom-app-id-and-threat-signatures/custom-application-and-threat-signatures/custom-signature-contexts/string-contexts/dns-req-section.html
Additional Information
1) When querying to zoom.us, firewall identify it as the custom application "dns-zoom-dot-us"
477784 dns-zoom-dot-us ACTIVE FLOW NS 10.46.45.2[55989]/L3-DMZ/17 (10.46.41.53[1974])
vsys1 10.55.2.10[53]/L3-Untrust (10.55.2.10[53])
2) When querying to paloaltonetworks.zoom.us, Firewall identified it as a custom application "dns-panw-zoom".
477781 dns-panw-zoom ACTIVE FLOW NS 10.46.45.2[55987]/L3-DMZ/17 (10.46.41.53[16245])
vsys1 10.55.2.10[53]/L3-Untrust (10.55.2.10[53])