GithubHelp home page GithubHelp logo

siemens / continuous-clearing Goto Github PK

View Code? Open in Web Editor NEW
20.0 7.0 9.0 13.59 MB

The Continuous Clearing Tool scans and collects the 3rd party OSS components used in a NPM/NuGet/Debian/Maven/Python/Conan/Aipine project and uploads it to SW360 and Fossology by accepting respective project ID for license clearing.

License: MIT License

Batchfile 0.10% Dockerfile 0.12% C# 99.49% PowerShell 0.29%
container cyclonedx docker nuget-package sbom license-clearing maven npm nuget python

continuous-clearing's Introduction

Build & Test Docker-publish Publish NuGet Packages

Introduction

The Continuous Clearing Tool scans and collects the 3rd party OSS components used in a NPM/NuGet/Maven/Python/Debian and uploads it to SW360 and Fossology by accepting respective project ID for license clearing.

The tool helps the developer/project manager to enable the clearing process faster by reducing the manual effort of creating SW360 and FOSSology workflows.

Continuous Clearing Tool for SBOM :

To secure overall DevOps supply chain, we need to ensure that the coding is secure and other mandatory security aspects is integrated in Software development lifecycle from beginning to end. To ensure such practises are in place, we need to provide software bill of material ( SBOM ) for every automated build in DevOps chain. This SBOM will contain all the first and 3rd party components details including dependencies such as development,transitive and internal.

This tool has been logically split into 3 different executables that enable it to be used as separate modules as per the user's requirement.

Note: Continuous Clearing Tool internally uses Syft for component detection for debian type projects.

SEPP Integration with Continuous Clearing Tool

The Continuous Clearing Tool incorporates SEPP tool functionalities, seamlessly integrated into the Artifactory uploader. This integration ensures

  • Software License Clearing is done.
  • No pre-release versions of re-use components are used.
  • Trace-ability is guaranteed

What is SEPP tool performing currently ?

  • Check for third-party packages in artifactory
  • Move internal packages from energy-dev- to energy-release- repos/
  • Clone Git repositories.
  • Export JSON file for Long term Archiving (LTA-Export)

What are the existing functionalities of Continuous Clearing Tool ?

  • Check for third party packages
  • Identification of correct source code from github
  • Creating third party components in SW360
  • Triggering source code scan in FOSSology
  • Copy cleared third party components from remote repo to SIPARTY release repo.

Which functionality of SEPP did Continuous Clearing adapt newly ?

  • Move internal packages from energy-dev-* to energy-release-* repos
  • Copy development dependency packages to siparty-devdep-* repos

What happens to SEPP now ?

Currently LTA support is not provided for SBOM, hence until that is implemented SEPP will coexist with continuous clearing tool .Once the implementation is done SEPP will eventually phase out.

Package Installation

Install from GitHub Release (Official)

Use container image

docker pull ghcr.io/siemens/continuous-clearing

Use Binary

Download the .nupkg file from GitHub Releases

Execution via terminal

The Continuous Clearing Tool has 3 executables.

you can run Continuous Clearing Tool as container or as a dotnet package,

Run as container

Execute them in the following order to achieve the complete License clearing process.

  1. Package Identifier - This executable takes Package file or a cycloneDX BOM as input and provides a SBOM file as output. For each of the component the dependency classification (development,internal) and the availability in jfrog artifactory is identified and added in the SBOM file.
docker run --rm -it -v /path/to/InputDirectory:/mnt/Input -v /path/to/OutputDirectory:/mnt/Output -v /path/to/LogDirectory:/var/log -v /path/to/configDirectory:/etc/CATool ghcr.io/siemens/continuous-clearing dotnet PackageIdentifier.dll --settingsfilepath /etc/CATool/appSetting.json
  • Input (i.e., /path/to/InputDirectory -> place to keep input files)
  • Output (i.e.,/path/to/OutputDirectory -> resulted files will be stored here)
  • Log (i.e., /path/to/logDirectory -> logs will be stored here)
  • Configuration (i.e., /path/to/ConfigDirectory -> place to keep the Config files i.e appSetting.json)
  1. SW360 Package Creator - This executable expects the CycloneDX BOM as the input, creates the missing components/releases in SW360 and links all the components to the respective project in SW360 portal and triggers the fossology upload.

Note: By default the SBOM contains both dev and non dev dependent components. Hence while creating the components in Sw360 make sure to set the RemoveDevDependency flag as true to skip creating the development dependent components.

