Skip to content

Commit

Permalink
Update code for backwards incompatible gosec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
seveas committed May 23, 2024
1 parent 4b47036 commit 21eac78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
command: -o HostKeyAlgorithms=ssh-ed25519
stop_signal: SIGKILL
consul-server-dc1:
image: consul:latest
image: hashicorp/consul:latest
networks:
default:
aliases:
Expand All @@ -61,7 +61,7 @@ services:
- 'CONSUL_LOCAL_CONFIG={"datacenter": "dc1", "retry_join_wan": ["consul-server-dc2.example.com"]}'
stop_signal: SIGKILL
consul-server-dc2:
image: consul:latest
image: hashicorp/consul:latest
networks:
default:
aliases:
Expand All @@ -71,7 +71,7 @@ services:
- 'CONSUL_LOCAL_CONFIG={"datacenter": "dc2", "retry_join_wan": ["consul-server-dc1.example.com"]}'
stop_signal: SIGKILL
consul-agent-dc1:
image: consul:latest
image: hashicorp/consul:latest
command: agent
environment:
- CONSUL_BIND_INTERFACE=eth0
Expand All @@ -82,7 +82,7 @@ services:
- consul-server-dc1
stop_signal: SIGKILL
consul-agent-dc2:
image: consul:latest
image: hashicorp/consul:latest
command: agent
environment:
- CONSUL_BIND_INTERFACE=eth0
Expand Down
4 changes: 2 additions & 2 deletions provider/cache/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (c *Cache) Load(ctx context.Context, lm herd.LoadingMessage) (*herd.HostSet
if data, err = json.Marshal(hosts); err != nil {
return nil, err
}
//#nosec G306 -- Cache file may be shared among users
if err := os.WriteFile(c.config.File, data, 0o644); err != nil {
err = os.WriteFile(c.config.File, data, 0o644) // #nosec G306 -- Cache file may be shared among users
if err != nil {
return nil, err
}
} else if !c.config.StrictLoading {
Expand Down
4 changes: 2 additions & 2 deletions provider/plugin/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ func (p *pluginProvider) connect() error {
Managed: true,
HandshakeConfig: common.Handshake,
Plugins: pluginMap,
Cmd: exec.Command(p.config.Command),
Cmd: exec.Command(p.config.Command), // #nosec G204 -- Cmd is user-supplied by design
Logger: common.NewLogrusLogger(logrus.StandardLogger(), fmt.Sprintf("plugin-%s", p.name)),
SyncStdout: os.Stdout,
SyncStderr: os.Stderr,
AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC},
SecureConfig: &plugin.SecureConfig{Hash: crypto.SHA256.New(), Checksum: p.config.checksum},
}) //#nosec G204 -- Cmd is user-supplied by design
})

rpcClient, err := client.Client()
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions ssh/sshfp.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package ssh

// #nosec:G505 -- We want to support sha1 fingerprints for now
import (
"crypto/sha1"
"crypto/sha1" // #nosec G505 -- We want to support sha1 fingerprints for now
"crypto/sha256"
"fmt"
"net"
Expand Down

0 comments on commit 21eac78

Please sign in to comment.