Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit verb with plist output includes standard output #922

Open
mhrono opened this issue Jan 11, 2024 · 0 comments
Open

audit verb with plist output includes standard output #922

mhrono opened this issue Jan 11, 2024 · 0 comments
Assignees
Labels
beta Only for AutoPkg beta releases

Comments

@mhrono
Copy link

mhrono commented Jan 11, 2024

When auditing a recipe or override with autopkg audit $recipe and adding the -p argument for plist output, I get a plist as expected, but it's simply appended to the normal Looking for $recipe... lines. In v2.7.2, only the plist is sent to stdout.

For the purposes of documenting this issue, I created an override for one of my own recipes and named it test.

√ ~ % autopkg audit test
Looking for test...
Found test in recipe map overrides
Looking for com.mhrono.recipes.jamf.wireshark-universal...
Found com.mhrono.recipes.jamf.wireshark-universal in recipe map
Looking for com.mhrono.recipes.pkg.wireshark-universal...
Found com.mhrono.recipes.pkg.wireshark-universal in recipe map
Looking for com.mhrono.recipes.download.wireshark-universal...
Found com.mhrono.recipes.download.wireshark-universal in recipe map
test
    File path:        /Users/me/Documents/GitHub/myrepo/jamf/autopkg/RecipeOverrides/test.recipe.yaml
    Parent recipe(s): /Users/me/Library/AutoPkg/RecipeRepos/com.github.mhrono.autopkg-recipes/Wireshark/Wireshark-Universal.jamf.recipe.yaml
                      /Users/me/Library/AutoPkg/RecipeRepos/com.github.mhrono.autopkg-recipes/Wireshark/Wireshark-Universal.pkg.recipe.yaml
                      /Users/me/Library/AutoPkg/RecipeRepos/com.github.mhrono.autopkg-recipes/Wireshark/Wireshark-Universal.download.recipe.yaml
    The following processors are non-core and can execute arbitrary code, performing any action.
    Be sure you understand what the processor does and/or you trust its source:
        com.github.smithjw.processors/FriendlyPathDeleter
        io.github.hjuutilainen.VirusTotalAnalyzer/VirusTotalAnalyzer
        com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader
        com.github.grahampugh.jamf-upload.processors/JamfPackageUploader
        com.github.grahampugh.recipes.commonprocessors/VersionRegexGenerator
        com.github.jgstew.SharedProcessors/FileGetStat
        com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader
        com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader
        com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader
        com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader
        com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader
        com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader
        com.github.grahampugh.jamf-upload.processors/JamfPackageCleaner
        com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader
        com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader
    The following processors make modifications and their use in this recipe should be more closely inspected:
        PkgCreator
        FileCreator
        Copier

And, with the plist argument:

√ ~ % autopkg audit test -p
Looking for test...
Found test in recipe map overrides
Looking for com.mhrono.recipes.jamf.wireshark-universal...
Found com.mhrono.recipes.jamf.wireshark-universal in recipe map
Looking for com.mhrono.recipes.pkg.wireshark-universal...
Found com.mhrono.recipes.pkg.wireshark-universal in recipe map
Looking for com.mhrono.recipes.download.wireshark-universal...
Found com.mhrono.recipes.download.wireshark-universal in recipe map
b'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n\t<key>test</key>\n\t<dict>\n\t\t<key>audit_processors</key>\n\t\t<array>\n\t\t\t<string>PkgCreator</string>\n\t\t\t<string>Copier</string>\n\t\t\t<string>FileCreator</string>\n\t\t</array>\n\t\t<key>non_core_processors</key>\n\t\t<array>\n\t\t\t<string>com.github.smithjw.processors/FriendlyPathDeleter</string>\n\t\t\t<string>io.github.hjuutilainen.VirusTotalAnalyzer/VirusTotalAnalyzer</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfPackageUploader</string>\n\t\t\t<string>com.github.grahampugh.recipes.commonprocessors/VersionRegexGenerator</string>\n\t\t\t<string>com.github.jgstew.SharedProcessors/FileGetStat</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfPackageCleaner</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader</string>\n\t\t\t<string>com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader</string>\n\t\t</array>\n\t</dict>\n</dict>\n</plist>\n'

Expected behavior
Ideally, the audit verb with the plist argument would output only the plist, which would make the output significantly easier to process programmatically. Additionally, the standard audit output includes details about where the recipe files are located on-disk, and the plist does not. If this data could also be included in the plist output, that would be fantastic.

Version (please complete the following information):

  • OS version: 14.2.1
  • AutoPkg Version: 3.0RC2
@mhrono mhrono added the beta Only for AutoPkg beta releases label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Only for AutoPkg beta releases
Projects
None yet
Development

No branches or pull requests

2 participants