Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-1744-2: Backend changes for fixing reports from integration #1796

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deepfence_utils/utils/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ReportParams struct {

type ReportFilters struct {
ScanID string `json:"scan_id"`
ScanType string `json:"scan_type" validate:"required" required:"true" enum:"vulnerability,secret,malware,compliance,cloud_compliance,alert"`
ScanType string `json:"scan_type" validate:"required" required:"true" enum:"vulnerability,secret,malware,compliance,cloud_compliance"`
NodeType string `json:"node_type" validate:"required" required:"true" enum:"host,container,container_image,linux,cluster,aws,gcp,azure"`
SeverityOrCheckType []string `json:"severity_or_check_type" enum:"critical,high,medium,low,cis,gdpr,nist,hipaa,pci,soc_2"`
IncludeDeadNode bool `json:"include_dead_nodes"`
Expand All @@ -98,7 +98,7 @@ type AdvancedReportFilters struct {
ContainerName []string `json:"container_name,omitempty"`
ImageName []string `json:"image_name,omitempty"`
HostName []string `json:"host_name,omitempty"`
AccountID []string `json:"account_id,omitempty"`
AccountID []string `json:"node_id,omitempty"`
KubernetesClusterName []string `json:"kubernetes_cluster_name,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion deepfence_worker/tasks/reports/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func searchScansFilter(params sdkUtils.ReportParams) rptSearch.SearchScanReq {
}

if len(params.Filters.AdvancedReportFilters.AccountID) > 0 {
filters.NodeFilter.Filters.ContainsFilter.FieldsValues["account_id"] = sdkUtils.StringArrayToInterfaceArray(params.Filters.AdvancedReportFilters.AccountID)
filters.NodeFilter.Filters.ContainsFilter.FieldsValues["node_id"] = sdkUtils.StringArrayToInterfaceArray(params.Filters.AdvancedReportFilters.AccountID)
}

if len(params.Filters.ScanID) > 0 {
Expand Down
Loading