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

FR: Mark certain fields as non-logging/debug only. #941

Open
novaksam opened this issue May 16, 2024 · 4 comments
Open

FR: Mark certain fields as non-logging/debug only. #941

novaksam opened this issue May 16, 2024 · 4 comments
Assignees
Labels
beta Only for AutoPkg beta releases

Comments

@novaksam
Copy link

THIS IS ONLY INTENDED FOR AUTOPKG BETAS.

Describe the problem
It would be nice to have the ability to mark certain fields, either with an xml attribute or some other method, as non-logging outside of debug output. This would help hide credentials or other secrets from log files that we may not want exposed in logs.

@novaksam novaksam added the beta Only for AutoPkg beta releases label May 16, 2024
@nmcspadden
Copy link
Contributor

nmcspadden commented May 16, 2024 via email

@novaksam
Copy link
Author

@nmcspadden Totally fair, understandable.

As autopkg is working right now, utilizing JamfUploader, the recipe run plists contain the credentials used to connect to smb shares; another potential example is an API key. I'm proposing some sort of processing to mark certain fields as 'non-logged' in logging output.

I'm thinking perhaps something like:

<key debugonly="true">test</key>
<string>hello</string>

And then a modification to the logging system to check if a property is hidden/protected/marked then don't emit a log line unless debug/high verbosity is enabled.

If it doesn't make sense to implement something like this, as it would probably affect quite a few items, then feel free to close this.

@gregneagle
Copy link
Contributor

gregneagle commented May 18, 2024

<key debugonly="true">test</key>
<string>hello</string>

would not be legal syntax for an Apple plist.

Best that could be done would be something like

<key>private_data_keys</key>
<array>
    <string>Foo</string>
    <string>Bar</string>
</array>

Where would this extra data live? I'd guess in a recipe override. So then does this affect logging only for the specific recipe? I'd assume so.

Since there's lots of decisions to be made like this, I would not expect any of the "main" maintainers to work on this unless they themselves found this important/useful. Someone is going to have to make the effort at the very least to think through this and define how it would work and how it would be implemented.

I'd also think naming choices are important. You've twice mentioned "debug" output, yet autopkg doesn't really define anything specifically as debug. Instead it has various levels of verbosity. So should this mechanism be connected to the various levels of verbosity, or is it completely binary (as in never output these values)? I'd think that would be easier to implement and understand, and if an admin wanted those private fields output available, they could just adjust the override.

So again, you are seeing that there's a lot of thinking and discussion that would need to happen here. Good luck!

@nmcspadden
Copy link
Contributor

nmcspadden commented May 19, 2024 via email

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

3 participants