Creates a new registry connector for based on the provided details.
Required license:
Cortex Cloud Posture Management or Cortex Cloud Runtime Security.
Authorization
String
required
{api_key}
{api_key}
UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP
x-xdr-auth-id
String
required
{api_key_id}
{api_key_id}
241
curl -X 'POST'
-H
'Accept: application/json,application/json; charset=UTF-8'
-H
'Content-Type: application/json'
-H
'Authorization: UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP '
-H
'x-xdr-auth-id: 241'
'https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances'
-d
'{
"ca_certificate" : "ca_certificate",
"tenant_id" : "tenant_id",
"allow_static_ips" : true,
"repository" : "repository",
"enabled" : true,
"password" : "password",
"filter_type" : "",
"initial_scan_configuration" : {
"mode" : "TAGS_MODIFIED_DAYS",
"numDays" : 7
},
"outpost_id" : "outpost_id",
"ip_identifier" : "ip_identifier",
"broker_id" : "broker_id",
"asset_scope_filters" : {
"AND" : [ null, null ]
},
"url" : "url",
"insecure_pull" : true,
"connector_id" : "connector_id",
"name" : "name",
"broker_type" : "",
"auth_token" : "auth_token",
"region" : "region",
"vendor_specific_configuration" : {
"group_ids" : "group_ids",
"api_domain_name" : "api_domain_name",
"project_ids" : "project_ids"
},
"username" : "username"
}'
import http.client
conn = http.client.HTTPSConnection("api-yourfqdn")
payload = "{\"connector_id\":\"string\",\"vendor\":\"DOCKER\",\"name\":\"string\",\"enabled\":true,\"url\":\"string\",\"username\":\"string\",\"password\":\"string\",\"auth_token\":\"string\",\"scanning_mode\":\"CLOUD\",\"cloud_provider\":\"AWS\",\"outpost_id\":\"string\",\"region\":\"string\",\"insecure_pull\":true,\"ca_certificate\":\"string\",\"repository\":\"string\",\"initial_scan_configuration\":{\"mode\":\"TAGS_MODIFIED_DAYS\",\"numDays\":7},\"allow_static_ips\":true,\"ip_identifier\":\"string\",\"asset_scope_filters\":{\"AND\":[{\"AND\":[null]}]},\"registry_type\":\"CLOUD_HOSTED\",\"tenant_id\":\"string\",\"broker_type\":\"BROKER_VM\",\"broker_id\":\"string\",\"filter_type\":\"INCLUDE\",\"vendor_specific_configuration\":{\"group_ids\":\"string\",\"project_ids\":\"string\",\"api_domain_name\":\"string\"}}"
headers = {
'Authorization': "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ",
'x-xdr-auth-id': "241",
'content-type': "application/json"
}
conn.request("POST", "/public_api/v1/cwp/registry_onboarding/instances", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP '
request["x-xdr-auth-id"] = '241'
request["content-type"] = 'application/json'
request.body = "{\"connector_id\":\"string\",\"vendor\":\"DOCKER\",\"name\":\"string\",\"enabled\":true,\"url\":\"string\",\"username\":\"string\",\"password\":\"string\",\"auth_token\":\"string\",\"scanning_mode\":\"CLOUD\",\"cloud_provider\":\"AWS\",\"outpost_id\":\"string\",\"region\":\"string\",\"insecure_pull\":true,\"ca_certificate\":\"string\",\"repository\":\"string\",\"initial_scan_configuration\":{\"mode\":\"TAGS_MODIFIED_DAYS\",\"numDays\":7},\"allow_static_ips\":true,\"ip_identifier\":\"string\",\"asset_scope_filters\":{\"AND\":[{\"AND\":[null]}]},\"registry_type\":\"CLOUD_HOSTED\",\"tenant_id\":\"string\",\"broker_type\":\"BROKER_VM\",\"broker_id\":\"string\",\"filter_type\":\"INCLUDE\",\"vendor_specific_configuration\":{\"group_ids\":\"string\",\"project_ids\":\"string\",\"api_domain_name\":\"string\"}}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"connector_id": "string",
"vendor": "DOCKER",
"name": "string",
"enabled": true,
"url": "string",
"username": "string",
"password": "string",
"auth_token": "string",
"scanning_mode": "CLOUD",
"cloud_provider": "AWS",
"outpost_id": "string",
"region": "string",
"insecure_pull": true,
"ca_certificate": "string",
"repository": "string",
"initial_scan_configuration": {
"mode": "TAGS_MODIFIED_DAYS",
"numDays": 7
},
"allow_static_ips": true,
"ip_identifier": "string",
"asset_scope_filters": {
"AND": [
{
"AND": [
null
]
}
]
},
"registry_type": "CLOUD_HOSTED",
"tenant_id": "string",
"broker_type": "BROKER_VM",
"broker_id": "string",
"filter_type": "INCLUDE",
"vendor_specific_configuration": {
"group_ids": "string",
"project_ids": "string",
"api_domain_name": "string"
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances");
xhr.setRequestHeader("Authorization", "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ");
xhr.setRequestHeader("x-xdr-auth-id", "241");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.post("https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances")
.header("Authorization", "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ")
.header("x-xdr-auth-id", "241")
.header("content-type", "application/json")
.body("{\"connector_id\":\"string\",\"vendor\":\"DOCKER\",\"name\":\"string\",\"enabled\":true,\"url\":\"string\",\"username\":\"string\",\"password\":\"string\",\"auth_token\":\"string\",\"scanning_mode\":\"CLOUD\",\"cloud_provider\":\"AWS\",\"outpost_id\":\"string\",\"region\":\"string\",\"insecure_pull\":true,\"ca_certificate\":\"string\",\"repository\":\"string\",\"initial_scan_configuration\":{\"mode\":\"TAGS_MODIFIED_DAYS\",\"numDays\":7},\"allow_static_ips\":true,\"ip_identifier\":\"string\",\"asset_scope_filters\":{\"AND\":[{\"AND\":[null]}]},\"registry_type\":\"CLOUD_HOSTED\",\"tenant_id\":\"string\",\"broker_type\":\"BROKER_VM\",\"broker_id\":\"string\",\"filter_type\":\"INCLUDE\",\"vendor_specific_configuration\":{\"group_ids\":\"string\",\"project_ids\":\"string\",\"api_domain_name\":\"string\"}}")
.asString();import Foundation
let headers = [
"Authorization": "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ",
"x-xdr-auth-id": "241",
"content-type": "application/json"
]
let parameters = [
"connector_id": "string",
"vendor": "DOCKER",
"name": "string",
"enabled": true,
"url": "string",
"username": "string",
"password": "string",
"auth_token": "string",
"scanning_mode": "CLOUD",
"cloud_provider": "AWS",
"outpost_id": "string",
"region": "string",
"insecure_pull": true,
"ca_certificate": "string",
"repository": "string",
"initial_scan_configuration": [
"mode": "TAGS_MODIFIED_DAYS",
"numDays": 7
],
"allow_static_ips": true,
"ip_identifier": "string",
"asset_scope_filters": ["AND": [["AND": []]]],
"registry_type": "CLOUD_HOSTED",
"tenant_id": "string",
"broker_type": "BROKER_VM",
"broker_id": "string",
"filter_type": "INCLUDE",
"vendor_specific_configuration": [
"group_ids": "string",
"project_ids": "string",
"api_domain_name": "string"
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"connector_id\":\"string\",\"vendor\":\"DOCKER\",\"name\":\"string\",\"enabled\":true,\"url\":\"string\",\"username\":\"string\",\"password\":\"string\",\"auth_token\":\"string\",\"scanning_mode\":\"CLOUD\",\"cloud_provider\":\"AWS\",\"outpost_id\":\"string\",\"region\":\"string\",\"insecure_pull\":true,\"ca_certificate\":\"string\",\"repository\":\"string\",\"initial_scan_configuration\":{\"mode\":\"TAGS_MODIFIED_DAYS\",\"numDays\":7},\"allow_static_ips\":true,\"ip_identifier\":\"string\",\"asset_scope_filters\":{\"AND\":[{\"AND\":[null]}]},\"registry_type\":\"CLOUD_HOSTED\",\"tenant_id\":\"string\",\"broker_type\":\"BROKER_VM\",\"broker_id\":\"string\",\"filter_type\":\"INCLUDE\",\"vendor_specific_configuration\":{\"group_ids\":\"string\",\"project_ids\":\"string\",\"api_domain_name\":\"string\"}}",
CURLOPT_HTTPHEADER => [
"Authorization: UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ",
"content-type: application/json",
"x-xdr-auth-id: 241"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ");
headers = curl_slist_append(headers, "x-xdr-auth-id: 241");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"connector_id\":\"string\",\"vendor\":\"DOCKER\",\"name\":\"string\",\"enabled\":true,\"url\":\"string\",\"username\":\"string\",\"password\":\"string\",\"auth_token\":\"string\",\"scanning_mode\":\"CLOUD\",\"cloud_provider\":\"AWS\",\"outpost_id\":\"string\",\"region\":\"string\",\"insecure_pull\":true,\"ca_certificate\":\"string\",\"repository\":\"string\",\"initial_scan_configuration\":{\"mode\":\"TAGS_MODIFIED_DAYS\",\"numDays\":7},\"allow_static_ips\":true,\"ip_identifier\":\"string\",\"asset_scope_filters\":{\"AND\":[{\"AND\":[null]}]},\"registry_type\":\"CLOUD_HOSTED\",\"tenant_id\":\"string\",\"broker_type\":\"BROKER_VM\",\"broker_id\":\"string\",\"filter_type\":\"INCLUDE\",\"vendor_specific_configuration\":{\"group_ids\":\"string\",\"project_ids\":\"string\",\"api_domain_name\":\"string\"}}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-yourfqdn/public_api/v1/cwp/registry_onboarding/instances");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ");
request.AddHeader("x-xdr-auth-id", "241");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"connector_id\":\"string\",\"vendor\":\"DOCKER\",\"name\":\"string\",\"enabled\":true,\"url\":\"string\",\"username\":\"string\",\"password\":\"string\",\"auth_token\":\"string\",\"scanning_mode\":\"CLOUD\",\"cloud_provider\":\"AWS\",\"outpost_id\":\"string\",\"region\":\"string\",\"insecure_pull\":true,\"ca_certificate\":\"string\",\"repository\":\"string\",\"initial_scan_configuration\":{\"mode\":\"TAGS_MODIFIED_DAYS\",\"numDays\":7},\"allow_static_ips\":true,\"ip_identifier\":\"string\",\"asset_scope_filters\":{\"AND\":[{\"AND\":[null]}]},\"registry_type\":\"CLOUD_HOSTED\",\"tenant_id\":\"string\",\"broker_type\":\"BROKER_VM\",\"broker_id\":\"string\",\"filter_type\":\"INCLUDE\",\"vendor_specific_configuration\":{\"group_ids\":\"string\",\"project_ids\":\"string\",\"api_domain_name\":\"string\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);connector_idstringThe connector ID.
The connector ID.
vendorstring (Enum)requiredName of the registry vendor.
Name of the registry vendor.
namestringrequiredName of the registry connector.
Name of the registry connector.
enabledbooleanIndicates whether the connector is enabled.
Indicates whether the connector is enabled.
trueurlstringrequiredThe URL of the registry.
The URL of the registry.
usernamestringrequiredThe username for authentication.
The username for authentication.
passwordstringrequiredThe password for authentication.
The password for authentication.
auth_tokenstringrequiredToken to authenticate the request.
Token to authenticate the request.
scanning_modestring (Enum)requiredThe scanning mode used by the connector
The scanning mode used by the connector
cloud_providerstring (Enum)Specifies the cloud provider for the Cortex environment to use for registry scanning.
Specifies the cloud provider for the Cortex environment to use for registry scanning.
outpost_idstringThe outpost ID.
The outpost ID.
regionstringrequiredSpecifies the region to use for registry scanning. As a best practice, choose the region closest to your registry deployment to achieve the best scanning throughput and potentially reduce cloud costs.
Specifies the region to use for registry scanning. As a best practice, choose the region closest to your registry deployment to achieve the best scanning throughput and potentially reduce cloud costs.
insecure_pullbooleanrequiredWhen set to true, allows image pulls from insecure registries.
When set to true, allows image pulls from insecure registries.
ca_certificatestringOptional. The CA certificate used for authentication.
Optional. The CA certificate used for authentication.
repositorystringOptional. The repository used for image discovery.
Optional. The repository used for image discovery.
initial_scan_configurationobjectrequired
modestring (Enum)Specifies the initial scan configuration mode.
ALL — Scans all container images, including every tag, in all discovered repositories.
LATEST_TAG — Scans only images tagged as latest in all discovered repositories.
TAGS_MODIFIED_DAYS — Scans images in each repository modified within the last X days, where X is set via an argument. You can select a range of up to 90 days for the scan.
Specifies the initial scan configuration mode.
ALL— Scans all container images, including every tag, in all discovered repositories.LATEST_TAG— Scans only images tagged aslatestin all discovered repositories.TAGS_MODIFIED_DAYS— Scans images in each repository modified within the last X days, where X is set via an argument. You can select a range of up to 90 days for the scan.
"TAGS_MODIFIED_DAYS""ALL"numDaysintegerNumber of days for the scan mode lastNDays
Number of days for the scan mode lastNDays
7allow_static_ipsbooleanOptional. Indicates whether static IP addresses are allowed.
Optional. Indicates whether static IP addresses are allowed.
ip_identifierstringOptional. The identifier associated with the IP address.
Optional. The identifier associated with the IP address.
asset_scope_filtersobjectDefines the type of assets to be filtered (the scope). You can combine multiple conditions to create complex rules for when the asset filter should be applied.
Defines the type of assets to be filtered (the scope). You can combine multiple conditions to create complex rules for when the asset filter should be applied.
ANDarray
ANDarray
ORarray
SEARCH_FIELDstringDefines the Field to be searched.
Defines the Field to be searched.
"Registry"SEARCH_TYPEstringDefines the comparison operator to use for this filter.
Defines the comparison operator to use for this filter.
"EQ"SEARCH_VALUEstringDefines the value to be searched.
Defines the value to be searched.
"library/ubuntu"ORarray
ANDarray
ORarray
SEARCH_FIELDstringDefines the Field to be searched.
Defines the Field to be searched.
"Registry"SEARCH_TYPEstringDefines the comparison operator to use for this filter.
Defines the comparison operator to use for this filter.
"EQ"SEARCH_VALUEstringDefines the value to be searched.
Defines the value to be searched.
"library/ubuntu"SEARCH_FIELDstringDefines the Field to be searched.
Defines the Field to be searched.
"Registry"SEARCH_TYPEstringDefines the comparison operator to use for this filter.
Defines the comparison operator to use for this filter.
"EQ"SEARCH_VALUEstringDefines the value to be searched.
Defines the value to be searched.
"library/ubuntu"registry_typestring (Enum)The type of registry.
The type of registry.
tenant_idstringThe tenant ID
The tenant ID
broker_typeobject
string (Enum)Indicates the Broker VM type used by the Outpost.
Indicates the Broker VM type used by the Outpost.
broker_idstringThe broker ID.
The broker ID.
filter_typeobjectControls whether asset_scope_filters act as an inclusion or exclusion filter.
Controls whether asset_scope_filters act as an inclusion or exclusion filter.
"INCLUDE" string (Enum)Controls whether asset_scope_filters act as an inclusion or exclusion filter.
Controls whether asset_scope_filters act as an inclusion or exclusion filter.
"INCLUDE"vendor_specific_configurationobjectVendor specific configuration options for scanning.
Vendor specific configuration options for scanning.
group_idsstringOptional. The group IDs to scan.
Optional. The group IDs to scan.
project_idsstringOptional. The project IDs to scan.
Optional. The project IDs to scan.
api_domain_namestringOptional. The API domain name to use for the scan.
Optional. The API domain name to use for the scan.
repositorystringOptional. The Docker Hub repository to scan.
Optional. The Docker Hub repository to scan.
"my-repo"cluster_idstringThe unique identifier of the OpenShift cluster.
The unique identifier of the OpenShift cluster.
cluster_namestringThe name of the OpenShift cluster.
The name of the OpenShift cluster.
cluster_asset_idstringThe asset ID associated with the cluster.
The asset ID associated with the cluster.
cluster_asset_type_idstringThe asset type ID of the cluster.
The asset type ID of the cluster.
cluster_realmstringThe realm or environment in which the cluster resides.
The realm or environment in which the cluster resides.
{
"connector_id": "example",
"vendor": "DOCKER",
"name": "example",
"enabled": false,
"url": "example",
"username": "example",
"password": "example",
"auth_token": "example",
"scanning_mode": "CLOUD",
"cloud_provider": "AWS",
"outpost_id": "example",
"region": "example",
"insecure_pull": false,
"ca_certificate": "example",
"repository": "example",
"initial_scan_configuration": {
"mode": "TAGS_MODIFIED_DAYS",
"numDays": 7
},
"allow_static_ips": false,
"ip_identifier": "example",
"asset_scope_filters": {
"AND": [
{
"AND": [
{}
]
}
]
},
"registry_type": "CLOUD_HOSTED",
"tenant_id": "example",
"broker_type": "BROKER_VM",
"broker_id": "example",
"filter_type": "INCLUDE",
"vendor_specific_configuration": {
"group_ids": "example",
"project_ids": "example",
"api_domain_name": "example"
}
}{
"connector_id": "example",
"vendor": "DOCKER",
"name": "example",
"enabled": false,
"url": "example",
"username": "example",
"password": "example",
"auth_token": "example",
"scanning_mode": "CLOUD",
"cloud_provider": "AWS",
"outpost_id": "example",
"region": "example",
"insecure_pull": false,
"ca_certificate": "example",
"repository": "example",
"initial_scan_configuration": {
"mode": "TAGS_MODIFIED_DAYS",
"numDays": 7
},
"allow_static_ips": false,
"ip_identifier": "example",
"asset_scope_filters": {
"SEARCH_FIELD": "Registry",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": "library/ubuntu"
},
"registry_type": "CLOUD_HOSTED",
"tenant_id": "example",
"broker_type": "BROKER_VM",
"broker_id": "example",
"filter_type": "INCLUDE",
"vendor_specific_configuration": {
"group_ids": "example",
"project_ids": "example",
"api_domain_name": "example"
}
}