Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Don't Forget Your Badge!

Jamf
October 25, 2018

Don't Forget Your Badge!

Presentation from JNUC 2018, the world's largest rally of Apple IT administrators.

Session:
Don't Forget Your Badge!

Presented by:
Allen Golbig, NASA
Matt Woodruff, Jamf

View all session slides, recordings and more at https://www.jamf.com/events/jamf-nation-user-conference/2018/.

Jamf

October 25, 2018
Tweet

More Decks by Jamf

Other Decks in Technology

Transcript

  1. © JAMF Software, LLC Allen Golbig Mac Systems Engineer Peerless

    Technologies @ NASA Matt Woodruff Sr. Systems Engineer Jamf
  2. © JAMF Software, LLC Don’t Forget Your Badge! Presentation agenda:

    Background check macOS smartcard configuration Using Jamf Pro to manage smartcards Where do we go next?
  3. © JAMF Software, LLC PIV Mandatory • HSPD-12 • OMB

    M-11-11 • FISMA CIO Metrics Requirements
  4. © JAMF Software, LLC PIV Mandatory Definition Managed By Machine

    Based Enforcement A user is required to use their PIV to authenticate to each device MDM User Based Enforcement A user’s network password is removed from their account MDM Directory Services
  5. © JAMF Software, LLC Smartcard Configuration • GUI-based • Can

    be scripted • Requires admin rights Pairing (Fixed Key Mapping)
  6. © JAMF Software, LLC Smartcard Configuration • Scriptable • Works

    with AD accounts • Always takes precedence Attribute Mapping
  7. © JAMF Software, LLC /bin/cat > "/etc/SmartcardLogin.plist" << 'Attr_Mapping' <?xml

    version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <dict> <key>fields</key> <array> <string>NT Principal Name</string> </array> <key>formatString</key> <string>Kerberos:$1</string> <key>dsAttributeString</key> <string>dsAttrTypeStandard:AltSecurityIdentities</string> </dict> </dict> </plist> Attr_Mapping
  8. © JAMF Software, LLC /bin/cat > "/etc/SmartcardLogin.plist" << 'Attr_Mapping' <?xml

    version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <dict> <key>fields</key> <array> <string>NT Principal Name</string> </array> <key>formatString</key> <string>Kerberos:$1</string> <key>dsAttributeString</key> <string>dsAttrTypeStandard:AltSecurityIdentities</string> </dict> </dict> </plist> Attr_Mapping
  9. © JAMF Software, LLC /bin/cat > "/etc/SmartcardLogin.plist" << 'Attr_Mapping' <?xml

    version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <dict> <key>fields</key> <array> <string>NT Principal Name</string> </array> <key>formatString</key> <string>Kerberos:$1</string> <key>dsAttributeString</key> <string>dsAttrTypeStandard:AltSecurityIdentities</string> </dict> </dict> </plist> Attr_Mapping
  10. © JAMF Software, LLC /bin/cat > "/etc/SmartcardLogin.plist" << 'Attr_Mapping' <?xml

    version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <dict> <key>fields</key> <array> <string>NT Principal Name</string> </array> <key>formatString</key> <string>Kerberos:$1</string> <key>dsAttributeString</key> <string>dsAttrTypeStandard:AltSecurityIdentities</string> </dict> </dict> </plist> Attr_Mapping
  11. © JAMF Software, LLC Smartcard Configuration • Flexibility • Aligned

    us with other platforms • Works well with AD bound systems Why did we go with mapping?
  12. © JAMF Software, LLC • Third-party apps that lack CryptoTokenKit

    support • View your certificates in Keychain Access and change pin • Race conditions with CTK • man SmartCardServices-legacy TokenD Why do we still use it?
  13. © JAMF Software, LLC Unbinding • Use Jamf Pro to

    apply management settings • Mitigate AD Risks • Get your kerberos ticket from Enterprise Connect PKI or Jamf Connect Why do you need Active Directory?
  14. © JAMF Software, LLC Enterprise Connect PKI • Apple Professional

    Services • Adds smartcard support 
 to Enterprise Connect • Apple supported • Does not work with LDAP
  15. © JAMF Software, LLC • Multiple Identities • CLI for

    getting kerberos ticket • Works with LDAP • So much more Jamf Connect
  16. © JAMF Software, LLC com.apple.security.smartcard • If false, users will

    not get the pairing dialog • Default: True UserPairing
  17. © JAMF Software, LLC com.apple.security.smartcard • If false, the smartcard

    is disabled for logins, authorizations and screensaver • Still allowed for other functions • Default: True allowSmartCard
  18. © JAMF Software, LLC com.apple.security.smartcard • 0 - certificate trust

    off • 1 - certificate trust on, no revocation checks • 2 - certificate trust on, soft revocation • 3 - certificate trust on, hard revocation checkCertificateTrust
  19. © JAMF Software, LLC com.apple.security.smartcard • If true, a user

    can only pair with one smartcard • Default: False oneCardPerUser
  20. © JAMF Software, LLC com.apple.security.smartcard • If true, a user

    can only login or authenticate with a smartcard • Default: False enforceSmartCard
  21. © JAMF Software, LLC com.apple.security.smartcard • If 1, screensaver will

    be enabled upon removal of smartcard • Default: 0 tokenRemovalAction
  22. © JAMF Software, LLC com.apple.loginwindow • If on, disables automatic

    login if FileVault is enabled, so that both an EFI Login and loginwindow password are required • Default: Off DisableFDEAutoLogin
  23. © JAMF Software, LLC What’s new in Mojave • Certificate

    Pinning • Performance Enhancements • NO MORE KEYCHAIN 
 PROMPTS!
  24. © JAMF Software, LLC Jamf Pro • Mapping Process •

    Enforcement • Additional Requirements Overview
  25. © JAMF Software, LLC Jamf Pro Mapping Process • Get

    User Principal Name off card • Append UPN to user’s directory record • Add /etc/SmartcardLogin.plist
  26. © JAMF Software, LLC /usr/sbin/sc_auth identities | awk '/PIV/ {print

    $1}' \ | tr '[:upper:]' '[:lower:]' | sed 's/.\{8\}/& /g' | sed 's/.$//g' Getting PIV Auth Hash
  27. © JAMF Software, LLC /usr/sbin/system_profiler SPSmartCardsDataType | grep -A5 "$hash"

    \ | awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/ \ {print; count++; if (count==3) exit}' | fold -w67 > /tmp/temp.pem Generating PIV Auth Cert
  28. © JAMF Software, LLC -----BEGIN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F Software, LLC UPN="$(/usr/bin/openssl asn1parse -i -dump -in /tmp/temp.pem

    -strparse \ $(/usr/bin/openssl asn1parse -i -dump -in /tmp/temp.pem \ | awk -F ':' '/X509v3 Subject Alternative Name/ {getline; print $1}') \ | awk -F ':' '/UTF8STRING/{print $4}')" Getting UPN from Certificate
  30. © JAMF Software, LLC /bin/cat > "/etc/SmartcardLogin.plist" << 'Attr_Mapping' <?xml

    version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>TrustedAuthorities</key> <array> <string>SHA-256_HASH_GOES_HERE</string> </array> <key>AttributeMapping</key> <dict> <key>fields</key> <array> <string>NT Principal Name</string> </array> <key>formatString</key> <string>Kerberos:$1</string> <key>dsAttributeString</key> <string>dsAttrTypeStandard:AltSecurityIdentities</string> </dict> </dict> </plist> Attr_Mapping
  31. © JAMF Software, LLC /bin/cat > "/etc/SmartcardLogin.plist" << 'Attr_Mapping' <?xml

    version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>TrustedAuthorities</key> <array> <string>SHA-256_HASH_GOES_HERE</string> </array> <key>AttributeMapping</key> <dict> <key>fields</key> <array> <string>NT Principal Name</string> </array> <key>formatString</key> <string>Kerberos:$1</string> <key>dsAttributeString</key> <string>dsAttrTypeStandard:AltSecurityIdentities</string> </dict> </dict> </plist> Attr_Mapping
  32. © JAMF Software, LLC Jamf Pro Enforcement • EAs &

    Smart Groups for Scoping • Apply enforceSmartCard key • PAM Modules, SSH • PIV Exemption
  33. © JAMF Software, LLC Jamf Pro Extension Attribute • Check

    status of AltSecurityIdentities • As well as /etc/SmartcardLogin.plist
  34. © JAMF Software, LLC #!/bin/bash if [ -f /etc/SmartcardLogin.plist ];

    then if [ $(for user in $(dscl . list /Users UniqueID | awk '$2 > 500 {print $1}'); do dscl . read /Users/$user AltSecurityIdentities 2>/dev/null | grep @jamf.com; done | wc -l) -gt 0 ]; then echo “<result>True</result>" else echo "<result>False</result>" fi else echo "<result>False</result>" fi
  35. © JAMF Software, LLC Jamf Pro Enforcement - Smart Group

    AND/OR CRITERIA OPERATOR VALUE Smartcard-Mapping Is TRUE And Smartcard_Exempt Is Not 1
  36. © JAMF Software, LLC Jamf Pro Enforcement - Scoping Smartcard

    Authentication Configuration Profile Smartcard Enforce Configuration Profile Target All Managed Clients Smartcard-enforce Exclusion Smartcard-enforce None
  37. © JAMF Software, LLC Jamf Pro But wait, there’s more!

    • enforceSmartCard limited
 to login, authorization,
 and screensaver unlock • PAM Modules • SSH
  38. © JAMF Software, LLC Jamf Pro PAM Modules • /etc/pam.d/sudo

    • /etc/pam.d/login • /etc/pam.d/su • https://support.apple.com/en-us/HT208372
  39. © JAMF Software, LLC #!/bin/bash pamSudo=$(grep -Ec '^(auth\s+sufficient\s+pam_smartcard.so|auth\s+required\s+pam_deny.so)' /etc/pam.d/sudo) pamLogin=$(grep

    -Ec '^(auth\s+sufficient\s+pam_smartcard.so|auth\s+required\s+pam_deny.so)' /etc/pam.d/login) pamSu=$(grep -Ec '^(auth\s+sufficient\s+pam_smartcard.so|auth\s+required\s+pam_rootok.so)' /etc/pam.d/su) if [[ "$pamSudo" = "2" ]] && [[ "$pamLogin" = "2" ]] && [[ "$pamSu" = "2" ]]; then echo "<result>Compliant</result>" else echo "<result>Not Compliant</result>" fi Extension Attribute
  40. © JAMF Software, LLC Jamf Pro SSH • /etc/ssh/sshd_config •

    /etc/ssh/ssh_config • https://support.apple.com/en-us/HT208372
  41. © JAMF Software, LLC #!/bin/bash ssh_check=$(/usr/bin/grep -c ssh-keychain.dylib /etc/ssh/ssh_config) if

    [[ "$ssh_check" > "0" ]]; then echo "<result>Enabled</result>" else echo "<result>Disabled</result>" fi Extension Attribute
  42. © JAMF Software, LLC Jamf Pro PIV Exemption • Lost,

    damaged, stolen or forgotten • Need for quick remediation • Possibility user is off network • Modification to Extension Attribute
  43. © JAMF Software, LLC Smartcard Auth - Jamf Pro Services

    Single Sign-On • Jamf Pro Server • Self Service • User Initiated Enrollments
  44. © JAMF Software, LLC Third-Party Apps • Microsoft Outlook •

    Adobe Acrobat Reader/Pro • Firefox • Pulse Secure • The list goes on and on… CTK Support???
  45. © JAMF Software, LLC Future • FileVault • Derived credentials

    • TouchID to unlock smartcard, after initial unlock • External disk/DMG/archive support Please Apple?