docker run --rm -it -v /path/to/OutputDirectory:/mnt/Output -v /path/to/LogDirectory:/var/log -v /path/to/configDirectory:/etc/CATool ghcr.io/siemens/continuous-clearing dotnet SW360PackageCreator.dll --settingsfilepath /etc/CATool/appSetting.json
  1. Artifactory Uploader - This executable takes CycloneDX BOM which is updated by the SW360PackageCreator.dll as input and uploads the components that are already cleared (clearing state - "Report approved") to the SIPARTY release repo in Jfrog Artifactory.
 docker run --rm -it -v /path/to/OutputDirectory:/mnt/Output -v /path/to/LogDirectory:/var/log -v /path/to/configDirectory:/etc/CATool ghcr.io/siemens/continuous-clearing dotnet ArtifactoryUploader.dll --settingsfilepath /etc/CATool/appSetting.json
Run as dotnet package

Extract the downloaded .nupkg package , execute the following commands inside the tools folder.

  1. Package Identifier - This executable takes Package file as input and provides a CycloneDX BOM file as output. For each of the component the dependency classification (development,internal) and the availability in jfrog artifactory is identified and added in the BOM file.
  PackageIdentifier.exe --settingsfilepath /<Config_Path>/appSetting.json
  1. SW360 Package Creator - This executable expects the CycloneDX BOM as the input, creates the missing components/releases in SW360 and links all the components to the respective project in SW360 portal and triggers the fossology upload.

Note: By default the SBOM contains both dev and non dev dependent components. Hence while creating the components in Sw360 make sure to set the RemoveDevDependency flag as true to skip creating the development dependent components.

 SW360PackageCreator.exe --settingsfilepath /<Config_Path>/appSetting.json
  1. Artifactory Uploader - This executable takes CycloneDX BOM which is updated by the SW360PackageCreator.dll as input and uploads the components that are already cleared (clearing state - "Report approved") to the SIPARTY release repo in Jfrog Artifactory.
  ArtifactoryUploader.exe --settingsfilepath /<Config_Path>/appSetting.json

Detailed insight on configuration and execution is provided in Usage Doc.

Note: ArtifactoryUploader is not applicable for Debian clearing.

Development

These instructions will get the project up and running on your local machine for development and testing purposes.

Prerequisite

  1. Download Visual Studio 2022.
  2. Download Docker latest version.
  3. Docker image of continuous Clearing tool to be loaded locally.

Building via .NET SDK

  • Clone the repo in your local directory
  • Inside the src folder, execute the following command to build the source code :
dotnet build --configuration Release

Creating Docker image

Execute the following command inside the project's root directory where the Dockerfile is present to create an image :

docker build -t <DockerImageName> -f Dockerfile .

Creating Dotnet package

Execute the following command inside the project's root directory :

nuget pack CA.nuspec

Contribute

Improvements are always welcome! Feel free to log a bug, write a suggestion or contribute code via merge request. To build and test the solution locally you should have .NET Core 6 installed. All details are listed in our contribution guide. See CONTRIBUTING.md.

License

Code and documentation under MIT License

Third-party software components list:

Copyright 2023 Siemens AG

continuous-clearing's People

Contributors

adityanarayanp avatar crvreddy avatar karthika-g avatar kmadanreddy avatar madanreddyk avatar nihalbarick13 avatar prasenjeetnath avatar prethyushp avatar ragavareddychalapala avatar sumanthkb44 avatar thomaspiskol avatar vijayalakshmi027 avatar wagnermarco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

continuous-clearing's Issues

update nuget packages accross projects

in the vs solution, some projects are using nuget packages meant for .NET 3.1. other for 6.0 or even 7.0
consolidate the packages to target .NET 6.0 as the output of your app.

PackageIdentifier is missing a proper option management on start

running the PackageIdentifier.exe without any option throws an exception:

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.DirectoryNotFoundException: Invalid folder path -/mnt/Input at LCT.Common.FolderAction.ValidateFolderPath(String folderPath) in C:\Users\z0045k0r\source\repos\continuous-clearing\src\LCT.Common\FolderAction.cs:line 75 at LCT.Common.CommonAppSettings.set_PackageFilePath(String value) in C:\Users\z0045k0r\source\repos\continuous-clearing\src\LCT.Common\CommonAppSettings.cs:line 123

consider a proper list of options to be set for the program to run gently.

Unable to use self-hosted runner.

Hi Team,
The self-hosted agents are showing disabled in runner (Self-hosted runners were disabled by your organization admin.). Can you please enable it?
github runner

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.