Skip to content

fix: OIDC/SAML logout, empty-target queries/carves, carve bulk actions, envless login#842

Merged
javuto merged 4 commits into
jmpsec:mainfrom
alvarofraguas:pr/fix-oidc-logout-cookie-path
May 21, 2026
Merged

fix: OIDC/SAML logout, empty-target queries/carves, carve bulk actions, envless login#842
javuto merged 4 commits into
jmpsec:mainfrom
alvarofraguas:pr/fix-oidc-logout-cookie-path

Conversation

@alvarofraguas
Copy link
Copy Markdown
Collaborator

@alvarofraguas alvarofraguas commented May 21, 2026

Summary

  • OIDC logout cookie path fix: the osctrl_id_token cookie was scoped to /api/v1/oidc — the logout handler at /api/v1/logout couldn't see it, so OIDC sessions fell through to the SAML logout path. Widened cookie path to /.
  • SAML IdP session termination: on logout, if the session was SAML-authenticated, the frontend now redirects to the IdP's logout URL (configurable via SAML_LOGOUT_URL) so the IdP session is killed too — prevents silent re-login.
  • Auth provider documentation: new docs/auth-providers.md covering Keycloak, Auth0, Okta, and Entra ID configuration gotchas for both OIDC and SAML.
  • Empty-target query/carve fix: CreateQueryCarve() returned an empty node list when no targeting criteria were specified, silently creating queries/carves that targeted zero nodes. Now defaults to all active nodes in the environment — matching the SPA's stated behavior.
  • Carve bulk actions: the carves list page now has select-all, per-row checkboxes, and a bulk action toolbar (delete/expire/complete), matching the existing queries list page.
  • Envless login: POST /api/v1/login now accepts credentials without requiring an environment UUID in the path. The SPA login page drops the environment selector — users just enter username and password. The old POST /api/v1/login/{env} path remains for backward compatibility.

Test plan

  • SAML logout verified on Kali Docker stack against Auth0 — full flow: SAML login → logout → Auth0 session killed → OIDC requires re-auth
  • OIDC logout still works after cookie path change
  • Query with no targets: API returns 200, creates node_queries for all 3 active nodes (was 0 before)
  • Carve with no targets: API returns 201, creates node_queries for all 3 active nodes (was 0 before)
  • Query with specific UUID target: still targets only 1 node (no regression)
  • Carve delete via API: returns 200 with success message
  • Envless login POST /api/v1/login returns JWT — verified on Kali Docker via both direct API and HTTPS proxy
  • Old env-based login POST /api/v1/login/{env} still works (backward compat)
  • SPA login page loads with no environment selector
  • Frontend typecheck passes (tsc --noEmit)
  • Go builds clean (go build ./cmd/api/ && go build ./cmd/admin/)

The OIDC callback set the id_token cookie with Path=/api/v1/auth/
but the logout endpoint lives at /api/v1/logout — outside that
scope. The browser never sent the cookie on logout requests, so the
handler couldn't identify OIDC sessions and skipped the IdP
end-session redirect. Widen to /api/v1/ which covers both paths.
Add SAML_LOGOUT_URL flag so the logout handler can return an IdP
session-termination URL for SAML users. The SPA navigates to it with
Auth0-style `returnTo` + `client_id` params (vs OIDC's
`post_logout_redirect_uri`), killing the IdP session and preventing
silent re-auth on the next SSO click.

Also adds docs/auth-providers.md covering OIDC and SAML configuration
for Keycloak, Auth0, Okta, and Entra ID — including the non-obvious
gotchas (Auth0 HS256 default, attribute namespace differences, groups
claim setup).
…fied + add carve bulk actions

CreateQueryCarve() returned an empty node list when all target lists were empty,
silently creating queries/carves that targeted zero nodes. Now defaults to all
active nodes in the environment — matching the SPA's stated behavior ("the query
will fire against all nodes in this env"). Also adds delete/expire/complete bulk
actions to the carves list page, mirroring the existing queries list page.
Cherry-picked from pr/envless-login. The /login endpoint now accepts
credentials without requiring an environment — it tries all envs the
user has access to. The SPA login page drops the environment selector.
@alvarofraguas alvarofraguas changed the title fix: OIDC/SAML logout, empty-target queries/carves, carve bulk actions fix: OIDC/SAML logout, empty-target queries/carves, carve bulk actions, envless login May 21, 2026
@javuto javuto added osctrl-api osctrl-api related changes 🔐 security Security related issues ⭐️ frontend Frontend related issues labels May 21, 2026
@javuto javuto merged commit 59062c1 into jmpsec:main May 21, 2026
3 checks passed
@javuto javuto added the 🚧 bugfix Fix for an existing bug label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚧 bugfix Fix for an existing bug ⭐️ frontend Frontend related issues osctrl-api osctrl-api related changes 🔐 security Security related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants