wordfence / wordfence-cli

Wordfence malware and vulnerability scanner command line utility.
https://www.wordfence.com/products/wordfence-cli/
GNU General Public License v3.0
100 stars 20 forks source link

Document `--email` file attachment capability #270

Closed davidnuzik closed 1 month ago

davidnuzik commented 1 month ago

We should document the --email file attachment capability.

If you pass both the --email flag and also the --output-path flag the output file will be attached to the email. Optionally we could describe in /docs as well, but at least cli help would be ideal. We could keep it very simple indicating the addition of the --output-path parameter will cause the file to be attached to the email.

davidnuzik commented 1 month ago

v4.0.3rc4 7/31/24

SUMMARY: QA validation Failed. The new changes (ex: https://github.com/wordfence/wordfence-cli/blob/v4.0.3rc4/docs/Email.md) look good to me in the /docs. However something might not be quite right with the CLI help.

If I run a command like wordfence help malware-scan (or ...remediate, or ...vuln-scan) the output is as I would expect for the Email section. However if I run a command like wordfence help terms (or any other subcommands that do not support --email) I will still get email output but the short -E line is missing (pictured in notes below). The behavior of still showing Email options is not new, but the missing -E help text line is new.

If I compare the behavior to an older WF CLI version such as v4.0.2, I will still get the -E, --email Email address(es) to which to send reports. line when I run wordfence help terms (and any other help ).

NOTES: wordfence help terms - note the missing line that starts with -E image

wordfence help malware-scan - note the line that starts with -E is here in this case since this subcommand supports email reports image

Side note: I don't think this is relevant or a concern, but the -E help text line used to be the first in the Email section of help, it is now the last. I don't think this matters just noting in the unlikely event this is relevant.

davidnuzik commented 1 month ago

v4.0.3rc5 8/1/24

SUMMARY: QA validation PASSED. I can confirm with the latest change all the "Email" group of args have been removed from help for subcommands that do not support sending of emails (only vuln-scan, malware-scan, and remediate support usage of the -E / --email flags and related email flags).

VALIDATION STEPS:

davidnuzik commented 1 month ago

Changes were made to move the email config back to the base cli help to preserve backwards compatibility. No issues found during testing, all help entries now have the Email group of args back.