Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Network Resilient DB Update Process #1971

Open
Hacks4Snacks opened this issue Apr 2, 2024 · 0 comments
Open

[Feature Request] Network Resilient DB Update Process #1971

Hacks4Snacks opened this issue Apr 2, 2024 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. target/kubernetes Issues relating to kubernetes cluster scanning

Comments

@Hacks4Snacks
Copy link
Contributor

This likely belongs in the trivy repository, but starting the conversation here as this is the context I am leveraging trivy (client/server via built-in server).

Feature Request Summary:

Objective: Improve network resilience of the Trivy-server DB update process.

  • Problem Statement: The Trivy-server pod experiences failures and enters a crash loop when network connectivity issues occur during its instantiation or DB updates.
  • Proposed Solution: Implement a preliminary network connectivity validation step. This step will precede any DB update attempts, ensuring that a stable network connection is available. This validation should be contingent upon the existence of a valid metadata file, which indicates a prior successful update or connectivity.
  • Expected Outcome: The proposed enhancement is anticipated to reduce the incidence of Trivy-server pod failures related to network issues. By ensuring network availability before attempting DB updates, the server will avoid unnecessary crash loops and maintain operational stability, even in environments with intermittent network connectivity.

Technical Details for Discussion:

  • Connectivity Check Implementation: Introduce a mechanism to assess network connectivity by verifying access to a predetermined set of endpoints or services critical for the DB update process (potentially make endpoints optional via flag). This could involve simple ping tests or more complex validation checks against known URLs.
  • Metadata File Validation: Before executing the connectivity check, ensure that a valid metadata file exists. This file serves as an indicator of a previously successful update and the current necessity for a new update. If the file is absent or deemed invalid, the update process should not proceed until the issue is resolved.
  • Enhanced Update Logic: If the connectivity check fails, the system should not attempt to update the DB. Instead, it should log the incident and either retry after a predefined interval.
  • Fallback Mechanisms: Consider implementing fallback mechanisms, such as using a cached version of the DB if available, to ensure that the Trivy-server remains functional to the extent possible, even without the latest DB updates.
@Hacks4Snacks Hacks4Snacks added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 2, 2024
@chen-keinan chen-keinan added priority/backlog Higher priority than priority/awaiting-more-evidence. target/kubernetes Issues relating to kubernetes cluster scanning labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. target/kubernetes Issues relating to kubernetes cluster scanning
Projects
None yet
Development

No branches or pull requests

2 participants