Skip to content

Commit

Permalink
Openai report output (#210)
Browse files Browse the repository at this point in the history
* Improvements in code coverage
* Refacotored to support multiple enrichers
* Experimental openai enrichment, Retreives vulnerability explainations from OpenAI
* Updates dependencies and versions
* Adds enrich flag to CLI
* Adds AI rendered html report
* Changes http client to resty
* Fixes test cases for Snyk
* Fixes latest version check
* Fixes epss test cases and moves epss requests to resty
  • Loading branch information
djschleen committed Aug 15, 2024
1 parent 79b5dc7 commit 529c88e
Show file tree
Hide file tree
Showing 56 changed files with 396,373 additions and 917 deletions.
26 changes: 16 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "devcontainer-test",
"name": "bomber",
"image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm",
"features": {
"ghcr.io/devcontainers-contrib/features/starship:1": {},
"ghcr.io/azutake/devcontainer-features/go-packages-install:0": {
"packages": [
"github.com/devops-kung-fu/hookz@latest",
"github.com/jandelgado/gcov2lcov@latest",
"github.com/kisielk/errcheck@latest",
"github.com/fzipp/gocyclo/cmd/gocyclo@latest",
Expand All @@ -17,9 +16,12 @@
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.customGlyphs": true,
"terminal.integrated.fontFamily": "'0xProto Nerd Font', 'Droid Sans Mono', 'monospace', monospace",
"editor.formatOnSave": true,
"editor.fontFamily": "'0xProto Nerd Font','Courier New', monospace",
"terminal.integrated.fontFamily": "'0xProto Nerd Font','Courier New', monospace",
"notebook.output.fontFamily" : "'0xProto Nerd Font','Courier New', monospace",
"explorer.openEditors.sortOrder": "alphabetical",
"explorer.openEditors.minVisible": 0,
"go.buildTags": "",
"go.toolsEnvVars": {
"CGO_ENABLED": "0"
Expand All @@ -43,6 +45,12 @@
"source.organizeImports": "always"
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"markiscodecoverage.coverageThreshold": 95,
"markiscodecoverage.enableOnStartup": true,
"markiscodecoverage.searchCriteria": "*.lcov*"
Expand All @@ -54,17 +62,15 @@
"github.vscode-github-actions",
"aleksandra.go-group-imports",
"oderwat.indent-rainbow",
"yzhang.markdown-all-in-one",
"quicktype.quicktype",
"jebbs.plantuml",
"foxundermoon.shell-format",
"ahebrank.yaml2json",
"amazonwebservices.aws-toolkit-vscode",
"AmazonWebServices.amazon-q-vscode",
"markis.code-coverage",
//"defaltd.go-coverage-viewer",
"Gruntfuggly.todo-tree" // Highlights TODO comments"
"Gruntfuggly.todo-tree",
"esbenp.prettier-vscode"
]
}
},
"postCreateCommand": "/usr/bin/bash ./.devcontainer/post-create.sh > ~/post-create.log"
}
}
6 changes: 0 additions & 6 deletions .devcontainer/post-create.sh

This file was deleted.

33 changes: 12 additions & 21 deletions .github/workflows/go-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,31 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Setup Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
-
name: Install Dependencies
go-version: "1.22"
- name: Install Dependencies
run: |
go version
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
-
name: Test
- name: Test
run: |
go test -v -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
-
name: CodeCov
- name: CodeCov
run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
-
name: Build
- name: Build
run: go build
-
name: Vet
- name: Vet
run: go vet -v
# -
# name: staticcheck
# run: staticcheck -f stylish -checks all ./...
-
name: gocyclo
# -
# name: staticcheck
# run: staticcheck -f stylish -checks all ./...
- name: gocyclo
run: gocyclo .

22 changes: 8 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

permissions:
contents: write
Expand All @@ -12,36 +12,30 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.23"
check-latest: true
- run: go version
-
name: Generate SBOM
- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
artifact-name: bomber.cyclonedx.json
path: .
format: cyclonedx-json
-
name: Release SBOM
- name: Release SBOM
uses: anchore/sbom-action/publish-sbom@v0
with:
sbom-artifact-match: ".*\\.cyclonedx.json$"
-
name: GoReleaser Action
uses: goreleaser/goreleaser-action@v5.0.0
- name: GoReleaser Action
uses: goreleaser/goreleaser-action@v5.1.0
with:
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ coverage.html
coverage.lcov

*.log

__debug_bin*
16 changes: 6 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
project_name: bomber

builds:
-
binary: bomber
- binary: bomber
env:
- CGO_ENABLED=0
goos:
Expand All @@ -20,26 +19,23 @@ universal_binaries:
- replace: true

brews:
-
name: bomber
- name: bomber
homepage: "https://github.com/devops-kung-fu/bomber"
tap:
owner: devops-kung-fu
name: homebrew-tap
commit_author:
name: djschleen
email: djschleen@gmail.com
name: dkfm
email: admin@dkfm.io

checksum:
name_template: 'checksums.txt'
name_template: "checksums.txt"

nfpms:
-
maintainer: DevOps Kung Fu Mafia <admin@dkfm.io>
- maintainer: DevOps Kung Fu Mafia <admin@dkfm.io>
description: Scans SBOMs for security vulnerabilities.
homepage: https://github.com/devops-kung-fu/bomber
license: MPL
formats:
- deb
- rpm

49 changes: 0 additions & 49 deletions .hookz.yaml

This file was deleted.

Loading

0 comments on commit 529c88e

Please sign in to comment.