Skip to content

Add support for expiry date in ignore#3481

Open
laurentb4 wants to merge 1 commit into
anchore:mainfrom
laurentb4:feat/ignore-vuln-expiry
Open

Add support for expiry date in ignore#3481
laurentb4 wants to merge 1 commit into
anchore:mainfrom
laurentb4:feat/ignore-vuln-expiry

Conversation

@laurentb4

@laurentb4 laurentb4 commented Jun 1, 2026

Copy link
Copy Markdown

Summary

This pull request adds support for an expires-after field to ignore rules, allowing users to specify a date after which an ignore rule will no longer apply. It includes validation, logic changes, and tests to ensure correct handling of the new field.

Motivation

Currently the .grype.yml file does does not support the inclusion of an expiry date for vulnerabilities that are intentionally ignored.

Changes

  • Added a new expires-after field to the IgnoreRule struct, allowing users to set an expiration date for ignore rules. The rule will be ignored if the current date is after the specified date. [1] [2]
  • Implemented helper functions parseExpiresAfter and isExpiresAfterInPast to parse and evaluate the expiration date, handling empty and malformed values gracefully.
  • Updated the IgnoreRule.IgnoreMatch method to skip rules whose expiration date has passed.

Validation and Testing

  • Added a Validate method to IgnoreRule to check for malformed expires-after values at config load time, providing early feedback to users.
  • Extended and added new tests in ignore_test.go to cover various scenarios for the expires-after field, including valid, empty, past, future, and malformed dates.

Miscellaneous

  • Updated documentation/comments and imports to reflect the new feature.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Signed-off-by: lauren_tb <lauren.taylor-brown@justice.gov.uk>
@laurentb4 laurentb4 force-pushed the feat/ignore-vuln-expiry branch from c3191f0 to 55771f6 Compare June 1, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant