Skip to content

[Problem RFC] Stale Secret Environment Variable After Database Credential Rotation #822

Closed

Description

@Ipetr14

Hi! I am working on the evaluation task, and I have an idea for a new benchmark problem.

My idea for the issue is a credential-rotation failure, when a backend password and Secret that stores this password are changed, but the pod keeps using the old credentials which were stored in the Secret before the rotation. Similar issue of stale credentials caused outage of multiple Cloudflare services (Link). Only nuance is that this particular incident is not described well, so to simulate the issue when pod uses stale credentials I plan to use fact that if the container uses a Secret stored as an environment variable, the Secret update will not be seen by the container unless it is restarted (Link).

How I plan to simulate this failure on SREGym:

  1. Use the astronomy-shop application, probably product-catalog with PostgreSQL.
  2. Patch product-catalog so DB_CONNECTION_STRING comes from a Kubernetes Secret, then start it once with the old working password.
  3. Rotate the PostgreSQL password and update the Secret to the new connection string, but do not restart product-catalog.
  4. Terminate existing PostgreSQL sessions so product-catalog has to reconnect using its stale old credential.

To diagnose this issue, the agent is expected to go beyond the simple check of pods since with this issue they would be all running, and find that the DB-backed product behavior is failing. It could then trace the failure to product-catalog, inspect how DB_CONNECTION_STRING is provided, check that the Kubernetes Secret and PostgreSQL now use the new password, and infer that the running pod still has the old Secret value because it was not restarted after the credential rotation. To mitigate the problem, agent should just restart the product-catalog pod.

Let me know what you think about this problem and if it is a good idea for a benchmark problem!

Activity

  1. Saadmrp1038 commented on May 30, 2026

    @Saadmrp1038
    Collaborator

    @Ipetr14 Thanks for the RFC! Your plan looks alright. It's an interesting problem where the diagnosis seems harder than mitigation. Even if the diagnosis is totally wrong there's high likelihood the agent would randomly mitigate the problem by restarting the fault.

    One thing about the Cloudflare incident. It's not a 1:1 match. There the creds went to the wrong environment so a restart wouldn't have helped, whereas your fault is fixed by a restart. Can you find any incident that matches this mechanism where env was updated but service wasn't restarted?

  2. Ipetr14 commented on May 30, 2026

    @Ipetr14
    ContributorAuthor

    Makes sense, thanks for pointing out the mismatch. I looked over different issues, and the closest one I think is this one: Link. As I understand it, this particular issue has a similar mechanism to my proposal, the user changed the env file, but the changes weren't picked up until the manual restart. Is this a similar mechanism, or should I look further?

  3. Saadmrp1038 commented on May 30, 2026

    @Saadmrp1038
    Collaborator

    @Ipetr14 Seems good to me. Do test it properly to document the symptoms and where they show up.

  4. tianyin commented on Jun 4, 2026

    @tianyin
    Contributor

    I close it as it's implemented in #851.

    Let's use #851 to track the progress. Thanks for the efforts @Ipetr14 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions