mozilla / ssh_scan

DEPRECATED - A prototype SSH configuration and policy scanner (Blog: https://mozilla.github.io/ssh_scan/)
Mozilla Public License 2.0
792 stars 105 forks source link

Automatically detect output type based on output file extension #492

Closed exploide closed 2 years ago

exploide commented 5 years ago

Now that it is possible to choose between JSON and YAML, it could be further improved by automatically detecting the desired output format when giving a --output file path.

E.g. ssh_scan -o out.yaml -t example.com currently produces JSON inside the .yaml file while it could know that YAML format is desired.

claudijd commented 5 years ago

Thanks for the suggestion, though I'd much prefer that we explicit about output formats with the output_type switch rather than doing the guessing game here. I'm willing to be convinced otherwise, but I'm feeling like it's unneeded complexity in this case.

claudijd commented 5 years ago

Even though I said I don't like this, I PR'd #493 for the sake of example.

Maybe we can still merge it, but it's not my favorite.

exploide commented 5 years ago

Ok, of course it is up to you to decide if this feature request should be rejected or not. If you don't like to introduce the required complexity into the code, feel free to close this issue. It is not really important for me.

The reasons I proposed this:

claudijd commented 5 years ago

I was on the fence, which is why I PR'd, I'm ok with it and will land if makes life easier.