mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 03:55:50 +00:00
a0367559a7
* Fix TLS config template * Update the log message for unavailable ciphers
20 lines
622 B
Go
20 lines
622 B
Go
package main
|
|
|
|
import "text/template"
|
|
|
|
var generatedRuleTmpl = template.Must(template.New("generated").Parse(`
|
|
// New{{.Name}}TLSCheck creates a check for {{.Name}} TLS ciphers
|
|
// DO NOT EDIT - generated by tlsconfig tool
|
|
func New{{.Name}}TLSCheck(id string, conf gas.Config) (gas.Rule, []ast.Node) {
|
|
return &insecureConfigTLS{
|
|
MetaData: gas.MetaData{ID: id},
|
|
requiredType: "crypto/tls.Config",
|
|
MinVersion: {{ .MinVersion }},
|
|
MaxVersion: {{ .MaxVersion }},
|
|
goodCiphers: []string{
|
|
{{range $cipherName := .Ciphers }} "{{$cipherName}}",
|
|
{{end}}
|
|
},
|
|
}, []ast.Node{(*ast.CompositeLit)(nil)}
|
|
}
|
|
`))
|