@@ -64,7 +64,7 @@ func (r *filePermissions) Match(n ast.Node, c *gosec.Context) (*gosec.Issue, err
64
64
65
65
// NewWritePerms creates a rule to detect file Writes with bad permissions.
66
66
func NewWritePerms (id string , conf gosec.Config ) (gosec.Rule , []ast.Node ) {
67
- mode := getConfiguredMode (conf , "G306" , 0o600 )
67
+ mode := getConfiguredMode (conf , id , 0o600 )
68
68
return & filePermissions {
69
69
mode : mode ,
70
70
pkgs : []string {"io/ioutil" , "os" },
@@ -81,7 +81,7 @@ func NewWritePerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {
81
81
// NewFilePerms creates a rule to detect file creation with a more permissive than configured
82
82
// permission mask.
83
83
func NewFilePerms (id string , conf gosec.Config ) (gosec.Rule , []ast.Node ) {
84
- mode := getConfiguredMode (conf , "G302" , 0o600 )
84
+ mode := getConfiguredMode (conf , id , 0o600 )
85
85
return & filePermissions {
86
86
mode : mode ,
87
87
pkgs : []string {"os" },
@@ -98,7 +98,7 @@ func NewFilePerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {
98
98
// NewMkdirPerms creates a rule to detect directory creation with more permissive than
99
99
// configured permission mask.
100
100
func NewMkdirPerms (id string , conf gosec.Config ) (gosec.Rule , []ast.Node ) {
101
- mode := getConfiguredMode (conf , "G301" , 0o750 )
101
+ mode := getConfiguredMode (conf , id , 0o750 )
102
102
return & filePermissions {
103
103
mode : mode ,
104
104
pkgs : []string {"os" },
0 commit comments