-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Labels
needs triageNeeds to be reviewedNeeds to be reviewed
Description
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())
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs triageNeeds to be reviewedNeeds to be reviewed