Nine41 Consulting | Enable / Disable macOS App Store Auto Updates with an Ivanti Custom Definition
apple, device management, dep, vpp, systems management, landesk, ivanti, lanrev, absolute, heat, mdm,
16743
post-template-default,single,single-post,postid-16743,single-format-standard,qode-quick-links-1.0,ajax_fade,page_not_loaded,,columns-3,qode-child-theme-ver-1.0.0,qode-theme-ver-11.0,qode-theme-bridge,wpb-js-composer js-comp-ver-5.1.1,vc_responsive
 

Enable / Disable macOS App Store Auto Updates with an Ivanti Custom Definition

Enable / Disable macOS App Store Auto Updates with an Ivanti Custom Definition

In light of the recent ransomware attacks, with potentially others on the horizon, it’s time to review your internal patch processes and ensure they’re being effective. The key to patching is really simple, it’s to just do it. I know that is easier said than done, but more often than not, patches have been released by your application vendors prior to being exploited.

Having the correct settings on your devices may just save your company a lot of time and money. One such setting may be to ensure your Macs are set to auto-update from the Mac App Store.

While Ivanti provides a ton of patch definitions with their patch subscription service, at times you may still need to create your own custom patch definition to take care of your special needs. An example of this may be to detect whether your Mac is automatically updating. You could also check for other security setting on your devices and then repair that setting. Or, you may have a custom application built internally that needs to be updated. The needs really end up being limitless, so I won’t hash out each scenario, the important piece to understand is that you can create a definition for whatever the need is.

And, it’s not that hard to do.

To build an Ivanti custom definition, you need to answers three questions. What platform will the definition scan against? How will the vulnerability scanner detect the state of your situation? And, what will be the remediation process if required?

In the example below, we will walk through the process of detecting whether a Mac is set to automatically update itself from the Mac App Store. This is a setting that you may want enabled, to ensure the Mac App Store apps are up-to-date, because you’re not doing it through Ivanti; or it may be something you want to disable and have full control over the device using Ivanti’s patch manager. We’ll cover both scenarios of enabling and disabling the auto-updates.

To do this, we’ll need to write two scripts and embed them into the custom definition. The first will be the detection logic script and the second will be the remediation script.

Create a Manual Definition from Scratch

  1. Open the Ivanti Management Console from either a Remote Console or the Core Server.
  2. Go to Tools > Security and Compliance > Patch and Compliance.
  3. Filter the dashboards by selecting All Types, the first menu button, and selecting Custom Definition.
  4. Click on the green circle button with the white plus symbol on the menu bar to Create a Custom Definition.
  5. Change the ID to an appropriate name, i.e. Apple Automatic Updates.
  6. Copy the same text into the Title box.
  7. For the notes field, indicate who created the definition, when it was created and for what purpose (ex. Created by Bennett Norton on May 16, 2017 to detect Apple’s automatic update status.)
  8. Change the Published Severity to an appropriate setting, i.e. Important / High.
  9. Select the Description tab.
  10. Enter an appropriate description for your definition into the text box, i.e. Check for the Mac’s automatic update status.
  11. Click Apply.
  12. Return to the General tab.
  13. Click the Add button in the Detection Rules.
  14. On the Rule General Information menu item enter a name, i.e Apple Automatic Update Detection.
  15. Select the Affected Platforms menu option under Detection Logic from the menu tree.
  16. Check the boxes for Mac OS X and ac OS X Server.
  17. Select the Custom Script menu option under Detection Logic from the menu tree.
  18. In the Description box, enter a name that makes sense, i.e. Apple automatic update detection.
  19. Click the Use Editor… button.
  20. Paste the script you’ve written into the Script Content window. Use my example script below for a guide. The script needs a Found, Reason, Expected and a Detected output. Set the detected value to 1 if the detection discovers the patch is needed and 0 if a remediation is not needed.
#!/bin/sh

#  Apple Automatically Check for Updates Detection.sh
#  Created by Bennett Norton on 4/5/16.

# The auto update setting is found at /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled
autoUpdateSetting=( $( defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled ) )

# compare the returned value with your desired state
# a autoUpdateSetting of 1 means it is enabled
# a autoUpdateSetting of 0 means it is disabled

if [[ $autoUpdateSetting == *"1"* ]] ; then
    echo "Found: The option to 'Automatically Check for Updates' is already enabled"
    echo "Reason: The value for 'Automatically Check for Updates' is: $autoUpdateSetting."
    echo "Expected: The value for 'Automatically Check for Updates' should be 1"
    echo "Detected: 0"
    exit 0
else
    echo "Found: The option to 'Automatically Check for Updates' is currently disabled"
    echo "Reason: The value for 'Automatically Check for Updates' is: $autoUpdateSetting."
    echo "Expected: The value for 'Automatically Check for Updates' should be 1"
    echo "Detected: 1"
    exit 1
fi
  1. Click on the Patch Information menu tree option.
  2. In our example, we’ll set the drop down box to “This issue can be repaired without downloading a patch.” Yours may differ.
  3. Set the requires reboot value.
  4. Set the Silent Install value.
  5. Click on the Patch Install Commands menu option under the Patch Installation and Removal menu tree.
  6. Click the Add button under Commands.
  7. From the Command Type dropdown, select Run A Script (if appropriate for your definition) and click the OK button.
  8. Click the Use Editor…button.
  9. Paste the script below in to the Script Content window. This is where you’ll specify how to remediate or fix what has been detected. In our example, if you want to disable automatic updates, remove the # symbol from the last line and comment out the defaults write command that sets the True flag.
#!/bin/sh
#  Apple Automatically Check for Updates Detection.sh
#  Created by Bennett Norton on 4/5/16.

# The auto update setting is found at /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled
# The detection logic has been written in another script - but the command below is what is called
# autoUpdateSetting=( $(   ) )

# an autoUpdateSetting of 1 means it is enabled
# an autoUpdateSetting of 0 means it is disabled

# to enable the automatic software check, use the following command
defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool TRUE
# to disable the automatic software check, use the following command
# defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool FALSE

  1. Click the OK button to save the rule.
  2. Click the OK button to save the custom definition.

You now have a fully functioning custom script. You’ll need to verify that your Distribution and Patch scan options are looking for the Custom Definition Types, but other than that, your clients will now report their vulnerability status on your new custom definition during their next vulnerability scan. 

No Comments

Post A Comment

ARE YOU READY TO GET STARTED?
Please fill out your information, and a specialist will reach out to discuss our services in more details.
Your Information will never be shared with any third party.
        
Free Training Videos
Register to gain access to all of our free content.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Get Started
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Additional Questions?
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Pay by PO?
Provide us your contact information and we will reach out to help you sign up by PO.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Subscribe Now
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Pay by PO
Send us your contact information and we will reach out to help you sign up by PO.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Additional Questions?
Send us your contact information and your questions and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
YOUR QUESTIONS
Get Started
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Free Training Videos
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
FIRST NAME
LAST NAME
PHONE
EMAIL
Subscribe Now
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
FIRST NAME
LAST NAME
PHONE
EMAIL