Assets: Understanding the Discovery Object Hash Calculations

 

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

  

Overview

This article addresses the process of calculating object hashes in Assets objects, when using Assets Discovery tool. 



ObjectHash Attribute Calculation

Object hashes in Assets objects are calculated using MD5 hashing. The process involves concatenating attribute values based on specific configurations. Here is a detailed breakdown of how this is achieved:


Example Calculation

Consider the following configuration in the ObjectHashSettings.xml file located in the Discovery folder. This configuration is used for calculating CPUInfo objects, where all attribute values are considered since they are set to "true".

<!-- CPUInfo Attributes -->
<CPUInfo_DeviceID>true</CPUInfo_DeviceID>
<CPUInfo_CPUType>true</CPUInfo_CPUType>
<CPUInfo_CoresPerProcessor>true</CPUInfo_CoresPerProcessor>
<CPUInfo_MaxCPUSpeed>true</CPUInfo_MaxCPUSpeed>

Discovery Scan Result

Upon running a Discovery Scan, you will obtain results that include the ObjectHash attribute:

<CPUs>
   <CPUInfo>
      <ObjectHash>4C8070CB0CB1FBE4AEBC125BF31C171B</ObjectHash>
      <DeviceID>CPU0</DeviceID>
      <CPUType>Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz</CPUType>
      <CoresPerProcessor>1</CoresPerProcessor>
      <MaxCPUSpeed>2900</MaxCPUSpeed>
   </CPUInfo>
</CPUs>

Steps to Calculate ObjectHash

1.Concatenate Attribute Values: Based on the settings in ObjectHashSettings.xml, concatenate all attribute values set to "true":

CPU0Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz12900

2.Include InternalObjectHash: Prepend the concatenated value with "InternalObjectHash".

InternalObjectHashCPU0Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz12900

3. Generate MD5 Hash: Generate an MD5 hash from the new concatenated value. This hash represents the ObjectHash in the Discovery scan results.

4C8070CB0CB1FBE4AEBC125BF31C171B

The described method is consistently applied across all object types to ensure accurate and reliable object hash calculations in Assets objects.

Last modified on Oct 24, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.