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

cvtsudoers JSON output isn't well-specified #172

Open
zombiepigdragon opened this issue Aug 15, 2022 · 3 comments
Open

cvtsudoers JSON output isn't well-specified #172

zombiepigdragon opened this issue Aug 15, 2022 · 3 comments

Comments

@zombiepigdragon
Copy link

In the documentation, it is implied the purpose of cvtsudoers -f json is to allow third-party applications to parse sudo rules. However, there does not seem to be any way to get a complete overview of the format without reading the source that outputs it or by using trial and error to collect all of the possible keys/values. Am I correct that the JSON output format is meant to be a better-standardized machine-parsable representation of the sudoers format? If so, does any additional documentation exist, or where would it go if it was written?

@millert
Copy link
Collaborator

millert commented Aug 16, 2022

Yes, the JSON output is intended to be consumed by third-party programs (or converted to XLM and then ingested). The format is not currently documented, though it is not particularly complicated. What kind of documentation would you find useful? A sudoers.json manual page? A JSON schema file? Something else?

@zombiepigdragon
Copy link
Author

What kind of documentation would you find useful? A sudoers.json manual page? A JSON schema file? Something else?

The JSON schema was exactly what I had in mind, actually. I originally expected to find some form of documentation in the cvtsudoers manual page, but it hit me later that putting the full schema in there would probably be too long for the pages.

The main things I'm looking for are completeness (I can't be sure if I'm missing a field if I simply convert my desktop's configuration like I first tried) and ideally some short statement of purpose for each field. Unless I'm mistaken, a JSON schema is exactly that, and so its probably the most useful documentation for either the website or a manual page.

An example output being provided somewhere (either in the cvtsudoers man page itself or e.g. /usr/share/doc/cvtsudoers/sudoers.json) would be useful alongside such a schema, so that the output could be referenced on known-good sample data.

Separately, someone I asked to double check while I was searching for documentation pointed out the csv output format also isn't defined, and having that as well would be icing on top of the JSON format.

@millert
Copy link
Collaborator

millert commented Sep 20, 2022

I've added sections to the cvtsudoers man page describing the JSON and CSV output. I plan to add a JSON schema in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants