Save-vPenTestReportFile
SYNOPSIS
Downloads the files of a vPenTest report
SYNTAX
__AllParameterSets
Save-vPenTestReportFile [-ReportId] <string> [-Type <string[]>] [-Path <string>] [-Force] [-WhatIf]
[-Confirm]
ALIASES
This cmdlet has the following aliases,
- None
DESCRIPTION
The Save-vPenTestReportFile cmdlet downloads one or more of the files (executive summary, technical report, supporting evidence…) of a report to a local folder
The report endpoints only return the urls of the report files. Those urls require the API token & redirect to a short lived pre-signed storage url (AWS S3). This cmdlet
- gets the report with Get-vPenTestReports
- requests each file url with the API token to get the redirect
- downloads the file from the redirect url WITHOUT sending the API token
The report file urls must be on the same host as the vPenTest base URI so that the API token is never sent to another host. The firewall must allow the AWS S3 hosts used for the download
Files are saved as
EXAMPLES
EXAMPLE 1
Save-vPenTestReportFile -ReportId '123e4567-e89b-12d3-a456-426614174000' -Path C:\Reports
Downloads the technical report to C:\Reports
EXAMPLE 2
Get-vPenTestReports -AllResults | Save-vPenTestReportFile -Type ExecutiveSummary -Path C:\Reports
Downloads the executive summary of every report to C:\Reports
EXAMPLE 3
Save-vPenTestReportFile -ReportId '123e4567-e89b-12d3-a456-426614174000' -Type All -Path C:\Reports -WhatIf
Shows which files would be saved without downloading anything
PARAMETERS
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Force
Overwrites files that already exist
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Path
The folder to save the files in, the folder is created when it does not exist
Default value: The current folder
Type: System.String
DefaultValue: (Get-Location).Path
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ReportId
The GUID of the report
Reports can be listed with Get-vPenTestReports
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- id
- report_id
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Type
The report files to download
Allowed values: ‘All’, ‘ExecutiveSummary’, ‘TechnicalReport’, ‘AiEnhancedExecutiveSummary’, ‘AiEnhancedVersion’, ‘SupportingEvidence’, ‘ActivityReport’, ‘ConsolidatedReport’, ‘VulnerabilityReport’, ‘RemediationReport’, ‘ProspectingTest’
Default value: TechnicalReport
A file that the report does not have yet is skipped with a warning
Type: System.String[]
DefaultValue: TechnicalReport
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.String
OUTPUTS
NOTES
Endpoint : GET /reports/{id} The file urls are returned by the report endpoint, they are not endpoints of the OpenAPI spec