curl --request POST \
--url https://api-eu.cybedefend.com/integrations/gitlab/container-registry/organization/{organizationId}/credentials \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"gitlabProjectId": 12345,
"username": "gitlab+deploy-token-123",
"deployToken": "gldt-xxxxxxxxxxxxxxxxxxxx",
"registryUrl": "registry.gitlab.com",
"projectPath": "mygroup/myproject",
"scopes": [
"read_registry",
"write_registry"
],
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Production registry access"
}
'import requests
url = "https://api-eu.cybedefend.com/integrations/gitlab/container-registry/organization/{organizationId}/credentials"
payload = {
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"gitlabProjectId": 12345,
"username": "gitlab+deploy-token-123",
"deployToken": "gldt-xxxxxxxxxxxxxxxxxxxx",
"registryUrl": "registry.gitlab.com",
"projectPath": "mygroup/myproject",
"scopes": ["read_registry", "write_registry"],
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Production registry access"
}
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({
projectId: '097bbbf4-d1eb-4512-9950-684445279808',
gitlabProjectId: 12345,
username: 'gitlab+deploy-token-123',
deployToken: 'gldt-xxxxxxxxxxxxxxxxxxxx',
registryUrl: 'registry.gitlab.com',
projectPath: 'mygroup/myproject',
scopes: ['read_registry', 'write_registry'],
expiresAt: '2025-12-31T23:59:59Z',
description: 'Production registry access'
})
};
fetch('https://api-eu.cybedefend.com/integrations/gitlab/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/gitlab/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([
'projectId' => '097bbbf4-d1eb-4512-9950-684445279808',
'gitlabProjectId' => 12345,
'username' => 'gitlab+deploy-token-123',
'deployToken' => 'gldt-xxxxxxxxxxxxxxxxxxxx',
'registryUrl' => 'registry.gitlab.com',
'projectPath' => 'mygroup/myproject',
'scopes' => [
'read_registry',
'write_registry'
],
'expiresAt' => '2025-12-31T23:59:59Z',
'description' => 'Production registry access'
]),
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/gitlab/container-registry/organization/{organizationId}/credentials"
payload := strings.NewReader("{\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"gitlabProjectId\": 12345,\n \"username\": \"gitlab+deploy-token-123\",\n \"deployToken\": \"gldt-xxxxxxxxxxxxxxxxxxxx\",\n \"registryUrl\": \"registry.gitlab.com\",\n \"projectPath\": \"mygroup/myproject\",\n \"scopes\": [\n \"read_registry\",\n \"write_registry\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\",\n \"description\": \"Production registry access\"\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/gitlab/container-registry/organization/{organizationId}/credentials")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"gitlabProjectId\": 12345,\n \"username\": \"gitlab+deploy-token-123\",\n \"deployToken\": \"gldt-xxxxxxxxxxxxxxxxxxxx\",\n \"registryUrl\": \"registry.gitlab.com\",\n \"projectPath\": \"mygroup/myproject\",\n \"scopes\": [\n \"read_registry\",\n \"write_registry\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\",\n \"description\": \"Production registry access\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/integrations/gitlab/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 \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"gitlabProjectId\": 12345,\n \"username\": \"gitlab+deploy-token-123\",\n \"deployToken\": \"gldt-xxxxxxxxxxxxxxxxxxxx\",\n \"registryUrl\": \"registry.gitlab.com\",\n \"projectPath\": \"mygroup/myproject\",\n \"scopes\": [\n \"read_registry\",\n \"write_registry\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\",\n \"description\": \"Production registry access\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"gitlabProjectId": 12345,
"username": "gitlab+deploy-token-123",
"registryUrl": "registry.gitlab.com",
"projectPath": "mygroup/myproject",
"createdAt": "2025-01-01T00:00:00Z",
"scopes": [
"read_registry"
],
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Production registry access"
}Store GitLab Container Registry credentials
Stores deploy token credentials for GitLab Container Registry (registry.gitlab.com) at organization level. These credentials are used to authenticate and pull container images for security scanning.
curl --request POST \
--url https://api-eu.cybedefend.com/integrations/gitlab/container-registry/organization/{organizationId}/credentials \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"gitlabProjectId": 12345,
"username": "gitlab+deploy-token-123",
"deployToken": "gldt-xxxxxxxxxxxxxxxxxxxx",
"registryUrl": "registry.gitlab.com",
"projectPath": "mygroup/myproject",
"scopes": [
"read_registry",
"write_registry"
],
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Production registry access"
}
'import requests
url = "https://api-eu.cybedefend.com/integrations/gitlab/container-registry/organization/{organizationId}/credentials"
payload = {
"projectId": "097bbbf4-d1eb-4512-9950-684445279808",
"gitlabProjectId": 12345,
"username": "gitlab+deploy-token-123",
"deployToken": "gldt-xxxxxxxxxxxxxxxxxxxx",
"registryUrl": "registry.gitlab.com",
"projectPath": "mygroup/myproject",
"scopes": ["read_registry", "write_registry"],
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Production registry access"
}
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({
projectId: '097bbbf4-d1eb-4512-9950-684445279808',
gitlabProjectId: 12345,
username: 'gitlab+deploy-token-123',
deployToken: 'gldt-xxxxxxxxxxxxxxxxxxxx',
registryUrl: 'registry.gitlab.com',
projectPath: 'mygroup/myproject',
scopes: ['read_registry', 'write_registry'],
expiresAt: '2025-12-31T23:59:59Z',
description: 'Production registry access'
})
};
fetch('https://api-eu.cybedefend.com/integrations/gitlab/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/gitlab/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([
'projectId' => '097bbbf4-d1eb-4512-9950-684445279808',
'gitlabProjectId' => 12345,
'username' => 'gitlab+deploy-token-123',
'deployToken' => 'gldt-xxxxxxxxxxxxxxxxxxxx',
'registryUrl' => 'registry.gitlab.com',
'projectPath' => 'mygroup/myproject',
'scopes' => [
'read_registry',
'write_registry'
],
'expiresAt' => '2025-12-31T23:59:59Z',
'description' => 'Production registry access'
]),
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/gitlab/container-registry/organization/{organizationId}/credentials"
payload := strings.NewReader("{\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"gitlabProjectId\": 12345,\n \"username\": \"gitlab+deploy-token-123\",\n \"deployToken\": \"gldt-xxxxxxxxxxxxxxxxxxxx\",\n \"registryUrl\": \"registry.gitlab.com\",\n \"projectPath\": \"mygroup/myproject\",\n \"scopes\": [\n \"read_registry\",\n \"write_registry\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\",\n \"description\": \"Production registry access\"\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/gitlab/container-registry/organization/{organizationId}/credentials")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"gitlabProjectId\": 12345,\n \"username\": \"gitlab+deploy-token-123\",\n \"deployToken\": \"gldt-xxxxxxxxxxxxxxxxxxxx\",\n \"registryUrl\": \"registry.gitlab.com\",\n \"projectPath\": \"mygroup/myproject\",\n \"scopes\": [\n \"read_registry\",\n \"write_registry\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\",\n \"description\": \"Production registry access\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.cybedefend.com/integrations/gitlab/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 \"projectId\": \"097bbbf4-d1eb-4512-9950-684445279808\",\n \"gitlabProjectId\": 12345,\n \"username\": \"gitlab+deploy-token-123\",\n \"deployToken\": \"gldt-xxxxxxxxxxxxxxxxxxxx\",\n \"registryUrl\": \"registry.gitlab.com\",\n \"projectPath\": \"mygroup/myproject\",\n \"scopes\": [\n \"read_registry\",\n \"write_registry\"\n ],\n \"expiresAt\": \"2025-12-31T23:59:59Z\",\n \"description\": \"Production registry access\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"gitlabProjectId": 12345,
"username": "gitlab+deploy-token-123",
"registryUrl": "registry.gitlab.com",
"projectPath": "mygroup/myproject",
"createdAt": "2025-01-01T00:00:00Z",
"scopes": [
"read_registry"
],
"expiresAt": "2025-12-31T23:59:59Z",
"description": "Production registry access"
}Path Parameters
CybeDefend organization ID
"550e8400-e29b-41d4-a716-446655440000"
Body
GitLab Container Registry deploy token credentials
CybeDefend project ID to associate this credential with
"097bbbf4-d1eb-4512-9950-684445279808"
GitLab project ID (numeric)
12345
Deploy token username from GitLab
"gitlab+deploy-token-123"
Deploy token secret from GitLab
"gldt-xxxxxxxxxxxxxxxxxxxx"
Container registry URL
"registry.gitlab.com"
GitLab project path (namespace/project)
"mygroup/myproject"
Token scopes
["read_registry", "write_registry"]
Token expiration date (ISO 8601)
"2025-12-31T23:59:59Z"
Description for this credential
"Production registry access"
Response
Credentials stored successfully
Credential ID
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
GitLab project ID
12345
Deploy token username
"gitlab+deploy-token-123"
Container registry URL
"registry.gitlab.com"
GitLab project path
"mygroup/myproject"
Creation date
"2025-01-01T00:00:00Z"
Token scopes
["read_registry"]
Token expiration date
"2025-12-31T23:59:59Z"
Description
"Production registry access"