OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security
TypeScript ai-securityapplication-securityclicode-scanningcodexcodex-securitycybersecuritydevsecopsnodejsnpmopenaisdksecuritytypescriptvulnerability-scanning
docs(github): show the SDK fallback for finding imports (#2209)
Michael D'Angelo61d554118354
diff --git a/docs/scanner-imports/github-code-scanning.md b/docs/scanner-imports/github-code-scanning.mdindex dff873e76..1a6d91557 100644--- a/docs/scanner-imports/github-code-scanning.md+++ b/docs/scanner-imports/github-code-scanning.md@@ -9,6 +9,7 @@ Sign in with `gh auth login`. A fine-grained token needs **Code scanning alerts:A classic token needs `security_events`, or `public_repo` for a public repository.[GitHub API permissions](https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository)For GitHub Enterprise, set `GH_HOST` to the host you signed in to.+If `gh` is unavailable, the SDK accepts `githubHost` and a `githubToken` for that host.From the destination checkout root, set `repo` to its GitHub repository. Set`source_key` to your existing code scanning key exactly, including case. For adiff --git a/docs/scanner-imports/github-security-advisories.md b/docs/scanner-imports/github-security-advisories.mdindex 7be536744..cbdcd0bf9 100644--- a/docs/scanner-imports/github-security-advisories.md+++ b/docs/scanner-imports/github-security-advisories.md@@ -7,7 +7,10 @@ a dependency in your checkout is affected.## Quick startSign in with `gh auth login`. For GitHub Enterprise, set `GH_HOST` to the host-you signed in to. From the destination checkout root, set `repo` to its GitHub+you signed in to. If `gh` is unavailable, the SDK accepts `githubHost` and a+`githubToken` for that host.++From the destination checkout root, set `repo` to its GitHubrepository and `source_key` to your existing advisories key exactly, includingcase. For a first import, choose a key for the host, repository and findingfamily. Replace `/path/to/private/reports` with an existing private directorydiff --git a/sdk/typescript/docs/cli.md b/sdk/typescript/docs/cli.mdindex 511db291b..f262dd719 100644--- a/sdk/typescript/docs/cli.md+++ b/sdk/typescript/docs/cli.md@@ -2254,7 +2254,8 @@ and preview findings. All three use `--provider github`. Keep a separate sourcekey for each family. Saving locally or publishing to Cloud requires the[external-import opt-in](#import-vendor-findings-locally).-The code-scanning collector uses the GitHub CLI login and `GH_HOST`. A GitHub+The code-scanning and advisory CLI collectors use `gh` to authenticate for+`GH_HOST` (default `github.com`). A GitHubplugin connection can select alerts but does not sign the CLI in.Collection retains the selected ref's instance. Branches keep separateevidence. An alert-wide dismissal takes precedence over the selected instance's@@ -2347,6 +2348,7 @@ import {const findings = await importGitHubCodeScanningAlerts({repository: "example/repository",alertNumbers: [12, 18], // Omit for all open alerts on the default branch.+ githubHost: "github.com",githubToken: process.env["GH_TOKEN"],});@@ -2365,8 +2367,9 @@ try {```SDK options include `state` (default `"open"`), `ref`, and `signal`.-Supply `githubToken` or use `gh auth token` credentials, including GitHub CLI-token environment variables. `githubHost` defaults to `GH_HOST` or `github.com`.+Without `gh`, pass a `githubToken` issued for the selected `githubHost`.+If you omit the token, the SDK asks the GitHub CLI for credentials, including+its supported token environment variables. `githubHost` defaults to `GH_HOST` or `github.com`.The token needs code-scanning read access; access failures reject the import.## Validate and patch findings