Carbon Black Install from the web

Where I work we heavily rely on autopkg & autopkgr to do the heavy lifting of our package management.

As a stop gap before going down the rabbit hole of a Hand Crafted autopkg recipe, I created a Carbon Black install Script.

I did this because Carbon Black throws some fun curveballs:

  • They Don’t give you a direct link to the latest package
  • They expect you to utilize the API to download the package
  • The URL is instance dependant

With that problem in mind I’ve created this which should work for what I want… Deploy the package upon DEP enrollment, let another team manage the updates from there forth.


To set this up you’re going to need a few things:

  • Your Carbon Black Domain
  • Your API Key

You can find your API key by:

1.Clicking on your profile (this is on the left side)

2. Selecting API Token

3. Copy the token in the grey box.

  • The Group you wish to deploy from. By default you may only have one group. If you have only one you can skip this part.

You can find this by going to:

1.Sensors on the left

2. Selecting the group you wish to deploy from

3. Look at the URL for the number after #hosts/


In the example above we’re using group 2.

Now that we’ve got all this info we’re going to configure the script above for our JSS.

  1. Logon to your JSS
  2. Click Management settings on the left.
  3. Select Computer management and click on scripts
  4. Click + to add a new script
  5. Give it a name. I’ve named it “Install Carbon Black from the web”
  6. Click the Script tab and copy and paste the above in there.
  7. Then Click Options
  8. Edit Parameter 4, 5 and 6 to show the following
  9. Click Save
  10. Click Done

Now we’re going to setup the Policy

  1. Create a new Policy
  2. Click Scripts
  3. Add the script
  4. Enter in your Domain, and api key. Group can be left blank if you don’t use it
  5. Set your scope
  6. Save and test


  • dondo521 November 30, 2017 at 1:19 pm

    Hope you can help me… I have tried the script as part of a policy. I am getting these results…
    Executing Policy Carbon Black Test
    Running script…
    Script exit code: 1
    Script result: % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 1137 0 1137 0 0 2275 0 –:–:– –:–:– –:–:– 2278
    file exists!
    Archive: /private/tmp/
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    unzip: cannot find zipfile directory in one of /private/tmp/ or
    /private/tmp/, and cannot find /private/tmp/, period.
    lets install CB
    installer: Error the package path specified was invalid: ‘/private/tmp/CBsensor/CarbonBlackClientSetup.pkg’.
    Error Exit Code: 1
    Error running script: return code was 1.

    Do you know how this could be fixed?
    Thanks in advance!

    • rderewianko December 27, 2017 at 7:11 pm

      Sorry WP isn’t notifying me of new comments.

      If you haven’t gotten this working could you see if /private/tmp/ exists? and manually unzip it?


Leave a Comment