diff --git a/go.mod b/go.mod index 1c6e63c59..4a3ddd388 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 github.com/shirou/gopsutil v3.21.11+incompatible github.com/snyk/code-client-go v1.10.0 - github.com/snyk/go-application-framework v0.0.0-20240923065347-2225879c171e + github.com/snyk/go-application-framework v0.0.0-20240925082317-bae184c4f01a github.com/sourcegraph/go-lsp v0.0.0-20240223163137-f80c5dd31dfd github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index c9b1165b4..6db482902 100644 --- a/go.sum +++ b/go.sum @@ -287,8 +287,8 @@ github.com/snyk/code-client-go v1.10.0 h1:t/hBINxj4lKvoo681uGhxHBpMued/j68p2sHbB github.com/snyk/code-client-go v1.10.0/go.mod h1:orU911flV1kJQOlxxx0InUQkAfpBrcERsb2olfnlI8s= github.com/snyk/error-catalog-golang-public v0.0.0-20240809094525-c48d19c27edb h1:w9tJhpTFxWqAhLeraGsMExDjGK9x5Dwj1NRFwb+t+QE= github.com/snyk/error-catalog-golang-public v0.0.0-20240809094525-c48d19c27edb/go.mod h1:Ytttq7Pw4vOCu9NtRQaOeDU2dhBYUyNBe6kX4+nIIQ4= -github.com/snyk/go-application-framework v0.0.0-20240923065347-2225879c171e h1:WGxBh8+wVMNqP8JrUw9ocM50TR80dXQ+LyoV71ST+zE= -github.com/snyk/go-application-framework v0.0.0-20240923065347-2225879c171e/go.mod h1:LeMsRM1FxIfO/8QpOs9V/dI46ie/RAQl02ulAh6aKys= +github.com/snyk/go-application-framework v0.0.0-20240925082317-bae184c4f01a h1:9UNDG8FgDpdPwWxInsGD2VmsIfv9Ka9//h7M2u5bzTk= +github.com/snyk/go-application-framework v0.0.0-20240925082317-bae184c4f01a/go.mod h1:LeMsRM1FxIfO/8QpOs9V/dI46ie/RAQl02ulAh6aKys= github.com/snyk/go-httpauth v0.0.0-20231117135515-eb445fea7530 h1:s9PHNkL6ueYRiAKNfd8OVxlUOqU3qY0VDbgCD1f6WQY= github.com/snyk/go-httpauth v0.0.0-20231117135515-eb445fea7530/go.mod h1:88KbbvGYlmLgee4OcQ19yr0bNpXpOr2kciOthaSzCAg= github.com/sourcegraph/go-lsp v0.0.0-20240223163137-f80c5dd31dfd h1:Dq5WSzWsP1TbVi10zPWBI5LKEBDg4Y1OhWEph1wr5WQ= diff --git a/infrastructure/code/code.go b/infrastructure/code/code.go index 72279471e..16c1568ee 100644 --- a/infrastructure/code/code.go +++ b/infrastructure/code/code.go @@ -449,6 +449,7 @@ func isNoFilesError(err error) bool { _, ok := err.(noFilesError) return ok } + func (sc *Scanner) createBundle(ctx context.Context, requestId string, rootPath string, diff --git a/infrastructure/iac/iac.go b/infrastructure/iac/iac.go index 32d4e58fa..20388644b 100644 --- a/infrastructure/iac/iac.go +++ b/infrastructure/iac/iac.go @@ -378,7 +378,7 @@ func (iac *Scanner) toIssue(affectedFilePath string, issue iacIssue, fileContent Start: snyk.Position{Line: issue.LineNumber, Character: rangeStart}, End: snyk.Position{Line: issue.LineNumber, Character: rangeEnd}, }, - Message: fmt.Sprintf("%s (Snyk)", title), + Message: title, FormattedMessage: iac.getExtendedMessage(issue), Severity: iac.toIssueSeverity(issue.Severity), AffectedFilePath: affectedFilePath, diff --git a/infrastructure/iac/template/index.html b/infrastructure/iac/template/index.html index 3b75fb919..94298ecf7 100644 --- a/infrastructure/iac/template/index.html +++ b/infrastructure/iac/template/index.html @@ -21,7 +21,9 @@ + content="style-src 'self' 'nonce-{{.Nonce}}' 'nonce-ideNonce' https://fonts.googleapis.com; + script-src 'nonce-{{.Nonce}}'; + font-src 'self' https://fonts.gstatic.com;"> @@ -33,54 +35,54 @@ -
- -
-
- {{.SeverityIcon}} -

