Skip to content

Commit

Permalink
Merge pull request #40 from passivetotal/bugfix-lru-dates
Browse files Browse the repository at this point in the history
Bugfix lru_cache and dates
  • Loading branch information
aeetos authored Sep 27, 2021
2 parents 78b5b17 + fb7b6de commit a9c1892
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## v2.5.6

#### Bug fixes

- Fixed issue that broke Illuminate ASI and Vuln Intel analyzer modules in Python 3.7 and
earlier due to a missing param on the lru_cache decorator required in those versions.
- Fixed default end date behavior in analyzer to include a full day rather than stopping at
midnight "today". Was causing records with a last-seen date equal to the current date
to be excluded from analyzer record list objects (including pDNS, certificates, and
anything else that supported date-bounded queries).



## v2.5.5

#### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion passivetotal/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION="2.5.5"
VERSION="2.5.6"
3 changes: 1 addition & 2 deletions passivetotal/analyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def init(**kwargs):
(SslRequest, 'SSL'),
(WhoisRequest, 'Whois'),
(IlluminateRequest, 'Illuminate'),
(ArticlesRequest, 'Articles'),
(ProjectsRequest, 'Projects'),
(ArtifactsRequest, 'Artifacts'),
(MonitorRequest, 'Monitor'),
Expand Down Expand Up @@ -141,7 +140,7 @@ def set_date_range(days_back=DEFAULT_DAYS_BACK, start=None, start_date=None, end
now = datetime.now(timezone.utc)
past = now - timedelta(days=days_back)
config['start_date'] = past.date().isoformat() + ' 00:00:00'
config['end_date'] = now.date().isoformat() + ' 00:00:00'
config['end_date'] = now.date().isoformat() + ' 23:59:59'

def set_pdns_timeout(timeout):
"""Set a timeout on pDNS queries to third-party sources."""
Expand Down
2 changes: 1 addition & 1 deletion passivetotal/analyzer/illuminate/asi.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _pagination_parse_page(self, api_response):
self._records.append(AttackSurface(api_response=result))

@staticmethod
@lru_cache
@lru_cache(maxsize=None)
def load(pagesize=INDICATOR_PAGE_SIZE):
"""Get a list of all third-party (vendor) attack surfaces authorized for this API account.
Expand Down
2 changes: 1 addition & 1 deletion passivetotal/analyzer/illuminate/vuln.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def components(self):
return self._components

@property
@lru_cache
@lru_cache(maxsize=None)
def attack_surfaces(self):
"""List of Illuminate Attack Surfaces (aka third-party vendors) with assets impacted by this vulnerability.
Expand Down

0 comments on commit a9c1892

Please sign in to comment.