Skip to content

Commit

Permalink
Feature/12 sca compatibility (#168)
Browse files Browse the repository at this point in the history
* documentation update

* refactor before adding new rest client types

* refactor before adding new rest client types

* re-org

* re-org

* re-org

* re-org

* WIP

* remove logged error for Linux encryption

* DI for configs

* DI for configs

* Change for DI

* Change for DI

* DI work

* .net core upgrade

* wip

* WIP

* WIP

* config DI refactoring - untested

* update workflows .net core version

* update workflows .net core version

* update workflows .net core version

* update workflows .net core version

* refactor execution WIP

* refactor execution

* update docker to fit refactoring

* update docker to fit refactoring

* typo

* normalize binary props

* pluggable output modules

* move DI to AutoFac

* re-org

* re-org

* re-org

* re-org

* re-org to support transformer modules

* re-org

* re-org

* re-org

* re-org

* re-org

* re-org

* compiles but no transform execution yet

* transform modules impl

* extract common parts of transformation

* SCA impl prep

* refactor REST client

* SCA login functional

* SCA WIP

* SCA impl WIP

* SCA API implemented

* omit obsolete unit test

* added a few unit tests

* WIP - project info record complete

* policy violations implemented

* SCA detail output

* bug fixes

* updated config for 2.0

* prerelease doc updates

* regression and linter fixes

* fix element position error

* linter updates
  • Loading branch information
nleach999 authored Jul 18, 2022
1 parent 670cd14 commit eef0f8d
Show file tree
Hide file tree
Showing 265 changed files with 5,390 additions and 2,805 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Dotnet Core 3.1 Install
uses: actions/setup-dotnet@v1.7.2
- name: Dotnet Core Install
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1
dotnet-version: 6.*
- name: Fetch Code
uses: actions/checkout@v2
- name: Platform build win-x64
run: dotnet publish -c ReleaseWindows -o artifacts/win-x64 -r win-x64
run: dotnet publish --self-contained -c ReleaseWindows -o artifacts/win-x64 -r win-x64
- name: Platform build linux-x64
run: dotnet publish -c ReleaseLinux -o artifacts/linux-x64 -r linux-x64
run: dotnet publish --self-contained -c ReleaseLinux -o artifacts/linux-x64 -r linux-x64
- name: Run InferCsharp win-x64
uses: microsoft/infersharpaction@v1.2.1
uses: microsoft/infersharpaction@v1.3.1
id: runinfersharp-win-x64
with:
binary-path: artifacts/win-x64
Expand All @@ -36,7 +36,7 @@ jobs:
header: InferCsharp win-x64 Results
path: filtered-report.txt
- name: Run InferCsharp linux-x64
uses: microsoft/infersharpaction@v1.2.1
uses: microsoft/infersharpaction@v1.3.1
id: runinfersharp-linux-x64
with:
binary-path: artifacts/linux-x64
Expand All @@ -53,54 +53,54 @@ jobs:
build-windows:
runs-on: ubuntu-latest
steps:
- name: Dotnet Core 3.1 Install
uses: actions/setup-dotnet@v1.7.2
- name: Dotnet Core Install
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1
dotnet-version: 6.*
- name: Fetch Code
uses: actions/checkout@v2
- name: Platform build win-x64
run: dotnet publish -c ReleaseWindows -o artifacts -r win-x64
run: dotnet publish --self-contained -c ReleaseWindows -o artifacts -r win-x64


build-linux:
runs-on: ubuntu-latest
steps:
- name: Dotnet Core 3.1 Install
uses: actions/setup-dotnet@v1.7.2
- name: Dotnet Core Install
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1
dotnet-version: 6.*
- name: Fetch Code
uses: actions/checkout@v2
- name: Platform build linux-x64
run: dotnet publish -c ReleaseLinux -o artifacts -r linux-x64
run: dotnet publish --self-contained -c ReleaseLinux -o artifacts -r linux-x64


build-docker:
runs-on: ubuntu-latest
steps:
- name: Dotnet Core 3.1 Install
uses: actions/setup-dotnet@v1.7.2
- name: Dotnet Core Install
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1
dotnet-version: 6.*
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Fetch Code
uses: actions/checkout@v2
- name: Platform build linux-x64
run: dotnet publish -c ReleaseLinux -o artifacts -r linux-x64
run: dotnet publish --self-contained -c ReleaseLinux -o artifacts -r linux-x64
- name: Build Docker Container
run: docker build -f Dockerfile artifacts


unit-test:
runs-on: ubuntu-latest
steps:
- name: Dotnet Core 3.1 Install
uses: actions/setup-dotnet@v1.7.2
- name: Dotnet Core Install
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1
dotnet-version: 6.*
- name: Fetch Code
uses: actions/checkout@v2
- name: Run Tests
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
username: ${{ secrets.PACKAGE_USER }}
password: ${{ secrets.PACKAGE_PAT }}

- name: Dotnet Core 3.1 Install
uses: actions/setup-dotnet@v1.7.2
- name: Dotnet Core Install
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1
dotnet-version: 6.*


- name: Fetch Code @ tag v${{ inputs.tag }}
Expand All @@ -48,9 +48,9 @@ jobs:
ref: refs/tags/v${{ inputs.tag }}

- name: Platform build win-x64
run: dotnet publish -p:Version=${{ inputs.tag }} -c ReleaseWindows -o artifacts/win-x64 -r win-x64
run: dotnet publish --self-contained -p:Version=${{ inputs.tag }} -c ReleaseWindows -o artifacts/win-x64 -r win-x64
- name: Platform build linux-x64
run: dotnet publish -p:Version=${{ inputs.tag }} -c ReleaseLinux -o artifacts/linux-x64 -r linux-x64
run: dotnet publish --self-contained -p:Version=${{ inputs.tag }} -c ReleaseLinux -o artifacts/linux-x64 -r linux-x64

- name: Make win-x64 package
run: |
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ artifacts/
**/*.log4net

.build_tools/
**/TestResults
**/TestResults

**/DELETE*
54 changes: 0 additions & 54 deletions AMQPOutput/AMQPOutFactory.cs

This file was deleted.

27 changes: 0 additions & 27 deletions AMQPOutput/AMQPOutput.csproj

This file was deleted.

37 changes: 0 additions & 37 deletions AMQPOutput/Config/AmqpConfig.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ApplicationIcon />
<StartupObject>CxAnalytixCLI.Program</StartupObject>
<RootNamespace>CxAnalytixCLI</RootNamespace>
<Configurations>Debug;Release;ReleaseWindows;ReleaseLinux</Configurations>
<Company>Checkmarx</Company>
<Authors>Checkmarx</Authors>
<Version>0.0.0</Version>
<Description>CxAnalytix crawls and extracts vulnerability scan data from Checkmarx products.</Description>
<Copyright>Copyright (c) 2019-2022 Checkmarx. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/checkmarx-ts/CxAnalytix/wiki</PackageProjectUrl>
<PackageReadmeFile>$(SolutionDir)README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/checkmarx-ts/CxAnalytix</RepositoryUrl>
<RepositoryType></RepositoryType>
</PropertyGroup>


Expand All @@ -32,20 +38,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.14" />
<None Include="$(SolutionDir)README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AMQPOutput\AMQPOutput.csproj" />
<ProjectReference Include="..\Configuration\Configuration.csproj" />
<ProjectReference Include="..\CxAuditTrailsCrawler\CxAuditTrailsCrawler.csproj" />
<ProjectReference Include="..\CxRestClient\CxRestClient.csproj" />
<ProjectReference Include="..\Extensions\Extensions.csproj" />
<ProjectReference Include="..\Log4NetOutput\Log4NetOutput.csproj" />
<ProjectReference Include="..\MongoDBOutput\MongoDBOutput.csproj" />
<ProjectReference Include="..\OutputBootstrapper\OutputBootstrapper.csproj" />
<ProjectReference Include="..\ProjectFilter\ProjectFilter.csproj" />
<ProjectReference Include="..\TransformLogic\TransformLogic.csproj" />
<ProjectReference Include="..\..\Libs\Executive\Executive.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -58,8 +58,8 @@
</ItemGroup>

<Target Name="CopyConfigs" AfterTargets="Build">
<Copy SourceFiles="$(ProjectDir)../config_files/dotnet.exe.config;$(ProjectDir)../config_files/log.log4net" DestinationFiles="$(TargetDir)/dotnet.exe.config;$(TargetDir)/CxAnalytixCLI.log4net" />
<Copy SourceFiles="$(ProjectDir)../config_files/dotnet.exe.config;$(ProjectDir)../config_files/log.log4net" DestinationFiles="$(PublishDir)/dotnet.exe.config;$(PublishDir)/CxAnalytixCLI.log4net" />
<Copy SourceFiles="$(ProjectDir)../../config_files/dotnet.exe.config;$(ProjectDir)../../config_files/log.log4net" DestinationFiles="$(TargetDir)/cxanalytix.config;$(TargetDir)/cxanalytix.log4net" />
<Copy SourceFiles="$(ProjectDir)../../config_files/dotnet.exe.config;$(ProjectDir)../../config_files/log.log4net" DestinationFiles="$(PublishDir)/cxanalytix.config;$(PublishDir)/cxanalytix.log4net" />
</Target>

</Project>
14 changes: 14 additions & 0 deletions Applications/CxAnalytixCLI/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using CxAnalytix.Executive;
using System;


namespace CxAnalytixCLI
{
class Program
{
static void Main(string[] args)
{
ExecuteOnce.Execute();
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>7.1</LangVersion>
<Configurations>Debug;Release;ReleaseWindows;ReleaseLinux</Configurations>
<Company>Checkmarx</Company>
<Authors>Checkmarx</Authors>
<Version>0.0.0</Version>
<Description>CxAnalytix crawls and extracts vulnerability scan data from Checkmarx products.</Description>
<Copyright>Copyright (c) 2019-2022 Checkmarx. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/checkmarx-ts/CxAnalytix/wiki</PackageProjectUrl>
<PackageReadmeFile>$(SolutionDir)README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/checkmarx-ts/CxAnalytix</RepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand All @@ -27,25 +32,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.14" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AMQPOutput\AMQPOutput.csproj" />
<ProjectReference Include="..\Configuration\Configuration.csproj" />
<ProjectReference Include="..\CxAuditTrailsCrawler\CxAuditTrailsCrawler.csproj" />
<ProjectReference Include="..\Exceptions\Exceptions.csproj" />
<ProjectReference Include="..\Extensions\Extensions.csproj" />
<ProjectReference Include="..\Log4NetOutput\Log4NetOutput.csproj" />
<ProjectReference Include="..\MongoDBOutput\MongoDBOutput.csproj" />
<ProjectReference Include="..\OutputBootstrapper\OutputBootstrapper.csproj" />
<ProjectReference Include="..\ProjectFilter\ProjectFilter.csproj" />
<ProjectReference Include="..\TransformLogic\TransformLogic.csproj" />
<ProjectReference Include="..\..\Libs\Executive\Executive.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,10 +49,10 @@
</None>
</ItemGroup>

<Target Name="CopyConfigs" AfterTargets="Build">
<Copy SourceFiles="$(ProjectDir)../config_files/dotnet.exe.config;$(ProjectDir)../config_files/log.log4net" DestinationFiles="$(TargetDir)/dotnet.config;$(TargetDir)/CxAnalytixDaemon.log4net" />
<Copy SourceFiles="$(ProjectDir)../config_files/dotnet.exe.config;$(ProjectDir)../config_files/log.log4net" DestinationFiles="$(PublishDir)/dotnet.config;$(PublishDir)/CxAnalytixDaemon.log4net" />
</Target>
<Target Name="CopyConfigs" AfterTargets="Build">
<Copy SourceFiles="$(ProjectDir)../../config_files/dotnet.exe.config;$(ProjectDir)../../config_files/log.log4net" DestinationFiles="$(TargetDir)/cxanalytix.config;$(TargetDir)/cxanalytix.log4net" />
<Copy SourceFiles="$(ProjectDir)../../config_files/dotnet.exe.config;$(ProjectDir)../../config_files/log.log4net" DestinationFiles="$(PublishDir)/cxanalytix.config;$(PublishDir)/cxanalytix.log4net" />
</Target>



Expand Down
Loading

0 comments on commit eef0f8d

Please sign in to comment.