Skip to content

Commit 36359cc

Browse files
authored
Service Update (canada-ca#1542)
* Miscellaneous service updates to ensure reliable functionality. Addition of context-dependant tags and dmarc implementation phase determination * Simplify insertions * Refactoring * DKIM tag generation logic fix
1 parent 1d5dd63 commit 36359cc

9 files changed

Lines changed: 238 additions & 301 deletions

File tree

services/core/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
DB_PASS = os.getenv("DB_PASS")
1717
DB_PORT = os.getenv("DB_PORT")
1818
DB_NAME = os.getenv("DB_NAME")
19-
DB_HOST = os.getenv("DB_HOST")
19+
DB_HOST = "10.108.14.82"
2020
REPO_NAME = os.getenv("REPO_NAME")
2121
REPO_OWNER = os.getenv("REPO_OWNER")
2222
GUIDANCE_DIR = os.getenv("GUIDANCE_DIR")
@@ -366,16 +366,18 @@ def update_org_summaries(host=DB_HOST, name=DB_NAME, user=DB_USER, password=DB_P
366366
else:
367367
mail_fail = mail_fail + 1
368368

369-
org["summaries"]["web"] = {
369+
summaries = {}
370+
summaries["web"] = {
370371
"pass": web_pass,
371372
"fail": web_fail,
372373
"total": domain_total,
373374
}
374-
org["summaries"]["mail"] = {
375+
summaries["mail"] = {
375376
"pass": mail_pass,
376377
"fail": mail_fail,
377378
"total": domain_total,
378379
}
380+
org.update(summaries)
379381
db.collection("organizations").update(org)
380382

381383
logging.info(f"Organization summary value update completed.")

services/scanners/dns/dns_scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def timeout_handler(signum, frame):
307307
logging.error(msg)
308308
logging.error(f"Full traceback: {traceback.format_exc()}")
309309
dispatch_results(
310-
{"scan_type": "dns", "uuid": uuid, "domain_key": domain_key, "results": {}}, server_client
310+
{"scan_type": "dns", "uuid": uuid, "domain_key": domain_key, "results": {"dmarc": {"missing": True}, "dkim": {"missing": True}, "spf": {"missing": True}}}, server_client
311311
)
312312
return PlainTextResponse(msg)
313313

services/scanners/https/https_scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def timeout_handler(signum, frame):
195195
logging.error(msg)
196196
logging.error(f"Full traceback: {traceback.format_exc()}")
197197
dispatch_results(
198-
{"scan_type": "https", "uuid": uuid, "domain_key": domain_key, "results": {}}, server_client
198+
{"scan_type": "https", "uuid": uuid, "domain_key": domain_key, "results": {"missing": True}}, server_client
199199
)
200200
return PlainTextResponse(msg)
201201

services/scanners/results/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ python-arango
88
pretend
99
uvloop
1010
httptools
11-
gql[all]
11+
gql

0 commit comments

Comments
 (0)