Skip to content

Commit

Permalink
replace probe with OutcomeNotApplicable
Browse files Browse the repository at this point in the history
Signed-off-by: AdamKorcz <[email protected]>
  • Loading branch information
AdamKorcz committed Nov 14, 2023
1 parent 91c15e6 commit 4359a93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 71 deletions.
73 changes: 4 additions & 69 deletions checks/evaluation/webhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,77 +112,12 @@ func TestWebhooks(t *testing.T) {
name: "Twelve webhooks none of which have secrets",
findings: []finding.Finding{
{
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "hasWebhooks",
Outcome: finding.OutcomePositive,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
}, {
Probe: "webhooksWithoutTokenAuth",
Outcome: finding.OutcomeNegative,
Values: map[string]int{
"totalWebhooks": 12,
"webhooksWithoutSecret": 12,
},
},
},
result: scut.TestReturn{
Expand Down
4 changes: 2 additions & 2 deletions probes/webhooksWithoutTokenAuth/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func Run(raw *checker.RawResults) ([]finding.Finding, string, error) {

var findings []finding.Finding

if totalWebhooks == 0 {
if len(r.Webhooks) == 0 {
f, err := finding.NewWith(fs, Probe,
"Repository has webhook without token authorization.", nil,
"Repository does not have webhooks.", nil,
finding.OutcomeNotApplicable)
if err != nil {
return nil, Probe, fmt.Errorf("create finding: %w", err)
Expand Down

0 comments on commit 4359a93

Please sign in to comment.