|
46 | 46 |
|
47 | 47 | MINOR_VERSION_CADENCE = timedelta(days=120) |
48 | 48 | PATCH_VERSION_CADENCE = timedelta(days=31) |
49 | | -CVE_VERSION_CADENCE = timedelta(days=2) |
| 49 | +CVE_VERSION_CADENCE = timedelta(weeks=2) |
| 50 | +CVE_VERSION_CADENCE_WARN = timedelta(days=2) |
50 | 51 | CVE_SEVERITY = 8 # CRITICAL |
51 | 52 |
|
52 | 53 | HERE = Path(__file__).parent |
@@ -420,19 +421,19 @@ def check_k8s_version_recency( |
420 | 421 | # whoops, the cluster should have been updated to this (or a higher version) already! |
421 | 422 | return False |
422 | 423 | ranges = [_range for _range in cve_affected_ranges if my_version in _range] |
423 | | - if ranges and release.age > CVE_VERSION_CADENCE: |
424 | | - # -- two FIXMEs: |
425 | | - # (a) if the release still has the CVE, then there is no use if we updated to it? |
426 | | - # (b) the standard says "time period MUST be even shorter ... it is RECOMMENDED that ...", |
427 | | - # so what is it now, a requirement or a recommendation? |
| 424 | + if ranges and release.age > CVE_VERSION_CADENCE_WARN: |
| 425 | + # -- FIXME: |
| 426 | + # if the release still has the CVE, then there is no use if we updated to it? |
428 | 427 | # shouldn't we check for CVEs of my_version and then check whether the new one still has them? |
429 | 428 | # -- so, this has to be reworked in a major way, but for the time being, just emit an INFO |
430 | 429 | # (unfortunately, the cluster name is not available here) |
431 | | - logger.info( |
| 430 | + logger.warning( |
432 | 431 | "Consider updating from %s to %s to avoid a CVE", |
433 | 432 | my_version, |
434 | 433 | release.version, |
435 | 434 | ) |
| 435 | + if release.age > CVE_VERSION_CADENCE: |
| 436 | + return False |
436 | 437 | return True |
437 | 438 |
|
438 | 439 |
|
|
0 commit comments