fix: golangci fix
Some checks failed
build / build (push) Failing after 1m40s

This commit is contained in:
d3m0k1d
2026-02-19 11:03:52 +03:00
parent 7f54db0cd4
commit f628e24f58
2 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ func (f *Firewalld) Ban(ip string) error {
if err != nil {
return err
}
// #nosec G204 - ip is validated
cmd := exec.Command("firewall-cmd", "--zone=drop", "--add-source", ip, "--permanent")
output, err := cmd.CombinedOutput()
if err != nil {
@@ -61,7 +62,7 @@ func (f *Firewalld) Unban(ip string) error {
}
func (f *Firewalld) PortOpen(port int, protocol string) error {
// #nosec G204 - handle is extracted from nftables output and validated
// #nosec G204 - handle is extracted from Firewalld output and validated
if port >= 0 && port <= 65535 {
if protocol != "tcp" && protocol != "udp" {
f.logger.Error("invalid protocol")

View File

@@ -28,6 +28,7 @@ func (f *Iptables) Ban(ip string) error {
if err != nil {
return err
}
// #nosec G204 - f.config is validated above via validateConfigPath()
cmd := exec.Command("iptables", "-A", "INPUT", "-s", ip, "-j", "DROP")
output, err := cmd.CombinedOutput()
if err != nil {
@@ -70,6 +71,7 @@ func (f *Iptables) Unban(ip string) error {
if err != nil {
return err
}
// #nosec G204 - f.config is validated above via validateConfigPath()
cmd := exec.Command("iptables", "-D", "INPUT", "-s", ip, "-j", "DROP")
output, err := cmd.CombinedOutput()
if err != nil {