curl --request POST \
--url https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials \
--header 'Content-Type: application/json' \
--data '
{
"name": "ECR Prod",
"awsRegion": "us-east-1",
"credentialId": "<string>",
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"credentialType": "static_keys",
"awsAccountId": "123456789012",
"awsAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"awsSecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"roleArn": "arn:aws:iam::123456789012:role/cybedefend-ecr",
"externalId": "<string>",
"description": "Production ECR registry"
}
'import requests
url = "https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials"
payload = {
"name": "ECR Prod",
"awsRegion": "us-east-1",
"credentialId": "<string>",
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"credentialType": "static_keys",
"awsAccountId": "123456789012",
"awsAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"awsSecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"roleArn": "arn:aws:iam::123456789012:role/cybedefend-ecr",
"externalId": "<string>",
"description": "Production ECR registry"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'ECR Prod',
awsRegion: 'us-east-1',
credentialId: '<string>',
projectId: '097bbbf4-d1eb-4512-9950-684445279808',
credentialType: 'static_keys',
awsAccountId: '123456789012',
awsAccessKeyId: 'AKIAIOSFODNN7EXAMPLE',
awsSecretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
roleArn: 'arn:aws:iam::123456789012:role/cybedefend-ecr',
externalId: '<string>',
description: 'Production ECR registry'
})
};
fetch('https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'ECR Prod',
'awsRegion' => 'us-east-1',
'credentialId' => '<string>',
'projectId' => '097bbbf4-d1eb-4512-9950-684445279808',
'credentialType' => 'static_keys',
'awsAccountId' => '123456789012',
'awsAccessKeyId' => 'AKIAIOSFODNN7EXAMPLE',
'awsSecretAccessKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
'roleArn' => 'arn:aws:iam::123456789012:role/cybedefend-ecr',
'externalId' => '<string>',
'description' => 'Production ECR registry'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials"
payload := strings.NewReader("{\n \"name\": \"ECR Prod\",\n \"awsRegion\": \"us-east-1\",\n \"credentialId\": \"<string>\",\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"credentialType\": \"static_keys\",\n \"awsAccountId\": \"123456789012\",\n \"awsAccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n \"awsSecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n \"roleArn\": \"arn:aws:iam::123456789012:role/cybedefend-ecr\",\n \"externalId\": \"<string>\",\n \"description\": \"Production ECR registry\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"ECR Prod\",\n \"awsRegion\": \"us-east-1\",\n \"credentialId\": \"<string>\",\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"credentialType\": \"static_keys\",\n \"awsAccountId\": \"123456789012\",\n \"awsAccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n \"awsSecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n \"roleArn\": \"arn:aws:iam::123456789012:role/cybedefend-ecr\",\n \"externalId\": \"<string>\",\n \"description\": \"Production ECR registry\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"ECR Prod\",\n \"awsRegion\": \"us-east-1\",\n \"credentialId\": \"<string>\",\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"credentialType\": \"static_keys\",\n \"awsAccountId\": \"123456789012\",\n \"awsAccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n \"awsSecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n \"roleArn\": \"arn:aws:iam::123456789012:role/cybedefend-ecr\",\n \"externalId\": \"<string>\",\n \"description\": \"Production ECR registry\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"awsAccountId": "123456789012",
"awsRegion": "us-east-1",
"createdAt": "2025-01-01T00:00:00Z",
"awsAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"credentialType": "static_keys",
"roleArn": "arn:aws:iam::123456789012:role/cybedefend-ecr",
"description": "Production ECR registry"
}Store ECR Container Registry credentials
Stores AWS Elastic Container Registry credentials at organization level. The credentials will be encrypted and stored securely.
curl --request POST \
--url https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials \
--header 'Content-Type: application/json' \
--data '
{
"name": "ECR Prod",
"awsRegion": "us-east-1",
"credentialId": "<string>",
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"credentialType": "static_keys",
"awsAccountId": "123456789012",
"awsAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"awsSecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"roleArn": "arn:aws:iam::123456789012:role/cybedefend-ecr",
"externalId": "<string>",
"description": "Production ECR registry"
}
'import requests
url = "https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials"
payload = {
"name": "ECR Prod",
"awsRegion": "us-east-1",
"credentialId": "<string>",
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"credentialType": "static_keys",
"awsAccountId": "123456789012",
"awsAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"awsSecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"roleArn": "arn:aws:iam::123456789012:role/cybedefend-ecr",
"externalId": "<string>",
"description": "Production ECR registry"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'ECR Prod',
awsRegion: 'us-east-1',
credentialId: '<string>',
projectId: '097bbbf4-d1eb-4512-9950-684445279808',
credentialType: 'static_keys',
awsAccountId: '123456789012',
awsAccessKeyId: 'AKIAIOSFODNN7EXAMPLE',
awsSecretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
roleArn: 'arn:aws:iam::123456789012:role/cybedefend-ecr',
externalId: '<string>',
description: 'Production ECR registry'
})
};
fetch('https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'ECR Prod',
'awsRegion' => 'us-east-1',
'credentialId' => '<string>',
'projectId' => '097bbbf4-d1eb-4512-9950-684445279808',
'credentialType' => 'static_keys',
'awsAccountId' => '123456789012',
'awsAccessKeyId' => 'AKIAIOSFODNN7EXAMPLE',
'awsSecretAccessKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
'roleArn' => 'arn:aws:iam::123456789012:role/cybedefend-ecr',
'externalId' => '<string>',
'description' => 'Production ECR registry'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials"
payload := strings.NewReader("{\n \"name\": \"ECR Prod\",\n \"awsRegion\": \"us-east-1\",\n \"credentialId\": \"<string>\",\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"credentialType\": \"static_keys\",\n \"awsAccountId\": \"123456789012\",\n \"awsAccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n \"awsSecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n \"roleArn\": \"arn:aws:iam::123456789012:role/cybedefend-ecr\",\n \"externalId\": \"<string>\",\n \"description\": \"Production ECR registry\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"ECR Prod\",\n \"awsRegion\": \"us-east-1\",\n \"credentialId\": \"<string>\",\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"credentialType\": \"static_keys\",\n \"awsAccountId\": \"123456789012\",\n \"awsAccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n \"awsSecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n \"roleArn\": \"arn:aws:iam::123456789012:role/cybedefend-ecr\",\n \"externalId\": \"<string>\",\n \"description\": \"Production ECR registry\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/integrations/ecr/container-registry/organization/{organizationId}/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"ECR Prod\",\n \"awsRegion\": \"us-east-1\",\n \"credentialId\": \"<string>\",\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"credentialType\": \"static_keys\",\n \"awsAccountId\": \"123456789012\",\n \"awsAccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n \"awsSecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n \"roleArn\": \"arn:aws:iam::123456789012:role/cybedefend-ecr\",\n \"externalId\": \"<string>\",\n \"description\": \"Production ECR registry\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"awsAccountId": "123456789012",
"awsRegion": "us-east-1",
"createdAt": "2025-01-01T00:00:00Z",
"awsAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"credentialType": "static_keys",
"roleArn": "arn:aws:iam::123456789012:role/cybedefend-ecr",
"description": "Production ECR registry"
}Path Parameters
CybeDefend organization ID
"550e8400-e29b-41d4-a716-446655440000"
Body
ECR credentials to store
Display name for the credential
"ECR Prod"
AWS Region
"us-east-1"
Existing credential id to update (rotation/type switch)
Deprecated: credentials are org-level. Ignored.
"097bbbf4-d1eb-4512-9950-684445279808"
Authentication mode
static_keys, iam_role AWS Account ID (12 digits) — required for static_keys mode
"123456789012"
AWS Access Key ID — required for static_keys mode
"AKIAIOSFODNN7EXAMPLE"
AWS Secret Access Key — required for static_keys mode
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
IAM role ARN to assume — required for iam_role mode. e.g. arn:aws:iam::123456789012:role/cybedefend-ecr
"arn:aws:iam::123456789012:role/cybedefend-ecr"
External ID enforced in the role trust policy (iam_role mode). Use the value returned by the prepare-iam-role endpoint.
Description for this credential
"Production ECR registry"
Response
Credentials stored successfully
Credential ID
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
AWS Account ID (12 digits)
"123456789012"
AWS Region
"us-east-1"
Creation date
"2025-01-01T00:00:00Z"
AWS Access Key ID (static_keys mode only)
"AKIAIOSFODNN7EXAMPLE"
Authentication mode
static_keys, iam_role IAM role ARN (iam_role mode only)
"arn:aws:iam::123456789012:role/cybedefend-ecr"
Description
"Production ECR registry"