{"id":1516,"date":"2024-09-27T19:03:10","date_gmt":"2024-09-28T00:03:10","guid":{"rendered":"https:\/\/www.brunerd.com\/blog\/?p=1516"},"modified":"2024-10-10T10:14:35","modified_gmt":"2024-10-10T15:14:35","slug":"getting-ahead-of-private-wi-fi-address-changes-in-macos-sequoia","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2024\/09\/27\/getting-ahead-of-private-wi-fi-address-changes-in-macos-sequoia\/","title":{"rendered":"Getting Ahead of Private Wi-Fi Address Changes in macOS Sequoia"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It&#8217;s been a busy 2 weeks since Apple released <a href=\"https:\/\/www.apple.com\/macos\/macos-sequoia\/\" target=\"_blank\" rel=\"noreferrer noopener\">macOS Sequoia<\/a>! One of the new features is <a href=\"https:\/\/support.apple.com\/en-us\/102509\" target=\"_blank\" rel=\"noreferrer noopener\">private Wi-Fi addresses<\/a> aka &#8220;<a href=\"https:\/\/en.wikipedia.org\/wiki\/MAC_address\" target=\"_blank\" rel=\"noreferrer noopener\">MAC address<\/a> randomization&#8221;. While this all well-and-good and can &#8220;improve your privacy&#8221;, it has been causing headaches for folks in the environments where random MAC address are <em>not<\/em> a good thing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, Apple <em>did<\/em> think about this somewhat as evidenced by: <a href=\"https:\/\/support.apple.com\/en-us\/102076\" target=\"_blank\" rel=\"noreferrer noopener\">About private Wi-Fi addresses and enterprise networks<\/a> and <a href=\"https:\/\/support.apple.com\/guide\/deployment\/wi-fi-settings-dep168e876c9\/web\">Wi-Fi MDM settings for Apple devices<\/a> but they didn&#8217;t really do a complete &#8220;dress rehearsal&#8221; of what would happen: You <em>can&#8217;t<\/em> deploy an MDM <a href=\"https:\/\/developer.apple.com\/documentation\/devicemanagement\/wifi?changes=latest_minor\" target=\"_blank\" rel=\"noreferrer noopener\">WiFi profile<\/a> with the <code>DisableAssociationMACRandomization<\/code> key <em>until<\/em> the Mac is <strong>already upgraded<\/strong> to macOS Sequoia and once upgraded to Sequoia the MAC randomizes and that could break your connectivity to get the new config profile! It&#8217;s a real &#8220;chicken and egg problem&#8221; \ud83d\udc23 that is laid out in great detail <a href=\"https:\/\/macadmin.fraserhess.com\/2024\/09\/16\/handling-mac-address-randomization-in-macos-15\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Seeing the angst created, the contortions required, and overall FML vibes this was causing I did some investigations to see what could be done and guess what? <strong>You can pre-populate the <code>PrivateMACAddressModeUserSetting<\/code> value to <code>off<\/code><\/strong> in the <code>wifi.network.ssid.&lt;SSID><\/code> dictionary of <code>\/Library\/Preferences\/com.apple.wifi.known-networks.plist<\/code> <em>before <\/em>a Mac upgrades to Sequoia! \ud83c\udf89 <s>Note: When you set this via script (versus GUI), the change does not take effect until reboot, the MAC stays randomized and the UI does not reflect this. This doesn&#8217;t matter if it&#8217;s for an upgrade to Sequoia but just letting you know if you try it on Macs already on Sequoia, it won&#8217;t take effect until a reboot. If there&#8217;s some clever <code>kill -HUP<\/code> that can be sent let me know. I tried <code>killall cfprefsd<\/code> but that wasn&#8217;t enough.<\/s> <strong>Update<\/strong>: Thanks to boberito in the MacAdmins Slack, he figured out that killing <code>cfprefsd<\/code> and <code>airportd<\/code> would update the UI and power cycling the Wi-Fi would cause this change to take effect! I&#8217;ve added an <em>option<\/em> to the script to do this, set <code>restartWiFi_HC=\"1\"<\/code> to restart Wi-Fi, just be aware you better make sure your Wi-Fi reconnects!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If that&#8217;s <em>all<\/em> you need to know, then god-speed and good luck to you! If you&#8217;d like a Jamf script and extension attribute read on&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the script <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/scripts\/setPrivateMACAddressMode.sh\">setPrivateMACAddressMode<\/a> to set the mode of one or more SSIDs on a target Mac. As it is, the SSID must have been previously connected to so the <code>wifi.network.ssid.&lt;SSID&gt;<\/code> gets filled out. I tried writing the value to an un-populated dictionary and Wi-Fi just wigged out (like nothing in the SSID list kinda weirdness!). Keep that caveat in mind. If you can figure out a minimum viable set of keys that are needed then good for you but for this script, it&#8217;ll just skip the SSID if it&#8217;s not in alrready in <code>com.apple.wifi.known-networks<\/code>. This script can be used with Jamf and its policy script parameters <em>or<\/em> if you are on another MDM, just hard-code the SSIDs, I&#8217;ve made allowances for that.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, this is a Jamf extension attribute <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/EAs\/OS-Private%20MAC%20Address%20Mode.sh\">OS-Private MAC Address Mode<\/a> it will report the mode and the SSID (example: <code>off|My Cool Wifi<\/code>). You can have it report <strong>all<\/strong> known networks or just hardcode the value for specific SSID(s). It can be useful when used in a Smart Group. You could deploy a Major Update deferral config profile to block Sequoia then make a Smart Group for <em>exclusion<\/em> using <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/EAs\/OS-Private%20MAC%20Address%20Mode.sh\">OS-Private MAC Address Mode<\/a> &#8216;<strong>is like<\/strong>&#8216; <code>off<\/code> or &#8216;<strong>matches regex<\/strong>&#8216; <code>^off\\|<\/code>for more precise matching . When someone becomes a member the Smart Group it excludes them from the Major Update deferral config profile and can then upgrade to Sequoia.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lastly, if you don&#8217;t have Jamf but want to see what the values are <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Scripts\/getPrivateMACAddressMode.sh\">getPrivateMACAddressMode<\/a> will spit out a a human readable list of SSIDs and modes (<code>off<\/code>, <code>static<\/code>, <code>rotating<\/code>, and <code>NOT_SET<\/code>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I usually try to put more pictures and illustrations in my posts but every moment I spend not publishing this, the more weekends that are possibly ruined by thinking about the suck that is macOS Sequoia Private Wi-Fi addresses in managed environments. I think this pic will sum things up! \ud83d\ude04<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Image-9-27-24-at-6.50\u202fPM.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"389\" src=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Image-9-27-24-at-6.50\u202fPM.jpg\" alt=\"\" class=\"wp-image-1517\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Image-9-27-24-at-6.50\u202fPM.jpg 642w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Image-9-27-24-at-6.50\u202fPM-300x182.jpg 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">UPDATES: A couple things to keep in mind: 1) If you deploy Config Profiles with Wi-Fi payloads, then it will blow away everything about the SSID <code>com.apple.wifi.known-networks<\/code> <em>every time<\/em> the config profile is redeployed! 2) That means if you do deploy a Wi-Fi config profile with the Sequoia-only <code><a href=\"https:\/\/developer.apple.com\/documentation\/devicemanagement\/wifi?changes=latest_minor\" target=\"_blank\" rel=\"noreferrer noopener\">DisableAssociationMACRandomization<\/a><\/code> key it will blow away the manually set key <code>PrivateMACAddressModeUserSetting<\/code> in <code>com.apple.wifi.known-networks<\/code>. The EA <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/EAs\/OS-Private%20MAC%20Address%20Mode.sh\">OS-Private MAC Address Mode<\/a> currently does <em>not<\/em> attempt to resolve if an SSID has a corresponding config profile profile with the <code><a href=\"https:\/\/developer.apple.com\/documentation\/devicemanagement\/wifi?changes=latest_minor\" target=\"_blank\" rel=\"noreferrer noopener\">DisableAssociationMACRandomization<\/a><\/code> key set, so it will be blank. 3) As of 15.0.1 a user can <em>still change<\/em> the setting even when deployed via MDM, contrary to Apple&#8217;s stated behavior: &#8220;This value is only <strong>locked when MDM installs the profile<\/strong>. If the profile is manually installed, the system sets the value but the user can change it&#8221;. 3b) Actually I found that if you <code>killall airportd<\/code> before rebooting, it&#8217;ll lock the value \u2013&nbsp;<em>until reboot<\/em>. 4) Apple also draws user attention to setting with a  caution icon \u26a0\ufe0f in the Wi-Fi dropdown rather than a &#8220;check&#8221; icon like they use for managed Login Items  in System Settings (the whole thing is an inconsistent mess)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update 2: Steven Xu over in the <a href=\"https:\/\/community.jamf.com\/t5\/jamf-pro\/disable-wi-fi-private-mac-address-on-macos-15\/m-p\/326131\/highlight\/true#M279371\">Jamf Nation forums<\/a> found that setting the <code><strong>PrivateMACAddressModeSystemSetting<\/strong><\/code> key to <code><strong>1<\/strong><\/code> (integer, not boolean) within <code>\/Library\/Preferences\/SystemConfiguration\/com.apple.airport.preferences.plist<\/code>  will <strong>disable<\/strong> Private MAC Addresses by default. Newly joined networks or networks where the <code>PrivateMACAddressModeUserSetting<\/code> key for an SSID is <code>off<\/code> or <em>not<\/em> already set to <code>static<\/code> or <code>rotating<\/code> will use their actual MAC address. I&#8217;ve added support for setting this key in <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/scripts\/setPrivateMACAddressMode.sh\">setPrivateMACAddressMode<\/a> and it too will not take effect in Sequoia+ until either a reboot or setting the variable to <code>restartWiFi_HC=\"1\"<\/code>. Just keep in mind, perhaps you <em>want<\/em> your users to have Private MAC addresses by default when joining new and unknown networks? Why should the free Wi-Fi at the food court or coffee shop get your real MAC address anyway!? The <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Scripts\/getPrivateMACAddressMode.sh\">getPrivateMACAddressMode<\/a> script and extensions attribute <a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/EAs\/OS-Private%20MAC%20Address%20Mode.sh\">OS-Private MAC Address Mode<\/a> have been updated to report on <code>(disable)PrivateMACAddressModeSystemSetting<\/code> also.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Code in this post:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/scripts\/setPrivateMACAddressMode.sh\">setPrivateMACAddressMode<\/a> &#8211; set the mode via Jamf (or others)<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Jamf\/EAs\/OS-Private%20MAC%20Address%20Mode.sh\">OS-Private MAC Address Mode<\/a> &#8211; Jamf Extension Attribute <\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/brunerd\/macAdminTools\/blob\/main\/Scripts\/getPrivateMACAddressMode.sh\">getPrivateMACAddressMode<\/a> &#8211; interactive command line tool <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a busy 2 weeks since Apple released macOS Sequoia! One of the new features is private Wi-Fi addresses aka &#8220;MAC address randomization&#8221;. While this all well-and-good and can &#8220;improve your privacy&#8221;, it has been causing headaches for folks in the environments where random MAC address are not a good thing. Now, Apple did [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,19,12],"tags":[20,25,22,24],"class_list":["post-1516","post","type-post","status-publish","format-standard","hentry","category-apple","category-bash","category-scripting","tag-bash","tag-macos","tag-scripting","tag-shell"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/1516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=1516"}],"version-history":[{"count":12,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/1516\/revisions"}],"predecessor-version":[{"id":1538,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/1516\/revisions\/1538"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=1516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=1516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=1516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}