From 221a58cd32dfa66e8cf21e854d4605eb4d61f8d7 Mon Sep 17 00:00:00 2001 From: MaksimZhukov Date: Mon, 14 Sep 2020 22:06:19 +0300 Subject: [PATCH] Remove sensitive data from logs --- .../macos/azure-pipelines/image-generation.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/images.CI/macos/azure-pipelines/image-generation.yml b/images.CI/macos/azure-pipelines/image-generation.yml index 34565695..8236a7b7 100644 --- a/images.CI/macos/azure-pipelines/image-generation.yml +++ b/images.CI/macos/azure-pipelines/image-generation.yml @@ -28,7 +28,12 @@ jobs: SourceFolder: 'images/macos/provision/log/' RemoveSourceFolder: true - - bash: | + - pwsh: | + $SensitiveData = @( + 'IP address:', + 'Using ssh communicator to connect:' + ) + packer build -on-error=abort \ -var="vcenter_server=$(vcenter_server_v2)" \ -var="vcenter_username=$(vcenter_username_v2)" \ @@ -45,7 +50,13 @@ jobs: -var="xcode_install_user=$(xcode-installation-user)" \ -var="xcode_install_password=$(xcode-installation-password)" \ -color=false \ - ${{ parameters.template_path }} + ${{ parameters.template_path }} ` + | Where-Object { + #Filter sensitive data from Packer logs + $currentString = $_ + $sensitiveString = $SensitiveData | Where-Object { $currentString -match $_ } + $sensitiveString -eq $null + } displayName: 'Build VM' env: PACKER_LOG: 0