Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Fix hash handling jira consumer (#90)
Browse files Browse the repository at this point in the history
* fixed bug where only the jira consumer would ignore hashes

* styling
  • Loading branch information
northdpole authored Mar 3, 2021
1 parent 40d1ed7 commit a8e9ced
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions common/jira/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewRaw(scanStartTime time.Time, res *v1.LaunchToolResponse, iss *v1.Issue)
FirstFound: scanStartTime,
Count: "1",
FalsePositive: "false",
Hash: "",
Hash: "",
// The fields below are not used in this consumer. We use the text versions instead.
// Severity: iss.GetSeverity(),
// Confidence: iss.GetConfidence(),
Expand Down Expand Up @@ -57,7 +57,7 @@ func NewEnriched(scanStartTime time.Time, res *v1.EnrichedLaunchToolResponse, is
FirstFound: firstSeenTime,
Count: strconv.Itoa(int(iss.GetCount())), // formatted as string
FalsePositive: strconv.FormatBool(iss.GetFalsePositive()), // formatted as string
Hash: iss.GetHash(),
Hash: iss.GetHash(),
// The fields below are not used in this consumer. We use the text versions instead.
// Severity: iss.GetRawIssue().GetSeverity(),
// Confidence: iss.GetRawIssue().GetConfidence(),
Expand Down
2 changes: 1 addition & 1 deletion common/jira/document/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Document struct {
FirstFound time.Time `json:"first_found"`
Count string `json:"count"`
FalsePositive string `json:"false_positive"`
Hash string `json:"hash"`
Hash string `json:"hash"`
// The fields below are not used in this consumer. We use the text versions instead.
// Severity v1.Severity `json:"severity"`
// Confidence v1.Confidence `json:"confidence"`
Expand Down
2 changes: 2 additions & 0 deletions common/jira/jira/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package jira
import (
"io/ioutil"
"log"

"github.com/andygrunwald/go-jira"

"github.com/thought-machine/dracon/common/jira/config"
)

Expand Down
5 changes: 3 additions & 2 deletions consumers/jira_c/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package utils

import (

"encoding/json"
"log"

"github.com/golang/protobuf/ptypes"
"github.com/thought-machine/dracon/consumers"

v1 "github.com/thought-machine/dracon/api/proto/v1"
"github.com/thought-machine/dracon/common/jira/document"
"github.com/thought-machine/dracon/consumers"
)

// ProcessMessages processess all the v1.LaunchToolResponses (or v1.EnrichedToolResponses if consumers.Raw is false) and returns:
Expand Down
1 change: 0 additions & 1 deletion consumers/jira_c/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func TestProcessRawMessages(t *testing.T) {
"count": "1",
"false_positive": "false",
"hash":""}

response := []*v1.LaunchToolResponse{
&v1.LaunchToolResponse{
ToolName: "test",
Expand Down

0 comments on commit a8e9ced

Please sign in to comment.