We have been given the task to deploy an infrastructure in openstack using puppet which installs only trusted packages from chocolatey. The problem we face is to implement a secure way to check if a package is trusted and apply this to our puppet code so that our packages gets updated automatically when there is a new trusted package.
The best way we found to check if a package is trusted is to run "choco info 'NAMEOFPACKAGE' " and write a script that checks if the string "Package approved as a trusted package on" appears in the output of choco info.
This dont feel like a secure way to check if a package is trusted and we would like to do this in a better way.
$name="default"
$lines = choco $name | Select-String "Package approved as a trusted package" | Measure-Object -Line
if ($lines = 1) {
"****This found only 1 line****"
else {"*Found 0 or more*"}