Files
Michael D'Angeloandmldangelo 6871181ef9 fix: preserve Continuum import retries and active sign-in credentials (#2531)
* fix(publish): explain when Cloud import is unavailable

`publish findings --to cloud` starts with the repository catalog. For a
ChatGPT account or deployment without Codex Security Cloud import, that
request returns 404 and the CLI printed only "Cloud import failed (HTTP
404). Not found", which does not say whether the repository, the file, or
the account was missing.

Keep the server's text and add the same explanation `publish scan` gives
for this case: Cloud import is not available for this account or
deployment. Other statuses and endpoints are unchanged.

* fix(publish): handle an empty catalog error response

* docs(imports): correct AWS Continuum and mktemp guidance

- Name the first AWS CLI v2 release with `aws continuum` (2.38.5); earlier
  v2 releases reject the command.
- Say that validation results come with findings Continuum detects, while
  findings submitted to Continuum can omit them.
- macOS `mktemp -d` ignores TMPDIR, so the advice to set TMPDIR did not
  move report directories there. Suggest a template instead.

* docs(imports): honor temporary report paths and clarify validation evidence

* fix(imports): read Continuum weakness IDs from subCategory

Findings that AWS Continuum detects itself omit cweIds and name their
weakness only in subCategory, for example "CWE-89: Improper
Neutralization ...". The reader mapped weakness_ids from cweIds alone,
so every native Continuum code finding imported without a CWE.

Fall back to the leading CWE ID in subCategory when cweIds is absent.
Explicit cweIds still win, and the previous-release replay projection
keeps reading cweIds only.

* fix(imports): preserve Continuum replay and evidence admission

* fix(cli): point native sign-in hints at codex-security login

After starting browser sign-in, native Codex prints "On a remote or
headless machine? Use `codex login --device-auth` instead." Running that
command signs in to the regular Codex home, not the Codex Security
credential home, so the suggested recovery does not help.

For the sign-in commands that pass native output straight through
(login, login status and logout), forward native stderr through a small
streaming rewrite of `codex login` to `codex-security login`. Stdin and
stdout stay attached to the terminal, other output is unchanged, and only
a possible partial match is held back between chunks.

* fix(cli): forward login hints and reap interrupted sign-ins

* fix(auth): sign in with the credential storage set in Codex config

On macOS, a fresh `codex-security login` could not be used to publish to
Cloud. Scans write `cli_auth_credentials_store = "auto"` into the Codex
Security credential home, so native login saved the token in the system
keyring and removed auth.json, while Cloud publication reads file-backed
credentials only.

The documented fix, setting `cli_auth_credentials_store = "file"` in
Codex config.toml and signing in again, had no effect: `login` used
whatever the last scan wrote, and SDK scans ignored the user's Codex
config for sign-in settings (only skill commands mirrored it).

- Layer the user's Codex config sign-in settings
  (cli_auth_credentials_store, forced_login_method,
  forced_chatgpt_workspace_id) between the wrapper defaults and explicit
  overrides in mergedCodexConfig, so scans, their runtime config and Deep
  Scan workers use them. A Codex config that cannot be read or parsed
  sets no preference here; the commands that use it still report why.
- Before `login` and `login status`, write the keys that config sets into
  the credential home. Native argv is unchanged, so managed policy still
  wins. Unset keys and `logout` leave the stored location alone.
- Make the Cloud sign-in error and CLI docs name the setting and command.

* fix(cli): exit interrupted login when stderr stops draining

* fix(auth): keep sign-in, credential cleanup, and Cloud publication consistent

* fix(sdk): cancel queued logins without aborting settled operations

* test(sdk): guard the budget cancellation wait after usage is recorded

---------

Co-authored-by: mldangelo <michael.l.dangelo@gmail.com>
2026-11-09 21:35:39 -08:00
..