Spaces method and path for this operation:
Refer to Spaces for more information.
Create an agentless policy
Query parameters
-
The format of the response package policy.
Values are
legacyorsimplified. Default value issimplified.
Body
-
Additional datastream permissions, that will be added to the agent policy.
-
Additional properties are NOT allowed.
-
Policy description.
-
Force package policy creation even if the package is not verified, or if the agent policy is managed.
-
Policy unique identifier.
-
Package policy inputs. Refer to the integration documentation to know which inputs are available.
-
Unique name for the policy.
-
Policy namespace. When not specified, it inherits the agent policy namespace.
-
Additional properties are NOT allowed.
-
Input/stream level variable. Refer to the integration documentation for more information.
curl \ --request POST 'https://localhost:5601/api/fleet/agentless_policies' \ --header "Authorization: $API_KEY" \ --header "Content-Type: application/json" \ --header "kbn-xsrf: true" \ --data '{"name":"ess_billing-1","inputs":{"ESS Billing-cel":{"vars":{"api_key":"\u003cREPLACE_WITH_YOUR_API_KEY\u003e","organization_id":"1234"},"enabled":true,"streams":{"ess_billing.billing":{"vars":{"tags":["forwarded","billing"],"lookbehind":365,"hide_sensitive":true,"http_client_timeout":"30s"},"enabled":true},"ess_billing.credits":{"enabled":false}}}},"package":{"name":"ess_billing","version":"1.6.0"},"namespace":"default","description":"test"}' { "name": "ess_billing-1", "inputs": { "ESS Billing-cel": { "vars": { "api_key": "<REPLACE_WITH_YOUR_API_KEY>", "organization_id": "1234" }, "enabled": true, "streams": { "ess_billing.billing": { "vars": { "tags": [ "forwarded", "billing" ], "lookbehind": 365, "hide_sensitive": true, "http_client_timeout": "30s" }, "enabled": true }, "ess_billing.credits": { "enabled": false } } } }, "package": { "name": "ess_billing", "version": "1.6.0" }, "namespace": "default", "description": "test" } { "name": "cspm-aws-reuse-policy", "vars": { "posture": "cspm", "deployment": "aws" }, "inputs": { "cspm-cloudbeat/cis_aws": { "vars": { "cloud_formation_template": "https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https://elastic-cspm-cft.s3.eu-central-1.amazonaws.com/cloudformation-cspm-ACCOUNT_TYPE-9.2.0.yml" }, "enabled": true, "streams": { "cloud_security_posture.findings": { "vars": { "role_arn": "arn:aws:iam::123456789012:role/TestRole", "external_id": { "id": "ABCDEFGHIJKLMNOPQRST", "isSecretRef": true }, "aws.account_type": "organization-account", "aws.credentials.type": "cloud_connector", "aws.supports_cloud_connectors": true }, "enabled": true } } }, "cspm-cloudbeat/cis_gcp": { "enabled": false }, "cspm-cloudbeat/cis_azure": { "enabled": false } }, "package": { "name": "cloud_security_posture", "version": "3.1.1" }, "namespace": "default", "description": "CSPM integration for AWS reusing existing cloud connector", "cloud_connector": { "target_csp": "aws", "cloud_connector_id": "existing-aws-connector-id" } } { "name": "cspm-aws-policy", "vars": { "posture": "cspm", "deployment": "aws" }, "inputs": { "cspm-cloudbeat/cis_aws": { "vars": { "cloud_formation_template": "https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https://elastic-cspm-cft.s3.eu-central-1.amazonaws.com/cloudformation-cspm-ACCOUNT_TYPE-9.2.0.yml" }, "enabled": true, "streams": { "cloud_security_posture.findings": { "vars": { "role_arn": "arn:aws:iam::123456789012:role/TestRole", "external_id": { "id": "ABCDEFGHIJKLMNOPQRST", "isSecretRef": true }, "aws.account_type": "organization-account", "aws.credentials.type": "cloud_connector", "aws.supports_cloud_connectors": true }, "enabled": true } } }, "cspm-cloudbeat/cis_gcp": { "enabled": false }, "cspm-cloudbeat/cis_azure": { "enabled": false } }, "package": { "name": "cloud_security_posture", "version": "3.1.1" }, "namespace": "default", "description": "CSPM integration for AWS with cloud connector", "cloud_connector": { "target_csp": "aws" } } { "name": "cspm-azure-policy", "vars": { "posture": "cspm", "deployment": "azure" }, "inputs": { "cspm-cloudbeat/cis_aws": { "enabled": false }, "cspm-cloudbeat/cis_gcp": { "enabled": false }, "cspm-cloudbeat/cis_azure": { "enabled": true, "streams": { "cloud_security_posture.findings": { "vars": { "client_id": { "id": "client-secret-id", "isSecretRef": true }, "tenant_id": { "id": "tenant-secret-id", "isSecretRef": true }, "azure.account_type": "organization-account", "azure_credentials_cloud_connector_id": { "type": "text", "value": "existing-azure-credentials-connector-id" } }, "enabled": true } } } }, "package": { "name": "cloud_security_posture", "version": "3.1.1" }, "namespace": "default", "description": "CSPM integration for Azure with cloud connector", "cloud_connector": { "target_csp": "azure" } } { "item": { "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa", "name": "ess_billing-1", "inputs": { "ESS Billing-cel": { "vars": { "url": "https://billing.elastic-cloud.com", "api_key": { "id": "QY1sWpoBbWcMW-edr0Ee", "isSecretRef": true }, "organization_id": "1234" }, "enabled": true, "streams": { "ess_billing.billing": { "vars": { "tags": [ "forwarded", "billing" ], "lookbehind": 365, "hide_sensitive": true, "http_client_timeout": "30s" }, "enabled": true }, "ess_billing.credits": { "enabled": false } } } }, "enabled": true, "package": { "name": "ess_billing", "title": "Elasticsearch Service Billing", "version": "1.6.0" }, "version": "WzE0OTgsMV0=", "revision": 1, "namespace": "default", "created_at": "2025-11-06T18:27:43.541Z", "created_by": "test_user", "updated_at": "2025-11-06T18:27:43.541Z", "updated_by": "test_user", "description": "test", "secret_references": [ { "id": "QY1sWpoBbWcMW-edr0Ee" } ], "supports_agentless": true } } { "item": { "id": "aws-policy-12345", "name": "cspm-aws-policy", "vars": { "posture": "cspm", "deployment": "aws" }, "inputs": { "cspm-cloudbeat/cis_aws": { "vars": { "cloud_formation_template": "https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https://elastic-cspm-cft.s3.eu-central-1.amazonaws.com/cloudformation-cspm-ACCOUNT_TYPE-9.2.0.yml" }, "enabled": true, "streams": { "cloud_security_posture.findings": { "vars": { "role_arn": "arn:aws:iam::123456789012:role/TestRole", "external_id": { "id": "secret-external-id-123", "isSecretRef": true }, "aws.account_type": "organization-account", "aws.credentials.type": "cloud_connector" }, "enabled": true } } }, "cspm-cloudbeat/cis_gcp": { "enabled": false }, "cspm-cloudbeat/cis_azure": { "enabled": false } }, "enabled": true, "package": { "name": "cloud_security_posture", "title": "Cloud Security Posture Management", "version": "3.1.1" }, "version": "WzE0OTgsMV0=", "revision": 1, "namespace": "default", "created_at": "2025-11-06T18:27:43.541Z", "created_by": "test_user", "updated_at": "2025-11-06T18:27:43.541Z", "updated_by": "test_user", "description": "CSPM integration for AWS with cloud connector", "secret_references": [ { "id": "secret-external-id-123" } ], "cloud_connector_id": "aws-connector-67890", "supports_agentless": true, "supports_cloud_connector": true } } { "item": { "id": "azure-policy-12345", "name": "cspm-azure-policy", "vars": { "posture": "cspm", "deployment": "azure" }, "inputs": { "cspm-cloudbeat/cis_aws": { "enabled": false }, "cspm-cloudbeat/cis_gcp": { "enabled": false }, "cspm-cloudbeat/cis_azure": { "enabled": true, "streams": { "cloud_security_posture.findings": { "vars": { "client_id": { "id": "client-secret-id-456", "isSecretRef": true }, "tenant_id": { "id": "tenant-secret-id-123", "isSecretRef": true }, "azure.account_type": "organization-account", "azure_credentials_cloud_connector_id": { "type": "text", "value": "existing-azure-credentials-connector-id" } }, "enabled": true } } } }, "enabled": true, "package": { "name": "cloud_security_posture", "title": "Cloud Security Posture Management", "version": "3.1.1" }, "version": "WzE0OTgsMV0=", "revision": 1, "namespace": "default", "created_at": "2025-11-06T18:27:43.541Z", "created_by": "test_user", "updated_at": "2025-11-06T18:27:43.541Z", "updated_by": "test_user", "description": "CSPM integration for Azure with cloud connector", "secret_references": [ { "id": "tenant-secret-id-123" }, { "id": "client-secret-id-456" } ], "cloud_connector_id": "azure-connector-67890", "supports_agentless": true, "supports_cloud_connector": true } } { "error": "Bad Request", "message": "An error message describing what went wrong", "statusCode": 400 } { "error": "Conflict", "message": "An error message describing what went wrong", "statusCode": 409 }