Part of the DAST/pentest dogfooding work. Blocks switching the pentest on anywhere.
Problem:pentest/cleanup.rs deletes the test user of an auto-register session with the agent's own Keycloak: the master-realm admin login (KEYCLOAK_ADMIN_USERNAME/_PASSWORD) and our realm (KEYCLOAK_REALM).
session.rs sets the provider to Keycloak whenever the agent has KEYCLOAK_URL, regardless of which identity provider the target uses.
Custom and an unknown provider fall back to our Keycloak as well.
Today it never deletes anything, but only because test_user.username is never written after registration (it stays None and cleanup errors). Once the username is filled in, a pentest of any app could delete a user with the same name in our own realm.
Change:
Cleanup acts only on the target's identity provider, with admin credentials given for that session (sealed like other tenant credentials). It never uses the agent's own Keycloak settings.
No credentials for the target's provider → no deletion. The session report lists the test user as "left behind, delete by hand".
Remove the Custom/None fallback to our Keycloak.
Record the username/e-mail actually registered, so cleanup has something to act on.
Firebase (#17): either implement it the same way (session-scoped service account) or drop the variant. This issue supersedes #17.
Acceptance: a test shows that a session without target-IdP credentials never calls a Keycloak admin endpoint, even with KEYCLOAK_URL and admin credentials configured on the agent. A second test shows that a session with them deletes the user only in the given realm.
Part of the DAST/pentest dogfooding work. Blocks switching the pentest on anywhere.
**Problem:** `pentest/cleanup.rs` deletes the test user of an auto-register session with the agent's **own** Keycloak: the master-realm admin login (`KEYCLOAK_ADMIN_USERNAME`/`_PASSWORD`) and our realm (`KEYCLOAK_REALM`).
- `session.rs` sets the provider to Keycloak whenever the agent has `KEYCLOAK_URL`, regardless of which identity provider the target uses.
- `Custom` and an unknown provider fall back to our Keycloak as well.
Today it never deletes anything, but only because `test_user.username` is never written after registration (it stays `None` and cleanup errors). Once the username is filled in, a pentest of any app could delete a user with the same name in our own realm.
**Change:**
- Cleanup acts only on the **target's** identity provider, with admin credentials given for that session (sealed like other tenant credentials). It never uses the agent's own Keycloak settings.
- No credentials for the target's provider → no deletion. The session report lists the test user as "left behind, delete by hand".
- Remove the `Custom`/`None` fallback to our Keycloak.
- Record the username/e-mail actually registered, so cleanup has something to act on.
- Firebase (#17): either implement it the same way (session-scoped service account) or drop the variant. This issue supersedes #17.
**Acceptance:** a test shows that a session without target-IdP credentials never calls a Keycloak admin endpoint, even with `KEYCLOAK_URL` and admin credentials configured on the agent. A second test shows that a session with them deletes the user only in the given realm.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of the DAST/pentest dogfooding work. Blocks switching the pentest on anywhere.
Problem:
pentest/cleanup.rsdeletes the test user of an auto-register session with the agent's own Keycloak: the master-realm admin login (KEYCLOAK_ADMIN_USERNAME/_PASSWORD) and our realm (KEYCLOAK_REALM).session.rssets the provider to Keycloak whenever the agent hasKEYCLOAK_URL, regardless of which identity provider the target uses.Customand an unknown provider fall back to our Keycloak as well.Today it never deletes anything, but only because
test_user.usernameis never written after registration (it staysNoneand cleanup errors). Once the username is filled in, a pentest of any app could delete a user with the same name in our own realm.Change:
Custom/Nonefallback to our Keycloak.Acceptance: a test shows that a session without target-IdP credentials never calls a Keycloak admin endpoint, even with
KEYCLOAK_URLand admin credentials configured on the agent. A second test shows that a session with them deletes the user only in the given realm.