From 29e86f17e692a95a05f14a8b3f6b103b8cb7cd36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 21:16:47 +0000 Subject: [PATCH] build(deps): bump github.com/lacework/go-sdk/v2 from 2.2.0 to 2.8.2 Bumps [github.com/lacework/go-sdk/v2](https://github.com/lacework/go-sdk) from 2.2.0 to 2.8.2. - [Release notes](https://github.com/lacework/go-sdk/releases) - [Changelog](https://github.com/lacework/go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/lacework/go-sdk/compare/v2.2.0...v2.8.2) --- updated-dependencies: - dependency-name: github.com/lacework/go-sdk/v2 dependency-version: 2.8.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 8 +- .../lacework/go-sdk/v2/api/alerts_details.go | 16 ++-- .../api/alerts_details_observationtimeline.go | 42 +++++++++ .../github.com/lacework/go-sdk/v2/api/api.go | 2 + .../github.com/lacework/go-sdk/v2/api/lql.go | 47 +++++++++- .../github.com/lacework/go-sdk/v2/api/v2.go | 68 +++++++------- .../v2/api/v2_vulnerability_observations.go | 91 +++++++++++++++++++ .../lacework/go-sdk/v2/api/version.go | 4 +- .../lacework/go-sdk/v2/lwconfig/config.go | 2 +- vendor/modules.txt | 2 +- 11 files changed, 233 insertions(+), 51 deletions(-) create mode 100644 vendor/github.com/lacework/go-sdk/v2/api/alerts_details_observationtimeline.go create mode 100644 vendor/github.com/lacework/go-sdk/v2/api/v2_vulnerability_observations.go diff --git a/go.mod b/go.mod index f4c16701a..f47646c65 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.24.2 require ( github.com/gruntwork-io/terratest v0.48.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 - github.com/lacework/go-sdk/v2 v2.2.0 + github.com/lacework/go-sdk/v2 v2.8.2 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 golang.org/x/text v0.25.0 diff --git a/go.sum b/go.sum index 89638c449..bfcb121f1 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= -github.com/aws/smithy-go v1.22.3 h1:Z//5NuZCSW6R4PhQ93hShNbyBbn8BWCmCVCt+Q8Io5k= -github.com/aws/smithy-go v1.22.3/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= +github.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw= +github.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= @@ -86,8 +86,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lacework/go-sdk/v2 v2.2.0 h1:VumYQUgLuU47T0saNjupYxkw9ZDpTu2+ol2fH71Cr50= -github.com/lacework/go-sdk/v2 v2.2.0/go.mod h1:RevKHUAN/Ue8e7UfjWqcuT71oagjxzbcMxwMLZoQlIE= +github.com/lacework/go-sdk/v2 v2.8.2 h1:A1Q17tDBHOLemrHBkfNKORS9DWLIfP58KhPqprJDvLY= +github.com/lacework/go-sdk/v2 v2.8.2/go.mod h1:XZZqajqRF2QkW34+i/uc1Fn/1Itd6dbmWFkXZnQ1XCk= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= diff --git a/vendor/github.com/lacework/go-sdk/v2/api/alerts_details.go b/vendor/github.com/lacework/go-sdk/v2/api/alerts_details.go index 60bb20678..3e633741e 100644 --- a/vendor/github.com/lacework/go-sdk/v2/api/alerts_details.go +++ b/vendor/github.com/lacework/go-sdk/v2/api/alerts_details.go @@ -34,15 +34,17 @@ const ( AlertRelatedAlertsScope AlertIntegrationsScope AlertTimelineScope + AlertObservationTimelineScope ) var AlertScopes = map[alertScope]string{ - AlertDetailsScope: "Details", - AlertInvestigationScope: "Investigation", - AlertEventsScope: "Events", - AlertRelatedAlertsScope: "RelatedAlerts", - AlertIntegrationsScope: "Integrations", - AlertTimelineScope: "Timeline", + AlertDetailsScope: "Details", + AlertInvestigationScope: "Investigation", + AlertEventsScope: "Events", + AlertRelatedAlertsScope: "RelatedAlerts", + AlertIntegrationsScope: "Integrations", + AlertTimelineScope: "Timeline", + AlertObservationTimelineScope: "ObservationTimeline", } func (i alertScope) String() string { @@ -72,6 +74,8 @@ func (svc *AlertsService) Get(id int, scope alertScope) (interface{}, error) { return svc.GetIntegrations(id) case AlertTimelineScope: return svc.GetTimeline(id) + case AlertObservationTimelineScope: + return svc.GetObservationTimeline(id) default: return nil, errors.New(fmt.Sprintf("alert scope (%s) not recognized", scope)) } diff --git a/vendor/github.com/lacework/go-sdk/v2/api/alerts_details_observationtimeline.go b/vendor/github.com/lacework/go-sdk/v2/api/alerts_details_observationtimeline.go new file mode 100644 index 000000000..656bed6b4 --- /dev/null +++ b/vendor/github.com/lacework/go-sdk/v2/api/alerts_details_observationtimeline.go @@ -0,0 +1,42 @@ +// +// Author:: Lokesh Vadlamudi () +// Copyright:: Copyright 2025, Fortinet Inc. +// License:: Apache License, Version 2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package api + +import ( + "fmt" +) + +type AlertObservationTimeline map[string]interface{} + +type AlertObservationTimelineResponse struct { + Data []AlertObservationTimeline `json:"data"` +} + +func (svc *AlertsService) GetObservationTimeline(id int) ( + response AlertObservationTimelineResponse, + err error, +) { + err = svc.client.RequestDecoder( + "GET", + fmt.Sprintf(apiV2AlertsDetails, id, AlertObservationTimelineScope), + nil, + &response, + ) + return +} diff --git a/vendor/github.com/lacework/go-sdk/v2/api/api.go b/vendor/github.com/lacework/go-sdk/v2/api/api.go index 6552d1367..1b2406f0b 100644 --- a/vendor/github.com/lacework/go-sdk/v2/api/api.go +++ b/vendor/github.com/lacework/go-sdk/v2/api/api.go @@ -116,6 +116,8 @@ const ( apiV2VulnerabilitiesHostsSearch = "v2/Vulnerabilities/Hosts/search" apiV2VulnerabilitiesSoftwarePackagesScan = "v2/Vulnerabilities/SoftwarePackages/scan" + apiV2VulnerabilityObservationsImageSummarySearch = "v2/VulnerabilityObservations/ImageSummary/search" + apiV2VulnerabilityExceptions = "v2/VulnerabilityExceptions" apiV2VulnerabilityExceptionFromGUID = "v2/VulnerabilityExceptions/%s" diff --git a/vendor/github.com/lacework/go-sdk/v2/api/lql.go b/vendor/github.com/lacework/go-sdk/v2/api/lql.go index ae476d4db..4895b992c 100644 --- a/vendor/github.com/lacework/go-sdk/v2/api/lql.go +++ b/vendor/github.com/lacework/go-sdk/v2/api/lql.go @@ -28,9 +28,42 @@ import ( "gopkg.in/yaml.v3" ) +type providerType int +type providerTypes map[providerType]string + +const ( + Agent providerType = iota + APA + AWS + Azure + CIEM + GCP + K8s + OCI +) + +var ValidProviderTypes = providerTypes{ + Agent: "Agent", + APA: "APA", + AWS: "AWS", + Azure: "Azure", + CIEM: "CIEM", + GCP: "GCP", + K8s: "K8s", + OCI: "OCI", +} + +type UsageContext struct { + Providers []string `json:"providers,omitempty" yaml:"providers,omitempty"` + Policies []string `json:"policies,omitempty" yaml:"policies,omitempty"` +} + type NewQuery struct { - QueryID string `json:"queryId" yaml:"queryId"` - QueryText string `json:"queryText" yaml:"queryText"` + QueryID string `json:"queryId" yaml:"queryId"` + QueryText string `json:"queryText" yaml:"queryText"` + QueryName string `json:"queryName,omitempty" yaml:"queryName,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + UsageContext UsageContext `json:"usageContext,omitempty" yaml:"usageContext,omitempty"` } func ParseNewQuery(s string) (NewQuery, error) { @@ -54,7 +87,10 @@ func ParseNewQuery(s string) (NewQuery, error) { } type UpdateQuery struct { - QueryText string `json:"queryText"` + QueryText string `json:"queryText"` + QueryName string `json:"queryName,omitempty" yaml:"queryName,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + UsageContext UsageContext `json:"usageContext,omitempty" yaml:"usageContext,omitempty"` } type Query struct { @@ -64,6 +100,11 @@ type Query struct { LastUpdateTime string `json:"lastUpdateTime"` LastUpdateUser string `json:"lastUpdateUser"` ResultSchema []map[string]interface{} `json:"resultSchema"` + QueryName string `json:"queryName,omitempty" yaml:"queryName,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + UsageContext UsageContext `json:"usageContext,omitempty" yaml:"usageContext,omitempty"` + Providers []string `json:"providers,omitempty" yaml:"providers,omitempty"` + UsedByPolicies []string `json:"usedByPolicies,omitempty" yaml:"usedByPolicies,omitempty"` } type QueryResponse struct { diff --git a/vendor/github.com/lacework/go-sdk/v2/api/v2.go b/vendor/github.com/lacework/go-sdk/v2/api/v2.go index cb44328f1..d4f421adf 100644 --- a/vendor/github.com/lacework/go-sdk/v2/api/v2.go +++ b/vendor/github.com/lacework/go-sdk/v2/api/v2.go @@ -32,39 +32,40 @@ type V2Endpoints struct { client *Client // Every schema must have its own service - UserProfile *UserProfileService - AlertChannels *AlertChannelsService - Alert *v2alertProfilesService - AlertRules *AlertRulesService - ReportRules *ReportRulesService - CloudAccounts *CloudAccountsService - Components *ComponentsService - ComponentData *ComponentDataService - ContainerRegistries *ContainerRegistriesService - Configs *v2ConfigService - FeatureFlags *FeatureFlagsService - ResourceGroups *ResourceGroupsService - AgentAccessTokens *AgentAccessTokensService - AgentInfo *AgentInfoService - Inventory *InventoryService - ComplianceEvaluations *ComplianceEvaluationService - Query *QueryService - OrganizationInfo *OrganizationInfoService - Policy *PolicyService - Reports *ReportsService - ReportDefinitions *ReportDefinitionsService - Metrics *MetricsService - ReportDistributions *ReportDistributionsService - Entities *EntitiesService - Schemas *SchemasService - Datasources *DatasourcesService - DataExportRules *DataExportRulesService - TeamMembers *TeamMembersService - VulnerabilityExceptions *VulnerabilityExceptionsService - Vulnerabilities *v2VulnerabilitiesService - Alerts *AlertsService - Suppressions *SuppressionsServiceV2 - Recommendations *RecommendationsServiceV2 + UserProfile *UserProfileService + AlertChannels *AlertChannelsService + Alert *v2alertProfilesService + AlertRules *AlertRulesService + ReportRules *ReportRulesService + CloudAccounts *CloudAccountsService + Components *ComponentsService + ComponentData *ComponentDataService + ContainerRegistries *ContainerRegistriesService + Configs *v2ConfigService + FeatureFlags *FeatureFlagsService + ResourceGroups *ResourceGroupsService + AgentAccessTokens *AgentAccessTokensService + AgentInfo *AgentInfoService + Inventory *InventoryService + ComplianceEvaluations *ComplianceEvaluationService + Query *QueryService + OrganizationInfo *OrganizationInfoService + Policy *PolicyService + Reports *ReportsService + ReportDefinitions *ReportDefinitionsService + Metrics *MetricsService + ReportDistributions *ReportDistributionsService + Entities *EntitiesService + Schemas *SchemasService + Datasources *DatasourcesService + DataExportRules *DataExportRulesService + TeamMembers *TeamMembersService + VulnerabilityExceptions *VulnerabilityExceptionsService + Vulnerabilities *v2VulnerabilitiesService + VulnerabilityObservations *v2VulnerabilityObservationsService + Alerts *AlertsService + Suppressions *SuppressionsServiceV2 + Recommendations *RecommendationsServiceV2 } func NewV2Endpoints(c *Client) *V2Endpoints { @@ -99,6 +100,7 @@ func NewV2Endpoints(c *Client) *V2Endpoints { &TeamMembersService{c}, &VulnerabilityExceptionsService{c}, NewV2VulnerabilitiesService(c), + NewV2VulnerabilityObservationsService(c), &AlertsService{c}, &SuppressionsServiceV2{c, &AwsSuppressionsV2{c}, diff --git a/vendor/github.com/lacework/go-sdk/v2/api/v2_vulnerability_observations.go b/vendor/github.com/lacework/go-sdk/v2/api/v2_vulnerability_observations.go new file mode 100644 index 000000000..6ef3cf8a4 --- /dev/null +++ b/vendor/github.com/lacework/go-sdk/v2/api/v2_vulnerability_observations.go @@ -0,0 +1,91 @@ +package api + +const TimestampLayout = "2006-01-02 15:04:05.000 Z" + +type v2VulnerabilityObservationsService struct { + client *Client + ImageSummary *v2VulnerabilityObservationImageSummaryService +} + +func NewV2VulnerabilityObservationsService(c *Client) *v2VulnerabilityObservationsService { + return &v2VulnerabilityObservationsService{c, + &v2VulnerabilityObservationImageSummaryService{c}, + } +} + +type v2VulnerabilityObservationImageSummaryService struct { + client *Client +} + +func (svc *v2VulnerabilityObservationImageSummaryService) Search(filters SearchFilter) ( + response VulnerabilityObservationsImageSummaryResponse, err error, +) { + err = svc.client.RequestEncoderDecoder( + "POST", apiV2VulnerabilityObservationsImageSummarySearch, + filters, &response, + ) + return +} + +func (svc *v2VulnerabilityObservationImageSummaryService) SearchAllPages(filters SearchFilter) ( + response VulnerabilityObservationsImageSummaryResponse, err error, +) { + response, err = svc.Search(filters) + if err != nil { + return + } + + var ( + all []VulnerabilityObservationsImageSummary + pageOk bool + ) + for { + all = append(all, response.Data...) + + pageOk, err = svc.client.NextPage(&response) + if err == nil && pageOk { + continue + } + break + } + + response.ResetPaging() + response.Data = all + return +} + +type VulnerabilityObservationsImageSummaryResponse struct { + Data []VulnerabilityObservationsImageSummary `json:"data"` + Paging V2Pagination `json:"paging"` + + v2PageMetadata `json:"-"` +} + +type VulnerabilityObservationsImageSummary struct { + ContainerCount int `json:"containerCount"` + Digest string `json:"digest"` + ImageId string `json:"imageId"` + LastScanTime string `json:"lastScanTime"` + Registry string `json:"registry"` + Repository string `json:"repository"` + Tag string `json:"tag"` + ScanStatus string `json:"scanStatus"` + VulnCountCritical int `json:"vulnCountCritical"` + VulnCountCriticalFixable int `json:"vulnCountCriticalFixable"` + VulnCountHigh int `json:"vulnCountHigh"` + VulnCountHighFixable int `json:"vulnCountHighFixable"` + VulnCountMedium int `json:"vulnCountMedium"` + VulnCountMediumFixable int `json:"vulnCountMediumFixable"` + VulnCountLow int `json:"vulnCountLow"` + VulnCountLowFixable int `json:"vulnCountLowFixable"` + VulnCountInfo int `json:"vulnCountInfo"` + VulnCountInfoFixable int `json:"vulnCountInfoFixable"` +} + +func (r VulnerabilityObservationsImageSummaryResponse) PageInfo() *V2Pagination { + return &r.Paging +} +func (r *VulnerabilityObservationsImageSummaryResponse) ResetPaging() { + r.Paging = V2Pagination{} + r.Data = nil +} diff --git a/vendor/github.com/lacework/go-sdk/v2/api/version.go b/vendor/github.com/lacework/go-sdk/v2/api/version.go index 80dc52679..54058a3de 100644 --- a/vendor/github.com/lacework/go-sdk/v2/api/version.go +++ b/vendor/github.com/lacework/go-sdk/v2/api/version.go @@ -1,5 +1,5 @@ // Code generated by: scripts/version_updater.sh -// File generated at: 20250610205956 +// File generated at: 20251021194243 // // <<< DO NOT EDIT >>> // @@ -7,4 +7,4 @@ package api // Version is the semver coming from the VERSION file -const Version = "2.2.0" +const Version = "2.8.2" diff --git a/vendor/github.com/lacework/go-sdk/v2/lwconfig/config.go b/vendor/github.com/lacework/go-sdk/v2/lwconfig/config.go index 5a0d2b374..dba9deca8 100644 --- a/vendor/github.com/lacework/go-sdk/v2/lwconfig/config.go +++ b/vendor/github.com/lacework/go-sdk/v2/lwconfig/config.go @@ -62,7 +62,7 @@ type Profile struct { } const ( - ApiKeyMinLength = 55 + ApiKeyMinLength = 34 ApiSecretMinLength = 30 ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 85097c946..5e3111e54 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -160,7 +160,7 @@ github.com/klauspost/compress/internal/cpuinfo github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/lacework/go-sdk/v2 v2.2.0 +# github.com/lacework/go-sdk/v2 v2.8.2 ## explicit; go 1.24.0 github.com/lacework/go-sdk/v2/api github.com/lacework/go-sdk/v2/internal/array