From 57761b78f3c2a9836198a3e49c0d57053ee356ca Mon Sep 17 00:00:00 2001 From: Christian Zunker <827818+czunker@users.noreply.github.com> Date: Sat, 2 Mar 2024 22:39:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Update=20PlatformInput=20(#24)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Zunker --- enum.go | 34 +++++++++++++++++++++----------- go.mod | 2 +- go.sum | 4 ++-- input.go | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 85 insertions(+), 15 deletions(-) diff --git a/enum.go b/enum.go index ba4d663..bd158d8 100644 --- a/enum.go +++ b/enum.go @@ -62,10 +62,11 @@ const ( type AdvisorySummaryOrderField string const ( - AdvisorySummaryOrderFieldID AdvisorySummaryOrderField = "ID" - AdvisorySummaryOrderFieldTitle AdvisorySummaryOrderField = "TITLE" - AdvisorySummaryOrderFieldPublished AdvisorySummaryOrderField = "PUBLISHED" - AdvisorySummaryOrderFieldScore AdvisorySummaryOrderField = "SCORE" + AdvisorySummaryOrderFieldID AdvisorySummaryOrderField = "ID" + AdvisorySummaryOrderFieldTitle AdvisorySummaryOrderField = "TITLE" + AdvisorySummaryOrderFieldPublished AdvisorySummaryOrderField = "PUBLISHED" + AdvisorySummaryOrderFieldScore AdvisorySummaryOrderField = "SCORE" + AdvisorySummaryOrderFieldRiskfactors AdvisorySummaryOrderField = "RISKFACTORS" ) // AgentOrderField @@ -326,11 +327,12 @@ const ( type CveSummaryOrderField string const ( - CveSummaryOrderFieldID CveSummaryOrderField = "ID" - CveSummaryOrderFieldTitle CveSummaryOrderField = "TITLE" - CveSummaryOrderFieldPublished CveSummaryOrderField = "PUBLISHED" - CveSummaryOrderFieldModified CveSummaryOrderField = "MODIFIED" - CveSummaryOrderFieldScore CveSummaryOrderField = "SCORE" + CveSummaryOrderFieldID CveSummaryOrderField = "ID" + CveSummaryOrderFieldTitle CveSummaryOrderField = "TITLE" + CveSummaryOrderFieldPublished CveSummaryOrderField = "PUBLISHED" + CveSummaryOrderFieldModified CveSummaryOrderField = "MODIFIED" + CveSummaryOrderFieldScore CveSummaryOrderField = "SCORE" + CveSummaryOrderFieldRiskfactors CveSummaryOrderField = "RISKFACTORS" ) // DocumentFormat @@ -582,12 +584,22 @@ const ( OrderDirectionDesc OrderDirection = "DESC" ) +// PackageType +type PackageType string + +const ( + PackageTypeOsPackage PackageType = "OS_PACKAGE" + PackageTypeApplication PackageType = "APPLICATION" +) + // PackagesOrderField type PackagesOrderField string const ( - PackagesOrderFieldName PackagesOrderField = "NAME" - PackagesOrderFieldScore PackagesOrderField = "SCORE" + PackagesOrderFieldName PackagesOrderField = "NAME" + PackagesOrderFieldScore PackagesOrderField = "SCORE" + PackagesOrderFieldFirstFound PackagesOrderField = "FIRST_FOUND" + PackagesOrderFieldRiskFactors PackagesOrderField = "RISK_FACTORS" ) // PlatformKind diff --git a/go.mod b/go.mod index d4c53fc..bff3f72 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.20.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 4718a70..2db98fc 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= diff --git a/input.go b/input.go index 71320b0..b03f273 100644 --- a/input.go +++ b/input.go @@ -7,7 +7,7 @@ package mondoogql // Input represents one of the Input structs: // -// APITokenOrder, AWSConfigurationOptionsInput, AWSEventPatternInput, AcceptLegalPolicy, AddSSHKeyRequest, AdvisoryOrder, AdvisorySummaryOrder, AgentOrder, AgentVersionFilter, AnalyseAssetVulnerabilitiesInput, AnalyseIncognitoAssetInput, ApplyExceptionForScopesInput, ApplySpacePlanInput, AssetEolFilter, AssetExploitableFilter, AssetGroupOrder, AssetLastPackageUpdateTimeInput, AssetLinkInfoInput, AssetOSRebootFilter, AssetOrder, AssetOverviewPageInfo, AssetReportInput, AssetReportPolicyOrder, AssetReportQueryOrder, AssetResourceInput, AssetSearchInput, AssetSearchSuggestionsInput, AssetSummaryOrder, AssetUpdateFilter, AssetVulnerabilityReportInput, AuditLogOrder, AwsS3ConfigurationOptionsInput, AwsScanOptions, AzureBlobConfigurationOptionsInput, AzureConfigurationOptionsInput, BigqueryConfigurationOptionsInput, BillingSessionInput, CategoriesListInput, ChangeSubscriptionPlanInput, ChecksOrder, ChecksSearchInput, CiCdJobPageInfo, CiCdProjectPageInfo, CicdProjectJobsInput, CicdProjectOrder, CicdProjectsInput, ClientIntegrationConfigurationInput, ClientIntegrationInput, ComplianceAssetOrder, ComplianceAssetsSearchInput, ComplianceControlInput, ComplianceFrameworkInput, ComplianceFrameworkMutationInput, ComplianceFrameworksInput, ContentSearchInput, ContentSearchResultItemOrder, ControlDocumentOptionsInput, ControlsOrder, ControlsSearchInput, CreateAgentInput, CreateClientIntegrationInput, CreateInvitationInput, CreateOrganizationInput, CreateServiceAccountInput, CreateSpaceInput, CveOrder, CveSummaryOrder, DeleteAPITokenInput, DeleteAgentsInput, DeleteAssetsInput, DeleteClientIntegrationInput, DeleteCustomPolicyInput, DeleteCustomQueryPackInput, DeleteProjectsInput, DeleteSSHKeyRequest, DeleteSSOProviderInput, DeleteServiceAccountsInput, DownloadBundleInput, EbsScanOptionsInput, Ec2ScanOptionsInput, EmailPreferenceInput, EnableSSOProviderInput, ExceptionGroupsInput, ExceptionMutationInput, ExceptionReviewInput, FrameworkDocumentOptionsInput, GarbageCollectAssetsConfigurationInput, GcpConfigurationOptionsInput, GcsBucketConfigurationOptionsInput, GenerateAPITokenInput, GenerateDocumentInput, GetClientIntegrationDeleteCommandInput, GetClientIntegrationTokenInput, GithubConfigurationOptionsInput, GitlabConfigurationOptionsInput, GoogleWorkspaceConfigurationOptionsInput, GroupFilter, HostConfigurationOptionsInput, HostedAwsConfigurationOptionsInput, IDSuggestionInput, IntegrationInput, IntegrationOptionsInput, IntegrationsSummaryInput, InvitationOrder, JiraConfigurationOptionsInput, JiraTicketContextInput, JiraTicketContextProjectsInput, JiraTicketContextUsersInput, K8sConfigurationOptionsInput, KeyValueInput, LibraryOrder, ListClientIntegrationsFilterInput, ListClientIntegrationsInput, ListDiscoveryResultsInput, ManagedClientsFilters, MembershipOrder, MqueryAssetDataInput, MqueryAssetScoresInput, MqueryInput, MqueryScoreInput, Ms365ConfigurationOptionsInput, OciConfigurationOptionsInput, OktaConfigurationOptionsInput, OrgViewPageInfo, OrganizationOverviewInput, PackageInput, PackagesOrder, PerformDiscoveryInput, PingIntegrationInput, PlanningMilestoneMetadataMutationInput, PlatformInput, PlatformsListInput, PolicyAddInput, PolicyAssignmentInput, PolicyDashboardStatsInput, PolicyDeleteInput, PolicyInput, PolicyReportMquerySummaryOrder, PolicyReportSummaryOrder, PostgresConfigurationOptionsInput, PropertyQueryMutationInput, PropertyQueryMutationTarget, PropertyQueryOverride, QueryPackAddInput, RatedPoliciesInput, RegistrationTokenInput, RegistrationTokenOrder, RemoveOrganizationMembershipInput, RemoveSpaceMembershipInput, ReportViewedInfo, ReportViewedInput, RevokeRegistrationTokenInput, RoleInput, S3ConfigurationOptionsInput, SSOProviderInput, ScanConfigurationInput, ScoreRange, SecurityDashboardPageInfo, ServiceAccountOrder, SetAssetAnnotationsInput, SetCustomPolicyInput, SetCustomQueryPackInput, SetOrganizationMembershipInput, SetRoleInput, SetRolesInput, SetSSOProviderInput, SetSpaceMembershipInput, SlackConfigurationOptionsInput, SnowflakeConfigurationOptionsInput, SpacePlanInput, SpacePlanQueryMutationDeltaInput, SpacePolicyReportInput, SpacePolicySummaryInput, SpaceReportInput, SpaceSettingsInput, SpaceVulnerabilitiesInput, SpaceVulnerabilityReportInput, SubscriptionItem, SuppressIntegrationMessageInput, TerminatedAssetsConfigurationInput, TicketContentInput, TicketContextInput, TicketInput, TopPolicyActionsInput, TopVulnerabilityInput, TriggerActionInput, TriggerActionOptionsInput, UnusedServiceAccountsConfigurationInput, UpdateAPITokenInput, UpdateAgentInput, UpdateClientIntegrationConfigurationInput, UpdateClientIntegrationNameInput, UpdateOrganizationInput, UpdateServiceAccountInput, UpdateSpaceInput, UpdateUserInput, VulnDashboardStatsInput, VulnerabilityDashboardPageInfo. +// APITokenOrder, AWSConfigurationOptionsInput, AWSEventPatternInput, AcceptLegalPolicy, AddSSHKeyRequest, AdvisoryFilter, AdvisoryOrder, AdvisorySummaryOrder, AgentOrder, AgentVersionFilter, AnalyseAssetVulnerabilitiesInput, AnalyseIncognitoAssetInput, ApplyExceptionForScopesInput, ApplySpacePlanInput, AssetEolFilter, AssetExploitableFilter, AssetGroupOrder, AssetLastPackageUpdateTimeInput, AssetLinkInfoInput, AssetOSRebootFilter, AssetOrder, AssetOverviewPageInfo, AssetPackageDetailsInput, AssetReportInput, AssetReportListPoliciesFilter, AssetReportPolicyOrder, AssetReportQueryOrder, AssetResourceInput, AssetSearchInput, AssetSearchSuggestionsInput, AssetSummaryOrder, AssetUpdateFilter, AssetVulnerabilityReportInput, AuditLogOrder, AwsS3ConfigurationOptionsInput, AwsScanOptions, AzureBlobConfigurationOptionsInput, AzureConfigurationOptionsInput, BigqueryConfigurationOptionsInput, BillingSessionInput, CategoriesListInput, ChangeSubscriptionPlanInput, ChecksOrder, ChecksSearchInput, CiCdJobPageInfo, CiCdProjectPageInfo, CicdProjectJobsInput, CicdProjectOrder, CicdProjectsInput, ClientIntegrationConfigurationInput, ClientIntegrationInput, ComplianceAssetOrder, ComplianceAssetsSearchInput, ComplianceControlInput, ComplianceFrameworkInput, ComplianceFrameworkMutationInput, ComplianceFrameworksInput, ContentSearchInput, ContentSearchResultItemOrder, ControlDocumentOptionsInput, ControlsOrder, ControlsSearchInput, CreateAgentInput, CreateClientIntegrationInput, CreateInvitationInput, CreateOrganizationInput, CreateServiceAccountInput, CreateSpaceInput, CveFilter, CveOrder, CveSummaryOrder, DeleteAPITokenInput, DeleteAgentsInput, DeleteAssetsInput, DeleteClientIntegrationInput, DeleteCustomPolicyInput, DeleteCustomQueryPackInput, DeleteProjectsInput, DeleteSSHKeyRequest, DeleteSSOProviderInput, DeleteServiceAccountsInput, DownloadBundleInput, EbsScanOptionsInput, Ec2ScanOptionsInput, EmailPreferenceInput, EnableSSOProviderInput, ExceptionGroupsInput, ExceptionMutationInput, ExceptionReviewInput, FrameworkDocumentOptionsInput, GarbageCollectAssetsConfigurationInput, GcpConfigurationOptionsInput, GcsBucketConfigurationOptionsInput, GenerateAPITokenInput, GenerateDocumentInput, GetClientIntegrationDeleteCommandInput, GetClientIntegrationTokenInput, GithubConfigurationOptionsInput, GitlabConfigurationOptionsInput, GoogleWorkspaceConfigurationOptionsInput, GroupFilter, HostConfigurationOptionsInput, HostedAwsConfigurationOptionsInput, IDSuggestionInput, IntegrationInput, IntegrationOptionsInput, IntegrationsSummaryInput, InvitationOrder, JiraConfigurationOptionsInput, JiraTicketContextInput, JiraTicketContextProjectsInput, JiraTicketContextUsersInput, K8sConfigurationOptionsInput, KeyValueInput, LibraryOrder, ListClientIntegrationsFilterInput, ListClientIntegrationsInput, ListDiscoveryResultsInput, ManagedClientsFilters, MembershipOrder, MqueryAssetDataInput, MqueryAssetScoresInput, MqueryInput, MqueryScoreInput, Ms365ConfigurationOptionsInput, OciConfigurationOptionsInput, OktaConfigurationOptionsInput, OrgViewPageInfo, OrganizationOverviewInput, PackageFilter, PackageInput, PackagesOrder, PerformDiscoveryInput, PingIntegrationInput, PlanningMilestoneMetadataMutationInput, PlatformInput, PlatformVulnerabilityConfigurationInput, PlatformsListInput, PolicyAddInput, PolicyAssignmentInput, PolicyDashboardStatsInput, PolicyDeleteInput, PolicyInput, PolicyReportMquerySummaryOrder, PolicyReportSummaryOrder, PostgresConfigurationOptionsInput, PropertyQueryMutationInput, PropertyQueryMutationTarget, PropertyQueryOverride, QueryPackAddInput, RatedPoliciesInput, RegistrationTokenInput, RegistrationTokenOrder, RemoveOrganizationMembershipInput, RemoveSpaceMembershipInput, ReportViewedInfo, ReportViewedInput, RevokeRegistrationTokenInput, RoleInput, S3ConfigurationOptionsInput, SSOProviderInput, ScanConfigurationInput, ScoreRange, SecurityDashboardPageInfo, ServiceAccountOrder, SetAssetAnnotationsInput, SetCustomPolicyInput, SetCustomQueryPackInput, SetOrganizationMembershipInput, SetRoleInput, SetRolesInput, SetSSOProviderInput, SetSpaceMembershipInput, SlackConfigurationOptionsInput, SnowflakeConfigurationOptionsInput, SpacePlanInput, SpacePlanQueryMutationDeltaInput, SpacePolicyReportInput, SpacePolicySummaryInput, SpaceReportInput, SpaceSettingsInput, SpaceVulnerabilitiesInput, SpaceVulnerabilityReportInput, SubscriptionItem, SuppressIntegrationMessageInput, TerminatedAssetsConfigurationInput, TicketContentInput, TicketContextInput, TicketInput, TopPolicyActionsInput, TopVulnerabilityInput, TriggerActionInput, TriggerActionOptionsInput, UnusedServiceAccountsConfigurationInput, UpdateAPITokenInput, UpdateAgentInput, UpdateClientIntegrationConfigurationInput, UpdateClientIntegrationNameInput, UpdateOrganizationInput, UpdateServiceAccountInput, UpdateSpaceInput, UpdateUserInput, VulnDashboardStatsInput, VulnerabilityDashboardPageInfo. type Input interface{} // APITokenOrder @@ -58,6 +58,13 @@ type AddSSHKeyRequest struct { Content String `json:"content"` } +// AdvisoryFilter +type AdvisoryFilter struct { + + // (Optional.) + QueryTerms *[]String `json:"queryTerms,omitempty"` +} + // AdvisoryOrder type AdvisoryOrder struct { // (Required.) @@ -201,6 +208,17 @@ type AssetOverviewPageInfo struct { Tab String `json:"tab"` } +// AssetPackageDetailsInput +type AssetPackageDetailsInput struct { + // (Required.) + Mrn ID `json:"mrn"` + // (Required.) + Name String `json:"name"` + + // (Optional.) + Version *String `json:"version,omitempty"` +} + // AssetReportInput type AssetReportInput struct { // (Required.) @@ -212,6 +230,17 @@ type AssetReportInput struct { PolicyFilter *[]*String `json:"policyFilter,omitempty"` } +// AssetReportListPoliciesFilter +type AssetReportListPoliciesFilter struct { + + // (Optional.) + Query *String `json:"query,omitempty"` + // (Optional.) + Grades *[]String `json:"grades,omitempty"` + // (Optional.) + Categories *[]String `json:"categories,omitempty"` +} + // AssetReportPolicyOrder type AssetReportPolicyOrder struct { // (Required.) @@ -706,6 +735,13 @@ type CreateSpaceInput struct { Settings *SpaceSettingsInput `json:"settings,omitempty"` } +// CveFilter +type CveFilter struct { + + // (Optional.) + QueryTerms *[]String `json:"queryTerms,omitempty"` +} + // CveOrder type CveOrder struct { // (Required.) @@ -1315,6 +1351,17 @@ type OrganizationOverviewInput struct { OrganizationMrn String `json:"organizationMrn"` } +// PackageFilter +type PackageFilter struct { + + // (Optional.) + QueryTerms *[]String `json:"queryTerms,omitempty"` + // (Optional.) + Type *PackageType `json:"type,omitempty"` + // (Optional.) + IsVulnerable *Boolean `json:"isVulnerable,omitempty"` +} + // PackageInput type PackageInput struct { // (Required.) @@ -1381,6 +1428,15 @@ type PlatformInput struct { Runtime *String `json:"runtime,omitempty"` // (Optional.) Labels *[]*KeyValueInput `json:"labels,omitempty"` + // (Optional.) + Family *[]*String `json:"family,omitempty"` +} + +// PlatformVulnerabilityConfigurationInput +type PlatformVulnerabilityConfigurationInput struct { + + // (Optional.) + Enable *Boolean `json:"enable,omitempty"` } // PlatformsListInput @@ -1837,6 +1893,8 @@ type SpaceSettingsInput struct { UnusedServiceAccountsConfiguration *UnusedServiceAccountsConfigurationInput `json:"unusedServiceAccountsConfiguration,omitempty"` // (Optional.) GarbageCollectAssetsConfiguration *GarbageCollectAssetsConfigurationInput `json:"garbageCollectAssetsConfiguration,omitempty"` + // (Optional.) + PlatformVulnerabilityConfiguration *PlatformVulnerabilityConfigurationInput `json:"platformVulnerabilityConfiguration,omitempty"` } // SpaceVulnerabilitiesInput