Skip to content

Commit

Permalink
Fix formatting (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkst-az authored Feb 16, 2024
1 parent fc475a2 commit 7b50b21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aws-css-token-infra/CSSClonedSiteCFFunc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function handler(event) {
if (referer == '')
console.log("Empty/missing Referer header for: " + expected_referrer);

if (expected_referrer == '' || referer == '' || referer_origin.endsWith(expected_referrer)) { // Happy case where the referer matches
if (expected_referrer == '' || referer == '' || referer_origin.endsWith(expected_referrer)) { // Happy case where the referer matches
return matching_ref_response;
}
if (expected_referrer.endsWith('microsoftonline.com') && referer_origin.endsWith('login.microsoft.com')) {
Expand Down
12 changes: 7 additions & 5 deletions canarytokens/channel_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _do_ns_response(self, name=None):
payload=dns.Record_A(ttl=10, address=self.frontend_settings.PUBLIC_IP),
type=dns.A,
auth=True,
ttl=300
ttl=300,
)
answers = [answer]
authority: list[str] = []
Expand All @@ -143,7 +143,7 @@ def _do_soa_response(self, name=None):
),
type=dns.SOA,
auth=True,
ttl=300
ttl=300,
)
answers = [answer]
authority = []
Expand All @@ -157,13 +157,15 @@ def _do_dynamic_response(self, name=None):
"""
log.info(f"Building A record: ip = {self.frontend_settings.PUBLIC_IP}")
ttl = 10

if name.lower().decode() in self.canary_domains:
# This is a resolution of the apex domain, not a token, so we can bump up the TTL
ttl = 600 # 10 min seems plenty short enough to allow for IP changes without getting overloaded
ttl = 600 # 10 min seems plenty short enough to allow for IP changes without getting overloaded

payload = dns.Record_A(ttl=ttl, address=self.frontend_settings.PUBLIC_IP)
answer = dns.RRHeader(name=name, payload=payload, type=dns.A, auth=True, ttl=ttl)
answer = dns.RRHeader(
name=name, payload=payload, type=dns.A, auth=True, ttl=ttl
)
answers = [answer]
authority: list[str] = []
additional: list[str] = []
Expand Down

0 comments on commit 7b50b21

Please sign in to comment.