ninxsoft / Jade-CLI

A Mac command-line tool that automatically downloads your Jamf assets.
MIT License
23 stars 2 forks source link

Not getting latest assets #3

Open grahampugh opened 3 years ago

grahampugh commented 3 years ago

It looks like the URL schema has changed. With Jade, I can only get up to 10.29.2.

I was able to obtain the latest release using this advice from MacAdmins Slack: https://macadmins.slack.com/archives/C04QVP86E/p1624221711103300?thread_ts=1624174775.097200&cid=C04QVP86E

ninxsoft commented 3 years ago

Looking into this now, thanks for the assist!

aarondavidpolley commented 3 years ago

Was coming to report also. Jamf have moved from Jamf Nation > My Assets to a new portal called Jamf Account

https://account.jamf.com/products/jamf-pro and https://account.jamf.com/products/jamf-pro/previous-versions are the web URLs that have the assets now for Pro for example. Each product has its own page.

ninxsoft commented 3 years ago

Thanks for the info @grahampugh and @aarondavidpolley - two steps forward, one step back!

It appears we now need a JAMF_ACCOUNT_SESSION cookie to access the Jamf Account API endpoints. The previous JSESSIONID cookie does not seem to be sufficient to perform new queries.

For example:

  1. The following query:

    curl --cookie "JAMF_ACCOUNT_SESSION=<<COOKIE_VALUE>>" https://account.jamf.com/api/v1/release-versions/product/jamf-pro
  2. Produces the following output:

    [ {
      "id" : 267,
      "product" : "JAMF_PRO",
      "version" : "9.0",
      "semanticVersion" : "9.0.0",
      "status" : "RELEASED",
      "releaseDate" : "2013-08-21T05:00:00.000Z",
      "currentShippingVersion" : false,
      "showPreviousVersions" : true,
      "hotfix" : false,
      "releaseNotesUrl" : "https://jamfsoftware-content.s3.amazonaws.com/downloads/Casper_Suite_Release_Notes_9.0.pdf",
      "jimVersion" : null
    }, {
      "id" : 268,
      "product" : "JAMF_PRO",
      "version" : "8.71",
      "semanticVersion" : "8.7.1",
      "status" : "RELEASED",
      "releaseDate" : "2013-06-07T05:00:00.000Z",
      "currentShippingVersion" : false,
      "showPreviousVersions" : true,
      "hotfix" : false,
      "releaseNotesUrl" : "https://jamfsoftware-content.s3.amazonaws.com/downloads/Casper_Suite_8.71_Release_Notes.pdf",
      "jimVersion" : null
    },
    // additional results truncated
    ]
  3. And by selecting a specific Product ID (eg. 267), the following query:

    curl --cookie "JAMF_ACCOUNT_SESSION=<<COOKIE_VALUE>>" https://account.jamf.com/api/v1/release-versions/267/download-links
  4. Produces the following output:

    [ {
      "id" : 586,
      "url" : "https://ci.jamfcloud.com/GM/JSSInstallerWindows9.0.zip",
      "checksum" : "a607ee7001f0ae26c47988d06d10eefa",
      "title" : "Windows"
    }, {
      "id" : 587,
      "url" : "https://ci.jamfcloud.com/GM/JSSInstallation9.0.zip",
      "checksum" : "8bf1a117df1399d36aab9927bd195557",
      "title" : "Manual"
    }, {
      "id" : 588,
      "url" : "https://ci.jamfcloud.com/GM/JSSInstallerLinux9.0.zip",
      "checksum" : "9685667621b07a1bac96ed5d01075256",
      "title" : "Linux"
    }, {
      "id" : 589,
      "url" : "https://ci.jamfcloud.com/GM/CasperSuite9.0.dmg",
      "checksum" : "41453b7d345a94934603790cf024f5a9",
      "title" : "Mac"
    } ]
  5. And lastly by selecting a specific download link ID, (eg. 586), the following query:

    curl --cookie "JAMF_ACCOUNT_SESSION=<<COOKIE_VALUE>>" https://account.jamf.com/api/v1/release-versions/267/download-links/586/signed-url
  6. Provides the unique download URL link:

    {
      "url" : "https://ci.jamfcloud.com/GM/JSSInstallerWindows9.0.zip?Expires=&Signature=&Key-Pair-Id="
    }

Unfortunately, I have not figured out a way yet to obtain the JAMF_ACCOUNT_SESSION cookie value by providing basic auth / bearer token credentials to any API endpoints or to the login form located here.

Any help is appreciated!