Skip to content

Payload for ReportExecutions #512

@gray-host

Description

@gray-host

I'm trying to write a program to get the outputs of a scheduled report and dump that into a ticket system my team uses. I can't seem to find out how you would get the response body for the requests executed by ReportExecutions.ReportExecutionsDownloadGet(). Unlike other response structures in the API specifications, there is no Payload exported, only the response headers. Am I doing something wrong here or has this not been implemented yet?

Code for reference:

log.Print("Authenticating with Falcon...")
client, err := falcon.NewClient(
	&falcon.ApiConfig{
		ClientId:     os.Getenv("FALCON_CLIENT_ID"),
		ClientSecret: os.Getenv("FALCON_CLIENT_SECRET"),
		Context:      context.Background(),
	})
if err != nil {
	log.Fatal("Failed to create client: ", err)
}
log.Print("Getting Vulnerability Report Execution Metadata...")
scheduledReportQuery, err := client.ScheduledReports.QueryByID(&scheduled_reports.QueryByIDParams{
	Ids: []string{REPORT_ID},
})
if err != nil {
	log.Fatal("Failed to get Vulnerability Report Execution Metadata: ", err)
}
executionStatus := scheduledReportQuery.Payload.Resources[0].LastExecution.StatusDisplay
if *executionStatus != "Success" {
	log.Fatal("Vulnerability Report Execution Failed: ", *executionStatus)
}
log.Print("Downloading Vulnerability Report...")

reportData, err := client.ReportExecutions.ReportExecutionsDownloadGet(report_executions.NewReportExecutionsDownloadGetParams().WithIds(*scheduledReportQuery.Payload.Resources[0].LastExecution.ID))

if err != nil || reportData.IsSuccess() == false {
	log.Print("Failed to download Vulnerability Report: ", err)
}

fmt.Println(reportData.String())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions