mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 07:35:45 -06:00
Chore: revise some of the gosec rules (#16713)
This commit is contained in:
parent
51a98565dc
commit
c1289b308f
@ -144,7 +144,7 @@ func downloadFile(pluginName, filePath, url string) (err error) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
resp, err := http.Get(url)
|
resp, err := http.Get(url) // #nosec
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ func extractFiles(body []byte, pluginName string, filePath string) error {
|
|||||||
newFile := path.Join(filePath, RemoveGitBuildFromName(pluginName, zf.Name))
|
newFile := path.Join(filePath, RemoveGitBuildFromName(pluginName, zf.Name))
|
||||||
|
|
||||||
if zf.FileInfo().IsDir() {
|
if zf.FileInfo().IsDir() {
|
||||||
err := os.Mkdir(newFile, 0777)
|
err := os.Mkdir(newFile, 0755)
|
||||||
if permissionsError(err) {
|
if permissionsError(err) {
|
||||||
return fmt.Errorf(permissionsDeniedMessage, newFile)
|
return fmt.Errorf(permissionsDeniedMessage, newFile)
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Unknwon/com"
|
"github.com/Unknwon/com"
|
||||||
|
|
||||||
m "github.com/grafana/grafana/pkg/models"
|
m "github.com/grafana/grafana/pkg/models"
|
||||||
"github.com/grafana/grafana/pkg/setting"
|
"github.com/grafana/grafana/pkg/setting"
|
||||||
)
|
)
|
||||||
|
@ -39,4 +39,7 @@ exit_if_fail go vet ./pkg/...
|
|||||||
exit_if_fail revive -formatter stylish -config ./scripts/revive.toml
|
exit_if_fail revive -formatter stylish -config ./scripts/revive.toml
|
||||||
|
|
||||||
# TODO recheck the rules and leave only necessary exclusions
|
# TODO recheck the rules and leave only necessary exclusions
|
||||||
#exit_if_fail gosec -quiet -exclude=G104,G107,G201,G202,G204,G301,G302,G304,G402,G501,G505,G401 ./pkg/...
|
# exit_if_fail gosec -quiet \
|
||||||
|
# -exclude=G104,G107,G201,G202,G204,G301,G304,G401,G402,G501 \
|
||||||
|
# -conf=./scripts/gosec.json \
|
||||||
|
# ./pkg/...
|
||||||
|
4
scripts/gosec.json
Normal file
4
scripts/gosec.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"G302": "0660",
|
||||||
|
"G301": "0755"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user