cisagov / gophish-tools

Helpful tools for interacting with a GoPhish phishing instance
Creative Commons Zero v1.0 Universal
42 stars 6 forks source link

Logging format cstring cleanup #46

Closed JCantu248 closed 2 years ago

JCantu248 commented 3 years ago

🗣 Description

The changes on this branch involve changing all the f-strings and .format style strings in logging messages to the C style string format.

A small tweak was also made on gophish-export.py line 368-369 to change from campaign_id to campaign["id"], which will improve readability of the message. campaign_id is a Gophish generated integer, which does not really work well with the rest of the statement. campaign["id"] is the actual campaign name sourced from Gophish.

💭 Motivation and context

This change is necessary to bring gophish-tools in line with the rest of the best practices, which include using the C-style format strings for Python logging. The repository source code was using a mixture of f-strings, .format, and C-style formatting in logging messages. Now the repository will have more consistency in this regard.

🧪 Testing

I ran Pytest just to make sure everything still works as intended, and received all green lights. I tested the changes by importing them into the COOL environment and running the LiPCA Setup script to make sure that logging was still working as intended.

✅ Checklist

lgtm-com[bot] commented 3 years ago

This pull request introduces 1 alert and fixes 1 when merging 25a497ae7ccb2168118f1a3c3a4e78caf1fb196a into 442cdb5f5dca01cff07611adf99c74ff39ee6b72 - view on LGTM.com

new alerts:

fixed alerts:

lgtm-com[bot] commented 3 years ago

This pull request fixes 1 alert when merging a65955c0098195a6a9215dae102b2f6019b4241d into 442cdb5f5dca01cff07611adf99c74ff39ee6b72 - view on LGTM.com

fixed alerts:

lgtm-com[bot] commented 3 years ago

This pull request fixes 1 alert when merging 44e24edb9ac96eb42759bdea8a9229563811ca59 into 442cdb5f5dca01cff07611adf99c74ff39ee6b72 - view on LGTM.com

fixed alerts:

lgtm-com[bot] commented 3 years ago

This pull request fixes 1 alert when merging 3ee423033fefa9873fd13190c0e6edb575cd0080 into 442cdb5f5dca01cff07611adf99c74ff39ee6b72 - view on LGTM.com

fixed alerts:

lgtm-com[bot] commented 3 years ago

This pull request fixes 1 alert when merging aa935857cb5baf1d6d14fae9912295d42faff0dd into 442cdb5f5dca01cff07611adf99c74ff39ee6b72 - view on LGTM.com

fixed alerts: