Skip to main content
Enable Cloudgeni to scan your Oracle Cloud infrastructure by creating a dedicated user with read-only access.

Prerequisites

  • OCI tenancy with administrator access
  • OCI CLI installed and configured
  • Cloudgeni account (free trial available)
  • Time estimate: 2 minutes

Step 1: Create Read-Only User

Run this script to create a user, group, policy, and API key. Replace the two configuration values at the top:
# Configure these two values
export TENANCY_OCID="ocid1.tenancy.oc1..xxxxx"  # Find in OCI Console > Profile > Tenancy
export REGION="eu-frankfurt-1"                   # Your OCI region

# Create user, group, and policy
USER_NAME="cloudgeni-readonly"
GROUP_NAME="CloudGeniReadOnly"

USER_OCID=$(oci iam user create --name "$USER_NAME" \
  --description "CloudGeni read-only access" \
  --email "[email protected]" --query 'data.id' --raw-output)

GROUP_OCID=$(oci iam group create --name "$GROUP_NAME" \
  --description "CloudGeni read-only group" --query 'data.id' --raw-output)

oci iam group add-user --group-id "$GROUP_OCID" --user-id "$USER_OCID"

oci iam policy create --name "CloudGeniReadOnly" \
  --compartment-id "$TENANCY_OCID" \
  --statements '["Allow group CloudGeniReadOnly to read all-resources in tenancy"]' \
  --description "Read-only access for CloudGeni"

# Generate API key
openssl genrsa -out cloudgeni-oci.pem 2048
openssl rsa -pubout -in cloudgeni-oci.pem -out cloudgeni-oci-public.pem 2>/dev/null

FINGERPRINT=$(oci iam user api-key upload --user-id "$USER_OCID" \
  --key-file cloudgeni-oci-public.pem --query 'data.fingerprint' --raw-output)

# Output credentials
echo ""
echo "=== CloudGeni OCI Credentials ==="
echo "Tenancy OCID: $TENANCY_OCID"
echo "User OCID: $USER_OCID"
echo "Fingerprint: $FINGERPRINT"
echo "Region: $REGION"
echo "Private Key: cloudgeni-oci.pem (in current directory)"
Keep cloudgeni-oci.pem secure. This private key grants access to your OCI tenancy. Never commit it to version control.

Step 2: Add to CloudGeni

  1. Log into your Cloudgeni dashboard
  2. Navigate to Settings > Integrations > Cloud
  3. Click “Connect OCI”
  4. Enter the credentials from the script output:
    • Tenancy OCID
    • User OCID
    • Fingerprint
    • Region
    • Private Key: Upload cloudgeni-oci.pem
  5. Click “Create Integration”
A scan of your OCI resources will start automatically after creating the integration.

What’s Next?