git.security.get

The repository’s security overview: settings, policy, open alert counts

GET /git/api/repositories/{repoId}/securityIAM git:ListSecurityAlertsRead

`policy` is the first of .github/SECURITY.md, SECURITY.md, docs/SECURITY.md on the default branch (null without git:PullRepository). `dependencyScan` is the last lockfile scan.

Without git:PullRepository the answer is reduced rather than refused.

Request syntax

GET /git/api/repositories/{repoId}/security

Path parameters

  • repoIdRequired

    string

    Constraints: uuid

Response

200 with `settings` (secretPushProtection, dependencyAlerts, maxFileSizeMb), `policy`, `counts` (secretsBypassed, secretsBlocked30d, dependencyCritical, dependencyHigh, dependencyOther, codeScanOpen) and `dependencyScan` (status, commitOid, error, summary, startedAt, finishedAt, or null).

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • settingsAlways

    object

    The security settings of the repository
  • settings.​secretPushProtectionAlways

    boolean

    Pushes that add a known credential format are refused
  • settings.​dependencyAlertsAlways

    boolean

    The default branch's lockfiles are checked against the vulnerability database
  • settings.​maxFileSizeMbAlways

    number, may be null

    Largest file a push may add, in MB; null for the platform default of 100
  • policyAlways

    object, may be null

    The security policy on the default branch; null without one or without git:PullRepository
  • policy.​pathAlways

    string

    Where the policy file is, e.g. SECURITY.md
  • policy.​markdownAlways

    string

    Its text (Markdown), at most 200,000 characters
  • countsAlways

    object

    Open alert counts
  • counts.​secretsBypassedAlways

    number

    Secrets pushed past protection and not yet resolved
  • counts.​secretsBlocked30dAlways

    number

    Pushes refused for a secret in the last 30 days
  • counts.​dependencyCriticalAlways

    number

    Open dependency alerts of critical severity
  • counts.​dependencyHighAlways

    number

    Open dependency alerts of high severity
  • counts.​dependencyOtherAlways

    number

    Open dependency alerts of medium, low or unknown severity
  • counts.​codeScanOpenAlways

    number

    Open code scanning alerts on the default branch
  • dependencyScanAlways

    object, may be null

    The last lockfile scan; null if none ran yet
  • dependencyScan.​statusAlways

    one of running, succeeded, failed

    Where the scan is
  • dependencyScan.​commitOidAlways

    string, may be null

    The default-branch commit it scanned
  • dependencyScan.​errorAlways

    string, may be null

    Why it failed; null otherwise
  • dependencyScan.​summaryAlways

    map, may be null

    Counts the scan reported, by name; null while running
  • dependencyScan.​startedAtAlways

    string

    When it started (ISO 8601)
  • dependencyScan.​finishedAtAlways

    string, may be null

    When it finished (ISO 8601); null while running

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow git:ListSecurityAlerts on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud git security get repoId

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_git_security_get.