Skip to content

Commit

Permalink
Merge pull request #28 from gardenlinux/nvd-reduce-timespan
Browse files Browse the repository at this point in the history
Reduce time span requested from NVD API
  • Loading branch information
waldiTM authored Dec 12, 2023
2 parents dc23f1d + e55006f commit 6271fe9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/glvd/cli/ingest_nvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ async def fetch_cve(
if not last_mod or last_mod <= start:
logger.info('Requesting all data')
await self.fetch_cve_impl(conn, rsession, {})
last_mod = now

# Request the last 90 days. This violates parts the the best
# practices documented at
# Request seven days before the last modification. This violates
# parts the the best practices documented at
# https://nvd.nist.gov/developers/start-here#:~:text=Best%20Practices
# It turns out, we don't work on a stable snapshot, and the
# modification timestamp changes.
check = last_mod - timedelta(days=7)
params: dict[str, str] = {
'lastModStartDate': start.isoformat(),
'lastModStartDate': check.isoformat(),
'lastModEndDate': now.isoformat(),
}

Expand Down

0 comments on commit 6271fe9

Please sign in to comment.