Skip to content

Commit

Permalink
Merge branch 'main' into feat/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hazcod authored Oct 23, 2023
2 parents eabb3a1 + ea0e609 commit f06605a
Show file tree
Hide file tree
Showing 9 changed files with 1,527 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM golang:1.20
FROM golang:1.21
13 changes: 7 additions & 6 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ builds:

archives:
-
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format: zip
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
-
id: versions
run: |
echo ::set-output name=go::$(grep '^FROM go' .github/go/Dockerfile | cut -d ' ' -f 2 | cut -d ':' -f 2)
echo "Using Go version ${{ steps.versions.outputs.go }}"
-
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ steps.versions.outputs.go }}
-
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: build --config=.github/goreleaser.yml --snapshot
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
-
uses: reviewdog/action-golangci-lint@master
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
-
uses: go-semantic-release/action@v1
with:
Expand All @@ -24,7 +24,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Unshallow
run: git fetch --prune --unshallow
Expand All @@ -35,19 +35,19 @@ jobs:
echo "Using Go version ${{ steps.versions.outputs.go }}"
-
name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ steps.versions.outputs.go }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Release
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config=.github/goreleaser.yml --clean
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Check Todos
uses: ribtoks/tdg-github-action@master
Expand Down
16 changes: 4 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@ module github.com/hazcod/crowdstrike-spotlight-slacker
go 1.16

require (
github.com/crowdstrike/gofalcon v0.2.33
github.com/crowdstrike/gofalcon v0.4.2
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.25.0 // indirect
github.com/go-openapi/spec v0.20.8 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/kelseyhightower/envconfig v1.4.0
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
github.com/slack-go/slack v0.12.1
go.mongodb.org/mongo-driver v1.11.2 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
golang.org/x/oauth2 v0.6.0
google.golang.org/protobuf v1.28.1 // indirect
github.com/sirupsen/logrus v1.9.3
github.com/slack-go/slack v0.12.3
golang.org/x/oauth2 v0.13.0
gopkg.in/errgo.v2 v2.1.0
gopkg.in/yaml.v3 v3.0.1
)
1,537 changes: 1,500 additions & 37 deletions go.sum

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions pkg/falcon/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"encoding/json"
"fmt"
"github.com/crowdstrike/gofalcon/falcon/client/hosts"
"github.com/crowdstrike/gofalcon/falcon/client/vulnerabilities"
"github.com/pkg/errors"
"math"
"strings"
"time"

"github.com/crowdstrike/gofalcon/falcon"
"github.com/crowdstrike/gofalcon/falcon/client/spotlight_vulnerabilities"
"github.com/crowdstrike/gofalcon/falcon/models"
"github.com/hazcod/crowdstrike-spotlight-slacker/config"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -176,7 +176,7 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string
return nil, nil, nil, errors.Wrap(err, "could not query all hosts")
}

allHostDetails := make([]*models.DomainDeviceSwagger, 0)
allHostDetails := make([]*models.DeviceapiDeviceSwagger, 0)

step := 100

Expand All @@ -203,7 +203,7 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string

slicePart := hostResult.Payload.Resources[sliceStart:sliceEnd]

hostDetail, err := client.Hosts.GetDeviceDetails(&hosts.GetDeviceDetailsParams{
hostDetail, err := client.Hosts.GetDeviceDetailsV2(&hosts.GetDeviceDetailsV2Params{
Ids: slicePart,
Context: ctx,
HTTPClient: nil,
Expand Down Expand Up @@ -250,8 +250,8 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string

paginationToken := ""
for {
queryResult, err := client.SpotlightVulnerabilities.CombinedQueryVulnerabilities(
&spotlight_vulnerabilities.CombinedQueryVulnerabilitiesParams{
queryResult, err := client.Vulnerabilities.CombinedQueryVulnerabilities(
&vulnerabilities.CombinedQueryVulnerabilitiesParams{
Context: ctx,
Filter: "status:'open'+suppression_info.is_suppressed:'false'",
Limit: &falconAPIMaxRecords,
Expand Down

0 comments on commit f06605a

Please sign in to comment.