feat: adding proto to the go module #130
Gosec Security Scan Result
Gosec Security Scanner Result
Details
Results:
Golang errors in file: [/github/workspace/gen/go/v1/config.pb.go]:
[line 10 : column 15] - could not import google.golang.org/protobuf/reflect/protoreflect (invalid package name: "")
[line 11 : column 12] - could not import google.golang.org/protobuf/runtime/protoimpl (invalid package name: "")
[line 12 : column 13] - could not import google.golang.org/protobuf/types/known/wrapperspb (invalid package name: "")
Golang errors in file: [/github/workspace/gen/go/v1/loader.go]:
[line 14 : column 2] - could not import github.com/ghodss/yaml (invalid package name: "")
[line 15 : column 2] - could not import google.golang.org/protobuf/encoding/protojson (invalid package name: "")
Golang errors in file: [/github/workspace/gen/go/v1/options.go]:
[line 8 : column 2] - could not import google.golang.org/protobuf/proto (invalid package name: "")
Golang errors in file: [/github/workspace/tools/env-vars-generator/main.go]:
[line 13 : column 2] - could not import github.com/iancoleman/strcase (invalid package name: "")
[line 14 : column 2] - could not import github.com/tallstoat/pbparser (invalid package name: "")
Golang errors in file: [/github/workspace/tools/go-generator/cmd/generator/main.go]:
[line 14 : column 2] - could not import github.com/iancoleman/strcase (invalid package name: "")
[line 15 : column 2] - could not import github.com/tallstoat/pbparser (invalid package name: "")
[/github/workspace/gen/go/v1/loader.go:55] - G109 (CWE-190): Potential Integer overflow made by strconv.Atoi result conversion to int16/32 (Confidence: MEDIUM, Severity: HIGH)
54: intVal, err := strconv.Atoi(val)
55: return int32(intVal), err == nil
56: }
[/github/workspace/tools/go-generator/cmd/generator/template.go:41] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
40:
41: f, err := os.Create(outputFilepath)
42: if err != nil {
[/github/workspace/tools/go-generator/cmd/generator/template.go:23] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
22:
23: content, err := os.ReadFile(fpath)
24: if err != nil {
[/github/workspace/tools/go-generator/cmd/generator/protobuf.go:20] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
19:
20: raw, err := ioutil.ReadFile(modulePath)
21: if err != nil {
[/github/workspace/tools/go-generator/cmd/generator/main.go:329] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
328: func writeToFile(filename string, content []byte) error {
329: f, err := os.Create(filename)
330: if err != nil {
[/github/workspace/tools/go-generator/cmd/generator/main.go:234] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
233: func writeLoadersForProto(cmdDir, protoFilepath, outDir, optModule, envPrefix string) error {
234: f, err := os.Open(protoFilepath)
235: if err != nil {
[/github/workspace/tools/env-vars-generator/main.go:114] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
113: func readTemplate(filepath string) ([]byte, error) {
114: hf, err := os.Open(filepath)
115: if err != nil {
[/github/workspace/tools/env-vars-generator/main.go:51] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
50: filename := flag.Arg(0)
51: f, err := os.Open(filename)
52: if err != nil {
[/github/workspace/tools/env-vars-generator/main.go:30] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
29:
30: raw, err := ioutil.ReadFile(modulePath)
31: if err != nil {
[/github/workspace/gen/go/v1/loader.go:78] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)
77: unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true}
78: fcontent, err := ioutil.ReadFile(filename)
79: if err != nil {
[/github/workspace/tools/go-generator/cmd/generator/template.go:36] - G301 (CWE-276): Expect directory permissions to be 0750 or less (Confidence: HIGH, Severity: MEDIUM)
35:
36: err = os.MkdirAll(path.Dir(outputFilepath), 0755)
37: if err != nil {
[/github/workspace/tools/go-generator/cmd/generator/main.go:353] - G301 (CWE-276): Expect directory permissions to be 0750 or less (Confidence: HIGH, Severity: MEDIUM)
352:
353: err = os.MkdirAll(path.Join(path.Dir(genDstDir), "proto", "v1"), os.ModePerm)
354: if err != nil {
Summary:
Gosec : dev
Files : 10
Lines : 2383
Nosec : 0
Issues : 12