Skip to content

Commit

Permalink
Remove hsts age rule (#3827)
Browse files Browse the repository at this point in the history
  • Loading branch information
FestiveKyle committed Jul 14, 2022
1 parent 887a87c commit a84caad
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 25 deletions.
1 change: 0 additions & 1 deletion guidance/chartSummaryCriteria.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"https7",
"https8",
"https9",
"https10",
"https13",
"https14",
"https15",
Expand Down
1 change: 0 additions & 1 deletion guidance/scanSummaryCriteria.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"https7",
"https8",
"https9",
"https10",
"https13",
"https14",
"https15"
Expand Down
12 changes: 2 additions & 10 deletions scanners/https-processor/https_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,12 @@ def process_https(results, domain_key, user_key, shared_id):
if isinstance(hsts, str):
hsts = hsts.lower()

if hsts == "hsts max age too short":
negative_tags.append("https10")

elif hsts == "no hsts":
if hsts == "no hsts":
negative_tags.append("https9")

# HSTS Age
hsts_age = results.get("hsts_age", None)

if hsts_age is not None:
if hsts_age < 31536000:
if "https9" not in negative_tags and "https10" not in negative_tags:
negative_tags.append("https10")

# Preload Status
preload_status = results.get("preload_status", None)

Expand Down Expand Up @@ -152,7 +144,7 @@ def process_https(results, domain_key, user_key, shared_id):
"negativeTags": negative_tags,
}

hsts_tags = ["https9", "https10"]
hsts_tags = ["https9"]

# get https status
if "https17" in neutral_tags:
Expand Down
10 changes: 1 addition & 9 deletions scanners/https-processor/result_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,12 @@ def process_https(results, domain_key, user_key, db, shared_id):
if isinstance(hsts, str):
hsts = hsts.lower()

if hsts == "hsts max age too short":
negative_tags.append("https10")

elif hsts == "no hsts":
if hsts == "no hsts":
negative_tags.append("https9")

# HSTS Age
hsts_age = results.get("hsts_age", None)

if hsts_age is not None:
if hsts_age < 31536000:
if "https9" not in negative_tags and "https10" not in negative_tags:
negative_tags.append("https10")

# Preload Status
preload_status = results.get("preload_status", None)

Expand Down
2 changes: 0 additions & 2 deletions services/guidance/guidance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,6 @@
"https7",
"https8",
"https9",
"https10",
"https13",
"https14",
"https15"
Expand Down Expand Up @@ -2514,7 +2513,6 @@
"https7",
"https8",
"https9",
"https10",
"https13",
"https14",
"https15",
Expand Down
2 changes: 0 additions & 2 deletions services/summaries/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"https7",
"https8",
"https9",
"https10",
"https11",
"https12",
"https13",
Expand All @@ -38,7 +37,6 @@
"https7",
"https8",
"https9",
"https10",
"https11",
"https12",
"https13",
Expand Down

0 comments on commit a84caad

Please sign in to comment.