Skip to content

Commit 78c7aaa

Browse files
committed
New Build 1.2.0
1 parent 670655a commit 78c7aaa

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

cmd/wiz-semgrep-connector/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ func main() {
1515
cfg := config.LoadConfig()
1616

1717
log.Println("Starting Wiz Semgrep Collector...")
18-
log.Printf("Collection Interval: %d hours\n", cfg.FETCH_INTERVAL)
1918

2019
// Create a context that is canceled on interrupt or termination signal
2120
ctx, cancel := context.WithCancel(context.Background())

internal/scheduler/scheduler.go

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ func StartScheduler(ctx context.Context, cfg config.Config) {
4545
ticker := time.NewTicker(time.Duration(cfg.FETCH_INTERVAL) * time.Hour)
4646
defer ticker.Stop()
4747

48+
log.Printf("Collection Interval: %d hours\n", cfg.FETCH_INTERVAL)
49+
4850
for {
4951
select {
5052
case <-ticker.C:

internal/semgrep/semgrep_client.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func TransformFindings(findings SemgrepFindings) (WizFindingsSchema, error) {
171171
},
172172
ID: fmt.Sprint(finding.ID),
173173
Name: strings.Split(finding.Rule.CWE[0], ":")[0],
174-
DetailedName: finding.RuleName,
174+
DetailedName: splitRuleName(finding.RuleName),
175175
Severity: utils.CapitalizeFirstChar(finding.Severity),
176176
ExternalFindingLink: finding.LineOfCodeURL,
177177
Source: "Semgrep",
@@ -202,3 +202,10 @@ func getCloudPlatformAndProviderId(finding Finding) (string, string) {
202202

203203
return cloudPlatform, providerId
204204
}
205+
206+
func splitRuleName(input string) string {
207+
if lastDotIndex := strings.LastIndex(input, "."); lastDotIndex != -1 {
208+
return input[:lastDotIndex]
209+
}
210+
return input
211+
}

scripts/dev.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.1.0

0 commit comments

Comments
 (0)