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 |
---|---|---|---|
| string | mandatory | The name of the repository to update configurations for. |
| mandatory | The updated configurations object for the repository. | |
| 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 |
---|---|---|---|
| boolean | omit / mandatory* | Enables or disables vulnerability contextual analysis. |
| omit / mandatory* | Exposures scan configuration object. | |
| integer | mandatory | Number of days to retain artifacts scan results. Ignored and can be omitted with |
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 |
---|---|---|---|
| mandatory | Exposures’ scanners categories configurations. |
ScannersCategoryObj:
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
| boolean | omit / mandatory* | Enables or disables secrets scanning. |
| boolean | omit / mandatory* | Enables or disables services scanning. |
| boolean | omit / mandatory* | Enables or disables applications scanning. |
| 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 |
---|---|---|---|
| array[PatternObj] | mandatory | Specific paths patterns configuration object. |
| mandatory | Configurations for all other artifacts. |
PatternObj:
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | mandatory | Paths pattern to include in the set specific configuration. |
| string | mandatory | Paths pattern to exclude from the set specific configuration. |
| boolean | mandatory | Whether to scan new artifacts matching this pattern. |
| integer | mandatory | Number of days to retain artifacts matching this pattern. |
OtherArtifactsObj:
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
| boolean | mandatory | Whether to scan new artifacts for all other paths. |
| integer | mandatory | Number of days to retain artifacts for all other paths. |
Response Body:
Name | Type | Description |
---|---|---|
| string | Information message confirming the update. |
| 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" }