{"id":135,"date":"2017-05-03T21:32:43","date_gmt":"2017-05-03T19:32:43","guid":{"rendered":"http:\/\/wp.12p.no\/?p=135"},"modified":"2017-05-03T21:32:43","modified_gmt":"2017-05-03T19:32:43","slug":"using-dhcp-on-pan-device-as-user-id-based-on-device-name","status":"publish","type":"post","link":"https:\/\/12p.no\/wp\/?p=135","title":{"rendered":"Using DHCP on PAN device as User-ID, based on device-name"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>If you\u2019re using DHCP on a PAN device, and want to get a simple way to identify users machines \/ phone based on device names, you can do so easylie with syslog.<\/p>\n<p>This setup will convert this logline from DHCP:<\/p>\n<pre><em>DHCP lease started ip 192.168.18.140 --&gt; mac 34:02:86:XX:XX:XX - hostname PCNO00198, interface ethernet1\/2<\/em><\/pre>\n<p>To This:<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/tothis.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-144\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/tothis-1024x151.png\" alt=\"\" width=\"474\" height=\"70\" \/><\/a><\/p>\n<p>This works from 8.0.0 and up.<\/p>\n<p>My setup:<\/p>\n<pre><em>Ethernet1\/1 -&gt; x.x.x.x\u00a0\u00a0\u00a0 Untrust<\/em>\n\n<em>Ethernet1\/2 -&gt; 192.168.18.1 INSIDE (DHCP Server)<\/em>\n\n<em>Ethernet1\/3 -&gt; 10.198.100.1 Guest (DHCP Server)<\/em><\/pre>\n<p>All serviceroutes setup to use Ethernet1\/2, 192.168.18.1 (since I don\u2019t use the dedicated managementport. User Identification ACL has to be enabled for the Zone you want to monitor:<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/zone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-145\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/zone.png\" alt=\"\" width=\"769\" height=\"315\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Step 1:<\/p>\n<p>Under Device, Server Profiles, and Syslog. Create a syslog profile that forward logs UDP port 514 to your own devices interface ip.<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-137\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/2-1024x644.png\" alt=\"\" width=\"474\" height=\"298\" \/><\/a><\/p>\n<p>Step 2: Then, go to Logsettings And create a new Log Setting-System, add (eventid eq lease-start) in filter, and the syslogprofile you created in step 1.<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-138\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/3-1024x751.png\" alt=\"\" width=\"474\" height=\"348\" \/><\/a><\/p>\n<p>Step 3:<\/p>\n<p>Create a syslogfilter. Go to User Identification, Usermapping, then Palo Alto Networks User-ID Agent Setup, then Syslogfilter, ADD, name it something like PA-DHCP, use Regex Identifiser,<\/p>\n<p>Event Regex: DHCP\\ lease\\ started<\/p>\n<p>Username Regex: hostname ([a-zA-Z0-9\\_\\[\\]\\-]+)<\/p>\n<p>Address Regex: ip ([A-F0-9a-f:.]+)<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-139\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/4-1024x821.png\" alt=\"\" width=\"474\" height=\"380\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Step 4:<\/p>\n<p>Under User Identification, and new Server Monitoring (User Identification Monitored Server), Enabled, Type Syslog Sender, and ip of sender (in my case 192.168.18.1, because of service routes), Connection Type: UDP , and the Syslog Filter you created in step 3<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-140\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/5-1024x843.png\" alt=\"\" width=\"474\" height=\"390\" \/><\/a><\/p>\n<p>Step 5:<\/p>\n<p>Allow the Interface to be used as User ID syslog listener-UDP. Go to Network, then Network Profiles, and Interface Mgmt. Create a interface Management profile, and allow User-ID Syslog Listener-UDP.<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-141\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/6-1024x856.png\" alt=\"\" width=\"474\" height=\"396\" \/><\/a><\/p>\n<p>Attach this profile to the interface (in my case the Ethernet1\/2 \u00a0192.168.18.1)<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-142\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/7-1024x843.png\" alt=\"\" width=\"474\" height=\"390\" \/><\/a><\/p>\n<p>And you\u2019re good to go!<\/p>\n<p>&nbsp;<\/p>\n<p>TIP: Be sure to have the right service routes configured if you\u2019re not using management-interface.<\/p>\n<p><a href=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-143\" src=\"http:\/\/wp.12p.no\/wp-content\/uploads\/2017\/05\/8.png\" alt=\"\" width=\"858\" height=\"794\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; If you\u2019re using DHCP on a PAN device, and want to get a simple way to identify users machines \/ phone based on device names, you can do so easylie with syslog. This setup will convert this logline from DHCP: DHCP lease started ip 192.168.18.140 &#8211;&gt; mac 34:02:86:XX:XX:XX &#8211; hostname PCNO00198, interface ethernet1\/2 To [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[10,23,24],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-it-security","tag-dhcp","tag-paloalto-networks","tag-user-id"],"_links":{"self":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":0,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/12p.no\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}