GlobalCyberAlliance / domain-security-scanner

Scan domains and receive advice based on their BIMI, DKIM, DMARC, and SPF records
https://dmarcguide.globalcyberalliance.org/
Apache License 2.0
127 stars 23 forks source link

Option to create Excel CSV file #14

Closed OrlandoMD closed 12 months ago

OrlandoMD commented 1 year ago

Hello, As a suggestion, consider a "-c" (CSV) option to create output suitable for Excel directly importing or opening as *.csv file. One row for each domain evaluated, each column for the particular DSS result data type (I've spotted seven at this point), example: domain, mx, spf, dkim, dmarc, bimi, duration

If there are multiple values for a particular type use something other than comma to concatenate so importing or opening the file in Excel still results with a worksheet having data types consistently in a specific column, e.g., add semicolon ";" for mx results).

I'll be creating a Python parser to help review, create CSV for now.
This suggestion may help others.

I hope this helps explain.

Respectfully,

Orlando Stevenson

wolveix commented 1 year ago

Hey @OrlandoMD, thanks for the recommendation! I definitely like the idea, and it'd be very easy to implement. I should have time to work on this today, so you may not need to write the Python parser :)

wolveix commented 1 year ago

Hey @OrlandoMD, I've just pushed a version with CSV formatting by using the -f or --format flag.

I don't like that scanning multiple domains outputs multiple files, but changing that requires solving the question: should we accept domains via STDIN until the user exits, and then we scan the domains and output the results? Do we accept a buffer of a few domains prior to writing the results? What if the buffer is 3 domains but the user only specifies 2?

Let me know what you think about the CSV implementation anyway!

OrlandoMD commented 1 year ago

Hi Robert, Cool - will give the CSV option with "-f" a shot! As for the multiple output files issue, any useful approach that will result in a single output file for batch or bulk domain processing will help imho. There's also the approach of working around the issue with a bit of bash scripting. A big deal to me is consistent results from one run to the next, or with manual checking, something this new DSS-series of builds seems to do quite well!

OrlandoMD commented 11 months ago

Hi Robert, just ran latest status for over 1,000 domains and the CSV option worked very well! Example -> dss.exe scan -t120 -n1.1.1.1,8.8.8.8 -a -f csv < domains_in.csv > results_out.csv

Loaded and quickly cleaned up the new_results.csv in Excel. Looks like I'll need to retire my batch and Python parser workarounds!

wolveix commented 11 months ago

@OrlandoMD I'm so pleased to hear that, thanks for replying back! We do hope to support bulk processing (when writing to files) in a better way moving forward by writing all of the results to a single file, but we don't have a timeframe to achieve this right now given the concerns raised above. Pull requests are always welcome of course!

OrlandoMD commented 11 months ago

@wolveix Hello - The following example is providing output to a single file at this point with the Windows build:

Example: dss.exe scan -t120 -n1.1.1.1,8.8.8.8 -a -f csv < domains_in.csv > results_out.csv

Suggestions:

Regardless, output is super easy to clean up and sort in Excel.. and the results are very consistent in repeated runs. Working great - thank you! Sincerely, Orlando