Filter secret logging

9 views
Skip to first unread message

Udbhav

unread,
Aug 2, 2019, 2:34:01 PM8/2/19
to Packer
Hi,

In my plugin I have added following code to avoid logging secrets 
`packer.LogSecretFilter.Set(secretResp)` 
just before executing the remote command. Secret is part of the remote command argument.

Unfortunately, it is still getting logged. 

Output - 
2019/08/02 11:27:22 packer.exe: 2019/08/02 11:27:22 [INFO] command 'powershell.exe -executionpolicy bypass -file C:\Users\Public\Documents\test.ps1 -CertU Base64Secret

Expected
2019/08/02 11:27:22 packer.exe: 2019/08/02 11:27:22 [INFO] command 'powershell.exe -executionpolicy bypass -file C:\Users\Public\Documents\test.ps1 -CertU <Sensitive>

Thanks
Udbhav

Udbhav

unread,
Aug 2, 2019, 4:04:03 PM8/2/19
to Packer
Can anyone please tell me how to prevent logging of secrets in custom plugins? I looked at packer codebase and tried `packer.LogSecretFilter.Set(Secret_String)` but it's not working.

Packer version - 1.4.2

Thanks
Udbhav

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/b47d23db-841e-47ef-8cbf-2ae6b94acee0%40googlegroups.com.

Megan Marsh

unread,
Aug 12, 2019, 1:59:04 PM8/12/19
to packe...@googlegroups.com
That should work. Without more details about your plugin though, I can't help more.

Reply all
Reply to author
Forward
0 new messages