Skip to content

Commit ee4f15e

Browse files
Merge pull request #32 from codacy/bump-gosec-2.22.7
TCE-1226 Bump Gosec 2.22.7
2 parents 07cbb2c + 15514c0 commit ee4f15e

File tree

17 files changed

+207
-803
lines changed

17 files changed

+207
-803
lines changed

.circleci/config.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
codacy: codacy/base@10.2.2
4+
codacy: codacy/base@12.2.0
55

66
workflows:
77
version: 2
@@ -12,12 +12,16 @@ workflows:
1212
- codacy/sbt:
1313
name: populate_cache
1414
persist_to_workspace: true
15-
cmd: sbt "set scalafmtUseIvy in ThisBuild := false;update"
15+
cmd: |
16+
sbt "clean;
17+
scalafmtCheckAll;
18+
Test / scalafmtCheck;
19+
scalafmtCheck;"
1620
requires:
1721
- codacy/checkout_and_version
1822
- codacy/sbt:
1923
name: check_fmt
20-
cmd: sbt "scalafmt::test;test:scalafmt::test;sbt:scalafmt::test"
24+
cmd: sbt test:scalafmt scalafmt scalafmtSbt
2125
requires:
2226
- populate_cache
2327
- codacy/sbt:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ target/
99
.DS_Store
1010
*.iml
1111
.codacy-coverage
12+
13+
14+
#Ignore vscode AI rules
15+
.github/copilot-instructions.md
16+
17+
.vscode

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM golang:1.18.10-alpine3.17 as builder
1+
FROM golang:1.23-alpine3.22 as builder
22

33
COPY doc-generation /doc-generation
44

55
WORKDIR /doc-generation
66
RUN mkdir -p /docs/description
77
RUN go run main.go -docFolder=../docs
88

9-
FROM alpine:3.17.3
9+
FROM alpine:3.22
1010

1111
COPY --from=builder /docs /docs
1212
COPY docs/tool-description.md /docs/

build.sbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
val scalaVersionNumber = "2.13.1"
1+
val scalaVersionNumber = "2.13.16"
22
val circeVersion = "0.12.3"
3-
val graalVersion = "21.2.0"
3+
val graalVersion = "22.3.3"
44

55
lazy val root = (project in file("."))
66
.enablePlugins(JavaAppPackaging)
@@ -12,11 +12,11 @@ lazy val root = (project in file("."))
1212
scalaVersion := scalaVersionNumber,
1313
test in assembly := {},
1414
libraryDependencies ++= Seq(
15-
"com.codacy" %% "codacy-analysis-cli-model" % "2.2.0",
15+
"com.codacy" %% "codacy-analysis-cli-model" % "5.2.1",
1616
"io.circe" %% "circe-core" % circeVersion,
1717
"io.circe" %% "circe-parser" % circeVersion,
18-
"com.github.scopt" %% "scopt" % "3.7.1",
19-
"org.scalatest" %% "scalatest" % "3.1.0" % Test
18+
"com.github.scopt" %% "scopt" % "4.1.0",
19+
"org.scalatest" %% "scalatest" % "3.2.19" % Test
2020
),
2121
graalVMNativeImageGraalVersion := Some(graalVersion),
2222
graalVMNativeImageOptions ++= Seq(

doc-generation/go.mod

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
module github.com/codacy/gosec-doc-generator
22

3-
go 1.18
3+
go 1.23.0
4+
5+
toolchain go1.24.5
46

57
require (
6-
github.com/codacy/codacy-engine-golang-seed v1.0.1-0.20230412094526-1a71ba69afe3
7-
github.com/securego/gosec/v2 v2.15.0
8-
golang.org/x/mod v0.10.0
8+
github.com/codacy/codacy-engine-golang-seed/v6 v6.4.0
9+
github.com/securego/gosec/v2 v2.22.7
10+
golang.org/x/mod v0.26.0
911
)
1012

1113
require (
12-
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
13-
github.com/sirupsen/logrus v1.9.0 // indirect
14-
golang.org/x/sys v0.4.0 // indirect
15-
golang.org/x/tools v0.5.0 // indirect
14+
github.com/CycloneDX/cyclonedx-go v0.9.2 // indirect
15+
github.com/ccojocar/zxcvbn-go v1.0.4 // indirect
16+
github.com/samber/lo v1.51.0 // indirect
17+
github.com/sirupsen/logrus v1.9.3 // indirect
18+
golang.org/x/sync v0.16.0 // indirect
19+
golang.org/x/sys v0.34.0 // indirect
20+
golang.org/x/text v0.27.0 // indirect
21+
golang.org/x/tools v0.35.0 // indirect
1622
)

doc-generation/go.sum

Lines changed: 48 additions & 754 deletions
Large diffs are not rendered by default.

doc-generation/main.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"sort"
1212
"strings"
1313

14-
codacy "github.com/codacy/codacy-engine-golang-seed"
14+
codacy "github.com/codacy/codacy-engine-golang-seed/v6"
1515
"golang.org/x/mod/modfile"
1616

1717
"github.com/securego/gosec/v2/rules"
@@ -57,7 +57,7 @@ func gosecVersion() (string, error) {
5757
goModFilename := "go.mod"
5858
gosecDependency := "github.com/securego/gosec/v2"
5959

60-
goMod, err := ioutil.ReadFile(goModFilename)
60+
goMod, err := os.ReadFile(goModFilename)
6161
if err != nil {
6262
return "", err
6363
}
@@ -90,9 +90,10 @@ func toCodacyPatterns(rules []rules.RuleDefinition) []codacy.Pattern {
9090

9191
for _, value := range rules {
9292
codacyPatterns = append(codacyPatterns, codacy.Pattern{
93-
PatternID: value.ID,
94-
Category: "Security",
95-
Level: "Error",
93+
ID: value.ID,
94+
Category: "Security",
95+
Level: "Error",
96+
ScanType: "SAST",
9697
})
9798
}
9899
return codacyPatterns
@@ -122,7 +123,7 @@ func createPatternsJSONFile(patterns []codacy.Pattern, toolVersion string) error
122123
tool := codacy.ToolDefinition{
123124
Name: toolName,
124125
Version: toolVersion,
125-
Patterns: patterns,
126+
Patterns: &patterns,
126127
}
127128

128129
toolAsJSON, err := json.MarshalIndent(tool, "", " ")

docs/description/G307.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
## G307
2-
Unsafe defer call of a method returning an error
2+
Poor file permissions used when creating a file with os.Create

docs/description/G401.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
## G401
2-
Detect the usage of DES, RC4, MD5 or SHA1
2+
Detect the usage of MD5 or SHA1

docs/description/G405.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## G405
2+
Detect the usage of DES or RC4

0 commit comments

Comments
 (0)