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

Publish stable checkpoint periodically to Redis #1461

Merged
merged 8 commits into from
May 14, 2023

Commits on May 9, 2023

  1. Publish stable checkpoint periodically to Redis

    Currently, a log witness countersigns the latest checkpoint Rekor
    publishes. Rekor updates its checkpoint on every entry upload, which is
    extremely frequent. This means that two witnesses are very unlikely to
    countersign the same checkpoint. While gossiping, it will not be
    possible to reach a consensus on the same checkpoint, and therefore we
    can't mitigate split-view attacks.
    
    This change publishes a checkpoint, a "stable checkpoint", every 5
    minutes (configurable) to Redis. This runs as a goroutine, with a Redis
    key derived from the current time rounded to the nearest 5 minutes.
    We use set-if-not-exist for Redis, meaning you can run replicated instances of
    Rekor, with all instances writing to the same Redis key.
    
    For a client that wants to gossip, this means waiting 5 minutes before
    a checkpoint is published that witnesses will countersign (Note that
    this is an area of active development and research too).
    The stable checkpoint can be accessed with a query parameter.
    
    Fixes sigstore#1067. There is still
    value in batching in terms of reliablity, but stable checkpoints
    solve the gossiping issue without a breaking change.
    
    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 9, 2023
    Configuration menu
    Copy the full SHA
    ae09bf7 View commit details
    Browse the repository at this point in the history
  2. Use latest key to access latest checkpoint

    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 9, 2023
    Configuration menu
    Copy the full SHA
    081b485 View commit details
    Browse the repository at this point in the history
  3. Add test

    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 9, 2023
    Configuration menu
    Copy the full SHA
    44df803 View commit details
    Browse the repository at this point in the history
  4. Return early if key already exists

    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 9, 2023
    Configuration menu
    Copy the full SHA
    1d21d91 View commit details
    Browse the repository at this point in the history
  5. Add comment explaining failure handling

    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 9, 2023
    Configuration menu
    Copy the full SHA
    496d42f View commit details
    Browse the repository at this point in the history

Commits on May 10, 2023

  1. Apply suggestions from code review

    Co-authored-by: Bob Callaway <bobcallaway@users.noreply.github.com>
    Signed-off-by: Hayden B <hblauzvern@google.com>
    haydentherapper and bobcallaway authored May 10, 2023
    Configuration menu
    Copy the full SHA
    7556390 View commit details
    Browse the repository at this point in the history
  2. Fix goroutine leak, check if redis client is configured

    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 10, 2023
    Configuration menu
    Copy the full SHA
    98cb398 View commit details
    Browse the repository at this point in the history
  3. Add test for goroutine leak

    Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
    haydentherapper committed May 10, 2023
    Configuration menu
    Copy the full SHA
    2112494 View commit details
    Browse the repository at this point in the history