Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBOM #277

Open
totaam opened this issue Jan 11, 2024 · 1 comment
Open

SBOM #277

totaam opened this issue Jan 11, 2024 · 1 comment

Comments

@totaam
Copy link
Collaborator

totaam commented Jan 11, 2024

Just like Xpra-org/xpra#4050

@TijZwa
Copy link
Collaborator

TijZwa commented Mar 4, 2024

@totaam fyi; I'm using OWASP Dependecy Track (https://dependencytrack.org/)
I'm using the following action to feed it the SBOM:

name: Create sbom on release
on:
  push:
      branches:
        - 'main'
jobs:
  Sbom:
    runs-on: <Agent>
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Create CycloneDX sbom
        run: dotnet-CycloneDX <project> -o sbom
      - name: Upload sbom
        env:
           PROJECTGUID: ${{ vars.PROJECTGUID }}
           APIKEY: ${{ secrets.API_KEY }}      
        run: |
          $xml = Get-Content ".\sbom\bom.xml" -Raw
          $ProjectGuid = $Env:PROJECTGUID
          $ApiKey = $Env:APIKEY
          $Uri = "<DepTrack server>"

          $Body = ([PSCustomObject] @{
            project = $ProjectGuid
            bom     = ([Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($xml)))
          } | ConvertTo-Json)
          $Header = @{ 'X-API-Key' = $ApiKey }
          Invoke-RestMethod -Method Put -Uri "$Uri/api/v1/bom" -Headers $Header  -ContentType "application/json" -Body $Body                                    
        shell: powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@totaam @TijZwa and others