Update Repositories Configurations

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Updates Xray’s repository configurations.

Since: 3.41.4

Security: Requires a user with admin permissions.

Usage: PUT /xray/api/v1/repos_config

Consumes: application/json

Produces: application/json

Path parameters: None

Query parameters: None

Request Body:

Name

Type

Mandatory/Optional

Description

repo_name

string

mandatory

The name of the repository to update configurations for.

repo_config

RepoConfigObj

mandatory

The updated configurations object for the repository.

repo_paths_config

RepoPathsConfigObj

optional

The updates paths configuration object for the repository. Use for setting different retention times or where Xray needs to be set to scan only part of the repository.

RepoConfigObj:

Name

Type

Required/Optional

Description

vuln_contextual_analysis

boolean

omit / mandatory*

Enables or disables vulnerability contextual analysis.

exposures

ExposuresObj

omit / mandatory*

Exposures scan configuration object.

retention_in_days

integer

mandatory

Number of days to retain artifacts scan results. Ignored and can be omitted with repo_paths_config.

Note

Omit - w/o JAS entitlement or for not-supported repo / Required - with JAS entitlement for supported repos

Tip

Use the Get Repositories Configurations REST API which returns only the supported types for the repository to get the current settings and modify them.

ExposureObj:

Name

Type

Mandatory/Optional

Description

scanners_category

ScannersCategoryObj

mandatory

Exposures’ scanners categories configurations.

ScannersCategoryObj:

Name

Type

Mandatory/Optional

Description

secrets_scan

boolean

omit / mandatory*

Enables or disables secrets scanning.

services_scan

boolean

omit / mandatory*

Enables or disables services scanning.

applications_scan

boolean

omit / mandatory*

Enables or disables applications scanning.

iac_scan

boolean

omit / mandatory*

Enables or disables Infrastructure as Code (IaC) scanning.

Note

Omit - for non-supported repo / Required - for supported repos

Tip

Use the Get Repositories Configurations REST API which returns only the supported types for the repository to get the current settings and modify them.

RepoPathsConfigObj:

Name

Type

Mandatory/Optional

Description

patterns

array[PatternObj]

mandatory

Specific paths patterns configuration object.

all_other_artifacts

OtherArtifactsObj

mandatory

Configurations for all other artifacts.

PatternObj:

Name

Type

Required/Optional

Description

include

string

mandatory

Paths pattern to include in the set specific configuration.

exclude

string

mandatory

Paths pattern to exclude from the set specific configuration.

index_new_artifacts

boolean

mandatory

Whether to scan new artifacts matching this pattern.

retention_in_days

integer

mandatory

Number of days to retain artifacts matching this pattern.

OtherArtifactsObj:

Name

Type

Mandatory/Optional

Description

index_new_artifacts

boolean

mandatory

Whether to scan new artifacts for all other paths.

retention_in_days

integer

mandatory

Number of days to retain artifacts for all other paths.

Response Body:

Name

Type

Description

info

string

Information message confirming the update.

error

string

Error message text

Response Codes:

Status code

Description

403

Forbidden

401

Unauthorized

400

Failed to decode request

500

Internal Server Error

Example Request:

{
  "repo_name": "docker-local",
  "repo_config": {
    "vuln_contextual_analysis": true,
    "exposures": {
      "scanners_category": {
        "services_scan": true,
        "secrets_scan": false,
        "applications_scan": false
      }
    },
    "retention_in_days": 80
  },
  "repo_paths_config": {
    "patterns": [
      {
        "include": "core/**",
        "exclude": "core/external/**",
        "index_new_artifacts": true,
        "retention_in_days": 45
      }
    ],
    "all_other_artifacts": {
      "index_new_artifacts": true,
      "retention_in_days": 60
    }
  }
}

Example Successful Response:

{
 "info": "Repository configuration has been updated successfully"
}

Example Error Response:

{
 "error": "Value for 'repo_config.retention_in_days' parameter is invalid"
}