-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into reaper-exit-orph-fix
- Loading branch information
Showing
411 changed files
with
6,347 additions
and
4,959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
echo "~~~ Authenticating GCP" | ||
# Secrets must be redacted | ||
# https://buildkite.com/docs/pipelines/managing-log-output#redacted-environment-variables | ||
PRIVATE_CI_GCS_CREDENTIALS_PATH="kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account" | ||
PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(vault kv get -field plaintext -format=json ${PRIVATE_CI_GCS_CREDENTIALS_PATH}) | ||
export PRIVATE_CI_GCS_CREDENTIALS_SECRET | ||
echo "${PRIVATE_CI_GCS_CREDENTIALS_SECRET}" > ./gcp.json | ||
GOOGLE_APPLICATION_CREDENTIALS=$(realpath ./gcp.json) | ||
export GOOGLE_APPLICATION_CREDENTIALS | ||
gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
$downloadUrl = "https://live.sysinternals.com/Sysmon64.exe" | ||
$tempFolder = "$env:TEMP\SysmonDownload" | ||
$sysmonPath = "$tempFolder\Sysmon64.exe" | ||
|
||
if (!(Test-Path $tempFolder)) { | ||
New-Item -ItemType Directory -Path $tempFolder | ||
} | ||
|
||
$ProgressPreference = 'SilentlyContinue' | ||
function ParseErrorForResponseBody($Error) { | ||
if ($PSVersionTable.PSVersion.Major -lt 6) { | ||
if ($Error.Exception.Response) { | ||
$Reader = New-Object System.IO.StreamReader($Error.Exception.Response.GetResponseStream()) | ||
$Reader.BaseStream.Position = 0 | ||
$Reader.DiscardBufferedData() | ||
$ResponseBody = $Reader.ReadToEnd() | ||
if ($ResponseBody.StartsWith('{')) { | ||
$ResponseBody = $ResponseBody | ConvertFrom-Json | ||
} | ||
return $ResponseBody | ||
} | ||
} | ||
else { | ||
return $Error.ErrorDetails.Message | ||
} | ||
} | ||
|
||
$attempts=1 | ||
do | ||
{ | ||
$attempts++ | ||
try { | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
$result = Invoke-WebRequest -Uri $downloadUrl -OutFile $sysmonPath -UseBasicParsing | ||
break | ||
} | ||
catch { | ||
$resp = ParseErrorForResponseBody($_) | ||
Write-Host "$resp" | ||
if ($attempts -gt 5) { | ||
exit 1 | ||
} | ||
} | ||
} while ($attempts -le 5) | ||
|
||
Write-Host "Sysmon64.exe downloaded successfully." | ||
|
||
if ($sysmonPath) { | ||
Start-Process -FilePath $sysmonPath -ArgumentList "-m" -Wait | ||
|
||
Write-Host "Sysmon event manifest installation completed." | ||
} else { | ||
Write-Host "Sysmon executable not found in the downloaded archive." | ||
} | ||
|
||
Remove-Item -Path $tempFolder -Force -Recurse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.