{{.Issue.AdditionalData.Title}}

+
+ +
+
+ {{.SeverityIcon}} +

{{.Issue.AdditionalData.Title}}

+
+
+
Issue
+ + {{.Issue.ID}} +
+
+
+
Description
+
+ {{.Description}}
-
-
Issue
- - {{.Issue.ID}} -
-
-
-
Description
-
- {{.Description}} -
+
+
+
Impact
+
+ {{.Issue.AdditionalData.Impact}}
-
-
Impact
-
- {{.Issue.AdditionalData.Impact}} -
+
+
+
Path
+
+
{{.Path}}
-
-
Path
-
-
{{.Path}}
-
-
-
-
-

Remediation

-
-
{{.Remediation}}
-
-
-
-

References

-
- {{range .Issue.AdditionalData.References}} - {{.}} - {{end}} -
-
-
+ + +
+

Remediation

+
+
{{.Remediation}}
+
+
+
+

References

+
+ {{range .Issue.AdditionalData.References}} + {{.}} + {{end}} +
+
+ diff --git a/infrastructure/iac/template/styles.css b/infrastructure/iac/template/styles.css index d8b91dc46..e845397e0 100644 --- a/infrastructure/iac/template/styles.css +++ b/infrastructure/iac/template/styles.css @@ -1,5 +1,14 @@ +/* this is the IntelliJ new UI default font, and it's not available on a Mac standard install */ +@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap'); + :root { - --default-font: ui-sans-serif, "SF Pro Text", "Segoe UI", "Ubuntu", Geneva, Verdana, Tahoma, sans-serif; + --default-font: "SF Pro Text", "Segoe UI", "Ubuntu", Geneva, Verdana, Tahoma, sans-serif; + --background-color: var(); + --text-color: var(); + --link-color: var(); + --scroll-bar-hover-background-color: var(#595a5c); + --horizontal-border-color: var(); + --code-background-color: var(); } ::-webkit-scrollbar { @@ -11,13 +20,37 @@ } ::-webkit-scrollbar-thumb:hover { - background: #595a5c; + background: var(--scroll-bar-hover-background-color); } body { + background-color: var(--background-color); font-family: var(--default-font); - overflow-y: auto; - overflow-x: hidden; + color: var(--text-color); +} + +section { + padding: 20px; +} + +.font-light { + font-weight: bold; +} + +a, +.link { + color: var(--link-color); +} + +.delimiter-top { + border-top: 1px solid var(--horizontal-border-color); +} + +code { + background-color: var(--code-background-color); + padding: 1px 3px; + border-radius: 4px; + font-size: 1rem } h2 { diff --git a/internal/progress/progress.go b/internal/progress/progress.go index a75f4e876..1c62dd7cd 100644 --- a/internal/progress/progress.go +++ b/internal/progress/progress.go @@ -84,7 +84,7 @@ func (t *Tracker) BeginWithMessage(title, message string) { } func (t *Tracker) ReportWithMessage(percentage int, message string) { - if time.Now().Before(t.lastReport.Add(time.Second)) || percentage <= t.lastReportPercentage { + if time.Now().Before(t.lastReport.Add(200 * time.Millisecond)) { return } progress := types.ProgressParams{