GetSecurityPolicy
client.securityPolicies.retrieve(SecurityPolicyRetrieveParams { securityPolicyId } body, RequestOptionsoptions?): SecurityPolicyRetrieveResponse { securityPolicy }
POST/gitpod.v1.SecurityService/GetSecurityPolicy
Gets details about a specific security policy.
Use this method to:
- View security policy configuration
- Inspect enforcement rules
Examples
-
Get security policy:
Retrieves a security policy by ID.
securityPolicyId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
GetSecurityPolicy
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const securityPolicy = await client.securityPolicies.retrieve({
securityPolicyId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
});
console.log(securityPolicy.securityPolicy);{
"securityPolicy": {
"metadata": {
"name": "x"
},
"spec": {
"blockDevices": {
"defaultEffect": "EFFECT_UNSPECIFIED"
},
"data": {
"defaultEffect": "EFFECT_UNSPECIFIED",
"rules": [
{
"destination": {
"host": "host"
},
"effect": "EFFECT_UNSPECIFIED",
"source": {
"file": "file",
"integration": "integration",
"selector": "selector"
}
}
]
},
"executables": {
"defaultEffect": "EFFECT_UNSPECIFIED",
"rules": [
{
"effect": "EFFECT_UNSPECIFIED",
"path": "path"
}
]
},
"files": {
"defaultActions": [
"ACTION_UNSPECIFIED"
],
"defaultEffect": "EFFECT_UNSPECIFIED",
"rules": [
{
"actions": [
"ACTION_UNSPECIFIED"
],
"effect": "EFFECT_UNSPECIFIED",
"path": "path"
}
]
},
"ports": {
"maxAdmissionLevel": "ADMISSION_LEVEL_UNSPECIFIED"
}
},
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updatedAt": "2019-12-27T18:11:19.117Z"
}
}Returns Examples
{
"securityPolicy": {
"metadata": {
"name": "x"
},
"spec": {
"blockDevices": {
"defaultEffect": "EFFECT_UNSPECIFIED"
},
"data": {
"defaultEffect": "EFFECT_UNSPECIFIED",
"rules": [
{
"destination": {
"host": "host"
},
"effect": "EFFECT_UNSPECIFIED",
"source": {
"file": "file",
"integration": "integration",
"selector": "selector"
}
}
]
},
"executables": {
"defaultEffect": "EFFECT_UNSPECIFIED",
"rules": [
{
"effect": "EFFECT_UNSPECIFIED",
"path": "path"
}
]
},
"files": {
"defaultActions": [
"ACTION_UNSPECIFIED"
],
"defaultEffect": "EFFECT_UNSPECIFIED",
"rules": [
{
"actions": [
"ACTION_UNSPECIFIED"
],
"effect": "EFFECT_UNSPECIFIED",
"path": "path"
}
]
},
"ports": {
"maxAdmissionLevel": "ADMISSION_LEVEL_UNSPECIFIED"
}
},
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updatedAt": "2019-12-27T18:11:19.117Z"
}
}