01 Run iam policy create command (Windows/macOS/Linux) to create the access policy required to enable and run the Cloud Guard service in the specified OCI compartment:
oci iam policy create
--compartment-id 'ocid1.tenancy.oc1..aaaabbbbccccddddabcd1234abcd1234abcd1234abcd1234abcd1234abcd'
--name 'CloudGuardPolicies'
--description 'Cloud Guard Access Policy'
--statements '[
"allow service cloudguard to read vaults in tenancy",
"allow service cloudguard to read keys in tenancy",
"allow service cloudguard to read compartments in tenancy",
"allow service cloudguard to read tenancies in tenancy",
"allow service cloudguard to read audit-events in tenancy",
"allow service cloudguard to read compute-management-family in tenancy",
"allow service cloudguard to read instance-family in tenancy",
"allow service cloudguard to read virtual-network-family in tenancy",
"allow service cloudguard to read volume-family in tenancy",
"allow service cloudguard to read database-family in tenancy",
"allow service cloudguard to read object-family in tenancy",
"allow service cloudguard to read load-balancers in tenancy",
"allow service cloudguard to read users in tenancy",
"allow service cloudguard to read groups in tenancy",
"allow service cloudguard to read policies in tenancy",
"allow service cloudguard to read dynamic-groups in tenancy",
"allow service cloudguard to read authentication-policies in tenancy"
]'
02 The command output should return the versioning feature current status (i.e., "Enabled"):
{
"data": {
"compartment-id": "ocid1.tenancy.oc1..aaaabbbbccccddddabcd1234abcd1234abcd1234abcd1234abcd1234abcd",
"description": "Cloud Guard Access Policy",
"freeform-tags": {},
"id": "ocid1.policy.oc1..aaaabbbbccccddddabcdabcd1234abcd1234abcd1234abcd1234abcd1234",
"inactive-status": null,
"lifecycle-state": "ACTIVE",
"name": "CloudGuardPolicies",
"statements": [
"allow service cloudguard to read vaults in tenancy",
"allow service cloudguard to read keys in tenancy",
"allow service cloudguard to read compartments in tenancy",
"allow service cloudguard to read tenancies in tenancy",
"allow service cloudguard to read audit-events in tenancy",
"allow service cloudguard to read compute-management-family in tenancy",
"allow service cloudguard to read instance-family in tenancy",
"allow service cloudguard to read virtual-network-family in tenancy",
"allow service cloudguard to read volume-family in tenancy",
"allow service cloudguard to read database-family in tenancy",
"allow service cloudguard to read object-family in tenancy",
"allow service cloudguard to read load-balancers in tenancy",
"allow service cloudguard to read users in tenancy",
"allow service cloudguard to read groups in tenancy",
"allow service cloudguard to read policies in tenancy",
"allow service cloudguard to read dynamic-groups in tenancy",
"allow service cloudguard to read authentication-policies in tenancy"
],
"time-created": "2025-03-05T19:14:00.278000+00:00",
"version-date": null
},
"etag": "abcd1234abcd1234abcd1234abcd1234abcd1234"
}
03 Run cloud-guard configuration update command (Windows/macOS/Linux) to enable the Cloud Guard service for the root compartment of your Oracle Cloud Infrastructure (OCI) tenancy. Use the --compartment-id parameter to specify your root compartment:
oci cloud-guard configuration update
--reporting-region 'ap-sydney-1'
--compartment-id 'ocid1.tenancy.oc1..aaaabbbbccccddddabcd1234abcd1234abcd1234abcd1234abcd1234abcd'
--status 'ENABLED'
--query 'data.status'
04 The command output should return the current Cloud Guard operational status: