refactor(misconf): remove unused methods for ec2.Instance (#8536)

Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
This commit is contained in:
Nikita Pivkin
2025-03-13 12:43:38 +06:00
committed by GitHub
parent b57eccb09c
commit 126d6cd033
2 changed files with 1 additions and 16 deletions

2
go.mod
View File

@@ -94,7 +94,7 @@ require (
github.com/openvex/discovery v0.1.1-0.20240802171711-7c54efc57553 github.com/openvex/discovery v0.1.1-0.20240802171711-7c54efc57553
github.com/openvex/go-vex v0.2.5 github.com/openvex/go-vex v0.2.5
github.com/owenrumney/go-sarif/v2 v2.3.3 github.com/owenrumney/go-sarif/v2 v2.3.3
github.com/owenrumney/squealer v1.2.11 github.com/owenrumney/squealer v1.2.11 // indirect
github.com/package-url/packageurl-go v0.1.3 github.com/package-url/packageurl-go v0.1.3
github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/quasilyte/go-ruleguard/dsl v0.3.22
github.com/rust-secure-code/go-rustaudit v0.0.0-20250226111315-e20ec32e963c github.com/rust-secure-code/go-rustaudit v0.0.0-20250226111315-e20ec32e963c

View File

@@ -1,8 +1,6 @@
package ec2 package ec2
import ( import (
"github.com/owenrumney/squealer/pkg/squealer"
iacTypes "github.com/aquasecurity/trivy/pkg/iac/types" iacTypes "github.com/aquasecurity/trivy/pkg/iac/types"
) )
@@ -40,16 +38,3 @@ func NewInstance(metadata iacTypes.Metadata) *Instance {
EBSBlockDevices: nil, EBSBlockDevices: nil,
} }
} }
func (i *Instance) RequiresIMDSToken() bool {
return i.MetadataOptions.HttpTokens.EqualTo("required")
}
func (i *Instance) HasHTTPEndpointDisabled() bool {
return i.MetadataOptions.HttpEndpoint.EqualTo("disabled")
}
func (i *Instance) HasSensitiveInformationInUserData() bool {
scanner := squealer.NewStringScanner()
return scanner.Scan(i.UserData.Value()).TransgressionFound
}