Skip to content

Build Provisioner From Source

Install .NET SDK

The HIRS .NET Provisioner requires the .NET SDK version 10 or later. Please follow the instructions from Microsoft for installing the .NET SDK on your system.

Tip

If you are on a RHEL or Rocky, you can use:

sudo dnf install dotnet-sdk-10.0

Tip

After installing the .NET SDK, you must restart your terminal for the environment variables to get updated.

Build the Provisioner Package

Most of the build commands for HIRS .NET Provisioner work the same way whether they are run from Windows or Linux. Location of where these commands are run matters. The directory the command should be run from is included in each section below.

  1. Checkout HIRS from Github
    git clone https://github.com/nsacyber/HIRS.git 
    
  2. restore to retrieve all dependencies required for building or testing source code
    cd <HIRS repository>/HIRS_Provisioner.NET/
    dotnet restore 
    
  3. Build and Run Unit Tests
    dotnet test 
    
  4. Install a packaging library. Depending on your choice below, you might need to install a packaging library. This step is not needed to build an MSI installer.

    dotnet tool install --global dotnet-rpm --allow-roll-forward
    
    dotnet tool install --global dotnet-deb --allow-roll-forward
    
    dotnet tool install --global dotnet-zip --allow-roll-forward
    
  5. cd to the directory

    cd <HIRS repository>/HIRS_Provisioner.NET/hirs 
    

  6. Create installation package(s)

    dotnet rpm install
    dotnet rpm -r linux-x64 -c Release  
    
    dotnet deb install
    dotnet deb -r linux-x64 -c Release   
    
    dotnet zip install
    dotnet zip -r linux-x64 -c Release   
    
    dotnet msbuild HIRS_Provisioner.NET.csproj /t:Msi /P:TargetFramework=net10.0 /p:RuntimeIdentifier=win-x64 /p:Configuration=Release 
    
    dotnet zip install
    dotnet zip -r win-x64 -c Release  
    

Info

After building, you can find the generated file(s) in the relative path (from above):

/bin/Release/net10.0/<platform>/HIRS_Provisioner.NET.*

Install the Provisioner Package

To install the Provisioner package, see the Provisioner install section.

Installation Directory

The Provisioner is installed to the following directory:

/usr/share/hirs

C:\Program Files(x86)\HIRS_Provisioner.NET