File tree Expand file tree Collapse file tree 2 files changed +7
-31
lines changed Expand file tree Collapse file tree 2 files changed +7
-31
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ GRR and removing them from GRR were added.
23
23
* Add ** config option for the client certificate path** to handle
24
24
certificate authentication based on files (_ GRRClientCertFilePath_ ).
25
25
* Add ` Add-GRRArtifact ` for ** uploading new artifacts to GRR** . Tested with
26
- Windows PowerShell v5 and PowerShell Core 6.0.0-beta.5 on Windows.
26
+ Windows PowerShell v5 and PowerShell Core 6.0.0-beta.5 on Windows and PowerShell
27
+ Core 6.0.0-beta.5 on macOS.
27
28
* Add ` Remove-GRRArtifact ` for ** removing one or multiple artifacts from GRR** .
28
29
* Add base64 encoding function (` ConvertTo-Base64 ` ) which is used for
29
30
manual basic authentication to mitigate missing basic authentication in
Original file line number Diff line number Diff line change @@ -1160,42 +1160,17 @@ function Invoke-GRRFlow()
1160
1160
}
1161
1161
elseif ($Flow -eq " ArtifactCollectorFlow" )
1162
1162
{
1163
- $AllArtifacts = Get-GRRArtifact - Credential $Credential
1164
- if ($AllArtifacts )
1165
- {
1166
- $AllArtifacts = $AllArtifacts | select - ExpandProperty name
1167
- }
1168
- else
1169
- {
1170
- Throw " No artifacts found in GRR"
1171
- }
1172
-
1173
- $ValidatedArtifacts = @ ()
1163
+ $ValidatedArtifacts = Get-ValidatedGRRArtifact - Credential $Credential - Artifacts $PSBoundParameters [' ArtifactList' ]
1174
1164
1175
- foreach ($Artifact in $PSBoundParameters [ ' ArtifactList ' ] )
1165
+ if ($ValidatedArtifacts )
1176
1166
{
1177
- if ($AllArtifacts -and $AllArtifacts.contains ($Artifact ))
1178
- {
1179
- $ValidatedArtifacts += $Artifact
1180
- }
1181
- else
1182
- {
1183
- write-warning " Skipping artifact `' $Artifact `' because it is not defined in GRR."
1184
- }
1185
- }
1186
-
1187
- if ($ValidatedArtifacts )
1188
- {
1189
- $ValidatedArtifacts = $ValidatedArtifacts | Get-Unique
1167
+ $PluginArguments = ' {"artifact_list":["' + $ ($ValidatedArtifacts -join " `" ,`" " ) + ' "]}'
1168
+ Write-Verbose " PluginArguments for ArtifactCollectorFlow: $PluginArguments "
1190
1169
}
1191
1170
else
1192
1171
{
1193
- Throw " No artifacts found in GRR which match the command "
1172
+ Throw " No artifacts found in GRR which match the given artifacts. "
1194
1173
}
1195
-
1196
- $PluginArguments = ' {"artifact_list":["' + $ ($ValidatedArtifacts -join " `" ,`" " ) + ' "]}'
1197
-
1198
- Write-Verbose " PluginArguments for ArtifactCollectorFlow: $PluginArguments "
1199
1174
}
1200
1175
1201
1176
$Body = ' {"flow":{"runner_args":{"flow_name":"' + $Flow + ' ",'
You can’t perform that action at this time.
0 commit comments