Add Credentials to Kubernetes Registry
This endpoint allows you to add credentials for the Kubernetes registry. The accepted credentials are based on the registry type.
For example:
Registry type: AWS; Accepted credential type: aws_auth Credentials object
Registry type: OTHER; Accepted credential type: basic_auth Credentials object
PUT /openapi/kubernetes/{root_scope_name_or_id}/vulnerability_scanning/registry/{registry_id}
Parameters: The JSON query body contains the following keys:
Name |
Type |
Description |
---|---|---|
root_scope_name_or_id |
string |
Root scope name or ID |
registry_id |
string |
Kubernetes registry ID |
registry_credential |
object |
Credential object |
Credential object
Attribute |
Type |
Description |
---|---|---|
basic_auth |
object |
Basic authentication credential object |
aws_auth |
object |
AWS authentication credential object |
azure_auth |
object |
Azure authentication credential object |
gcp_auth |
object |
GCP authentication credential object |
basic_auth object
Attribute |
Type |
Description |
---|---|---|
username |
string |
Username |
password |
string |
Password |
aws_auth object
Attribute |
Type |
Description |
---|---|---|
aws_access_key_id |
string |
AWS credentials access key |
aws_secret_access_key |
string |
AWS credentials access secret |
azure_auth object:
Attribute |
Type |
Description |
---|---|---|
azure_tenant_id |
string |
Azure tenant ID |
azure_client_id |
string |
Azure client ID |
azure_client_secret |
string |
Azure client secret |
gcp_auth object:
Attribute |
Type |
Description |
---|---|---|
gcp_service_account |
object |
GCP service account |
Sample python code
root_app_scope_name = 'Tetration'
registry_id = ‘64cdc7a7362f57192dcc1625’
pay_load = {
"registry_credential": {
"basic_auth": {
"username": "username",
"password": "password",
}
}
}
restclient.put('/kubernetes/%s/vulnerability_scanning/registry/%s' % root_app_scope_name, registry_id, json_body=json.dumps(pay_load))