Configure Zero-Touch Snapshot-based Scan for OCI

Use Zero-Touch Snapshot-based Scan for Oracle Cloud Infrastructure (OCI) to assess your OCI Compute instances for operating system (OS) vulnerabilities without installing agents.

  • Qualys automatically creates backups of your instance boot and block volumes in the target compartments.
  • Temporary scanner instances are launched in a dedicated OCI compartment to attach volumes created from those backups and perform the scans.
  • Temporary resources (backups, volumes, and scanner instances) are cleaned up automatically by Qualys.

This topic explains what you need in your OCI environment, which OCI resources are created, and how to enable the feature.

Prerequisites for Snapshot-based Scan on OCI

Before you enable snapshot-based scanning for OCI, ensure the following:

Subscription and Feature Enablement

  • Active subscription: An active Qualys Enterprise TruRisk Platform subscription with TotalCloud is required.
  • Feature enablement: The Zero-Touch Snapshot-based Scan for OCI feature must be enabled for your subscription. If it is not enabled, contact Qualys Support.

OCI Connector and Tenancy Configuration

  • OCI connector: An OCI connector must be configured at the tenancy level to provide access to the OCI tenancy that hosts the FlexScan deployment and the target resources.
  • Service Account compartment: At least one compartment in the tenancy must be configured as the Service Account compartment. This compartment hosts the shared FlexScan infrastructure, including scanner instances, networking resources, Functions, volumes, backups, and Object Storage buckets.
  • Target Account compartments: One or more compartments in the same tenancy must be configured as Target Account compartments. These compartments contain the OCI Compute instances and associated volumes to be scanned.

Permissions in OCI

The identity used by the Qualys connector must be able to:

  • Create, read, attach, detach, and delete Compute instances, boot volumes, block volumes, volume groups, and volume backups in the FlexScan scanner compartment.
  • Launch and terminate the Compute instances used as private scanner instances.

Network and resource quotas must also be available in your tenancy. The Qualys Terraform configuration creates the required identity resources and policies. Refer to OCI Terraform Configuration for Snapshot-based Scan.

OCI Rate Limits and Recommendations

Snapshot-based scanning uses your OCI service limits and quotas. For a smooth experience:

  • Compute and Block Volume service limits
    • Ensure that you have enough limit headroom for:
      • Boot volume backup, volume backup, and volume group backup create and delete operations.
      • Block volume attach and detach operations in the target compartments.
      • A small pool of temporary scanner instances in the scanner compartment.
  • Object Storage quotas
    • Ensure sufficient storage, request rate, and throughput for the scan results and logs stored in the Qualys artifacts bucket.
  • Vault and Key Management quotas (if using customer-managed encryption keys)
    • Verify that your key has enough capacity for the expected number of encrypt and decrypt operations.

Scan frequency (high level)
Qualys performs discovery and scheduling internally. In a typical setup, each eligible instance is evaluated for snapshot-based scanning approximately once every 24 hours, with built-in retry logic for failures. You do not need to manage cron schedules yourself.

Feature Support Matrix

The following table summarizes which scan types are supported for OCI snapshot-based scan.

Resource Type OS Scan SwCA Scan Secrets Scan On-Demand Scan
Linux-based instances Yes No No No
Windows-based instances No No No No
Linux-based machine images No No No No
Windows-based machine images No No No No

In this release, snapshot-based scan on OCI supports the OS scan for Linux-based instances only.

OS Compatibility

For the up-to-date list of operating systems and images supported by Snapshot-based Scan for OCI, refer to OCI Snapshot-based Scan OS Compatibility Matrix.

OCI Resources Created for Snapshot-based Scan

When you deploy the Qualys resources for OCI, the service provisions resources in your Service Account compartment and uses resources in your Target Account compartments.

Service Account Compartment (Central Scan Infrastructure)

The Service Account compartment typically contains:

  • Scanner instances
    • Temporary OCI Compute instances that:
      • Attach volumes created from backups of the target instances' boot and block volumes.
      • Run the Qualys scanner to perform OS assessments.
    • Scanner instances are identified using Qualys-specific names, tags, and Dynamic Group membership.
  • Networking
    • A VCN and subnet, or existing networking selected during configuration, used by the scanner instances.
    • VNICs, route tables, gateways, security lists, and Network Security Groups required for secure outbound connectivity to the Qualys Cloud Platform.
  • Object Storage bucket
    • An OCI Object Storage bucket used for:
      • Scan results, including OS assessment data.
      • Scanner logs and scan artifacts.
    • FlexScan artifact bucket names follow the qualys-qscanner-artifacts-* naming pattern.
  • OCI Vault key (optional)
    • A customer-managed encryption key can be used to encrypt:
      • The boot volumes of the scanner instances.
      • Temporary block volumes.
      • Volume groups and backups used during scanning.
  • OCI Functions and control plane components
    • OCI Functions and associated resources used by Qualys to:
      • Receive and route scan requests.
      • Exchange requests and responses between the Qualys backend and the private scanner instances.
      • Monitor scan status.
      • Coordinate cleanup of temporary instances, volumes, backups, and scan artifacts.

The Qualys Terraform configuration creates only the identity resources (users, groups, policies, a dynamic group, and optionally the scanner compartment). FlexScan creates the networking, Object Storage bucket, Functions, and scanner instances at runtime, when a region is onboarded.

Target Account Compartments (Workload Compartments)

In each Target Account compartment that contains workloads, Qualys uses:

  • Boot volume and block volume backups
    • Backups are created for the eligible boot and block volumes attached to the OCI Compute instances selected for scanning.
    • Volume groups and volume group backups may be used to create consistent backups of multiple attached volumes.
    • Backups may use a configured OCI Vault customer-managed encryption key, where applicable.
  • Temporary volumes and attachments
    • Temporary boot or block volumes are created from the backups.
    • These volumes are attached to a scanner instance in the Service Account compartment for assessment.
    • Temporary volumes, volume groups, backups, and attachments are deleted after the scan and result upload are complete.

Qualys manages these resources on your behalf. Do not manually modify or delete Qualys-managed scanner instances, volumes, backups, Functions, networking resources, or Object Storage objects while a scan is running.

Configure Snapshot-based Scanning

Step 1: Activate the Snapshot-based Scan Checkbox

To enable snapshot-based scanning for OCI, you must first activate it on the OCI connector.

  1. Create or edit an OCI connector
    • Sign in to the Qualys portal and go to TotalCloud > Connectors > OCI.
    • Create a new connector or edit an existing one for your OCI environment.
  2. Go to the Tags and Activation (or Scan Settings) step
    • Locate the Enable Zero-Touch Snapshot-based Scan option for OCI.
    • Select this checkbox to turn on snapshot-based assessment for the connector.
  3. If the checkbox is greyed out
    • The checkbox remains disabled in these cases:
      • Snapshot-based scan for OCI is not yet enabled for your subscription.
      • No Service Account has been registered for OCI snapshot-based scanning.
    • In this case, complete the Service and Target Account deployment steps below, or contact Qualys Support.

Step 2: Deploy the Service and Target Account Compartments

To fully enable snapshot-based scanning on OCI, you:

  1. Provision the OCI Service Account compartment using Terraform.
  2. Register the created connector as a Service Account using the FlexScan API.
  3. Configure scan settings for the Service Account.
  4. Configure scan settings for individual Target Accounts.
  5. Verify the setup and state using the Get APIs.
  6. Deregister the Service Account when decommissioning.

All FlexScan APIs are available under the FlexScan API base path:

  • https://<qualys_base_url>/flexscan-api/rest/v1/...

Use the same Authorization header that you use for other Qualys APIs (for example, a bearer token or session JWT).

1. Set Up the OCI Service Account Compartment with Terraform

Download the Qualys Terraform configuration for OCI using the following command:

curl --location --request GET 'https://<gateway-url>/flexscan-api/rest/v1/artifacts/download?cloudType=OCI&fileName=terraform.zip' \
--header 'Authorization: Bearer <Bearer-token>' \
--output oci_terraform.zip

To identify the gateway URL for your Qualys platform, refer to Qualys Platform Identification.

Then deploy the configuration. At a high level, the configuration:

  • Creates a Qualys audit user, group, API signing key, and read-only CSPM policy.
  • Creates or reuses a compartment to act as the FlexScan Service Account compartment.
  • Creates a FlexScan service group and adds the Qualys audit user to it.
  • Creates a Dynamic Group for the scanner Compute instances.
  • Creates the OCI IAM policies required for FlexScan to:
    • Discover Compute instances in the configured Target Account compartments.
    • Read instance, VNIC, image, volume, and attachment metadata.
    • Create volume groups and backups of target boot and block volumes.
    • Create temporary volumes from backups and attach them to scanner instances.
    • Launch and terminate scanner Compute instances.
    • Create or use networking resources in the Service Account compartment.
    • Create and manage OCI Functions.
    • Create and manage Object Storage buckets and objects for scan artifacts, results, and logs.
    • Use an OCI Vault key when customer-managed encryption is configured.
    • Delete temporary instances, backups, volumes, attachments, and related resources after scanning.

Typical high-level steps:

  1. Choose the OCI tenancy in which to configure the connector.
  2. Choose or create a compartment to act as the Service Account compartment.
  3. Identify one or more compartments to configure as Target Account compartments.
  4. Prepare the Terraform variables, such as:
    • tenancy_ocid – The OCI tenancy OCID (required).
    • region – The tenancy home region (required).
    • oci_config_profile – The OCI CLI profile used by Terraform.
    • deploy_flexscan = true – Enables FlexScan in addition to CSPM.
    • create_scanner_compartment – Determines whether Terraform creates the Service Account compartment.
    • existing_compartment_id – Required when you reuse an existing Service Account compartment.
    • target_compartment_ids – The list of compartments that contain the Compute instances to scan.
    • existing_network_compartment_ids – Optional list of compartments that contain existing VCN and subnet resources.
    • enable_tenancy_compartment_inspection – Controls whether FlexScan can inspect compartments across the tenancy.
    • name_prefix, audit_user_name, and audit_group_name – Optional resource naming settings.
  5. Run terraform init, terraform plan, and terraform apply from your Terraform environment.
  6. After Terraform completes:
    • The Qualys audit user, audit group, API key, and CSPM read policy are available.
    • The Service Account compartment has the IAM permissions required to host the shared FlexScan infrastructure.
    • The Qualys audit user is a member of the FlexScan service group.
    • The scanner Dynamic Group and its Object Storage policy are configured.
    • FlexScan has the required access to the configured Target Account compartments.
    • Terraform outputs the connector user OCID, API key fingerprint, private key path, scanner compartment ID, and Dynamic Group details required for connector registration.

For the detailed variables, deployment scenarios, created resources, and troubleshooting, refer to OCI Terraform Configuration for Snapshot-based Scan.

2. Register the OCI Connector as a Service Account (Register API)

Once Terraform has completed and the connector exists in Qualys, register that connector as a Service Account.

Endpoint: POST /flexscan-api/rest/v1/service-accounts/register

Headers

Header Value Required
Authorization Bearer <token> (or equivalent Qualys auth) Yes
Content-Type application/json Yes
Accept application/json Yes

Request body

{
  "accountId": "<tenancy-ocid>",
  "cloudType": "OCI"
}

Fields

Field Type Required Allowed Values Description
accountId String Yes – The tenancy OCID that you want to use as the Service Account. This must match the connector account ID in Qualys.
cloudType String Yes GCP, AWS, AZURE, OCI (case-insensitive) Cloud provider type. Use OCI for Oracle Cloud Infrastructure.

If the account is already registered, the API may return 304 Not Modified with the status ALREADY_REGISTERED.

3. Configure Service Account Scan Settings (Service Account Setup API)

After registration, configure scan settings for the Service Account. These settings act as defaults for all child target accounts.

Endpoint: POST /flexscan-api/rest/v1/service-accounts/setup

Headers: Same as Register Service Account.

Request body (ScanConfigRequest)

{
  "accountId": "<tenancy-ocid>",
  "regions": ["us-sanjose-1", "us-phoenix-1"],
  "serviceCompartmentId": "<service-compartment-ocid>",
  "groupName": "<audit-group-name>",
  "resources": [
    {
      "resourceType": "VM",
      "enabled": true,
      "tagFilter": {
        "mustHave": [],
        "atLeastOne": [],
        "exclude": []
      },
      "platforms": [
        {
          "platform": "LINUX",
          "enabled": true,
          "scans": [
            {
              "scanType": "OS",
              "enabled": true,
              "intervalHours": 24
            }
          ]
        }
      ]
    }
  ]
}

Fields

Field Type Required Default Allowed Values Description
accountId String Yes – – Tenancy OCID registered in the previous step.
regions String[] Yes – OCI regions (for example, us-sanjose-1, us-phoenix-1) Regions where snapshot-based scanning should run.
serviceCompartmentId String Yes – – OCID of the Service Account compartment.
groupName String Yes – – Name of the Qualys group created by Terraform.
resourceType String No VM For this release: VM only Resource types to scan. For OCI snapshot-based scan, only VMs are supported.
mustHave String[] No – – Tags that must all be present on an instance (AND logic).
atLeastOne String[] No – – At least one of these tags must be present (OR logic).
exclude String[] No – – Instances with any of these tags are excluded from scanning.
scanType String No OS OS VM scan type. For OCI snapshot-based scan, use OS.
intervalHours Integer No 24 24–720 Scan interval in hours. Minimum 24 hours.

These settings are stored on the Service Account and are used as the baseline scan configuration for all child target accounts.

4. Configure Target Account Scan Settings (Target Account Setup API)

Once the Service Account is configured, you can override scan settings for target compartments.

Endpoint: POST /flexscan-api/rest/v1/target-accounts/setup

Headers: Same as Service Account Setup.

Request body (ScanConfigRequest)

{
  "accountId": "<tenancy-ocid>",
  "regions": ["us-sanjose-1", "us-phoenix-1"],
  "targetCompartmentIds": ["<target-compartment-ocid1>", "<target-compartment-ocid2>"],
  "groupName": "<audit-group-name>",
  "resources": [
    {
      "resourceType": "VM",
      "enabled": true,
      "tagFilter": {
        "mustHave": [],
        "atLeastOne": [],
        "exclude": []
      },
      "platforms": [
        {
          "platform": "LINUX",
          "enabled": true,
          "scans": [
            {
              "scanType": "OS",
              "enabled": true,
              "intervalHours": 720
            }
          ]
        }
      ]
    }
  ]
}

Fields

Same schema as Service Account Setup, with the following additional field and rule:

Field Type Required Default Allowed Values Description
targetCompartmentIds String[] No – – OCIDs of the target compartments. You can specify zero or more compartment OCIDs. If the list is empty, the entire tenancy is considered for discovery.
  • Regions subset rule – Target account regions must be a subset of the parent Service Account regions.

Configuration precedence: When FlexScan runs, Target Account scan settings take precedence over Service Account settings. If a setting is not defined on the target account, the Service Account's value is used.

5. Verify Service Account Configuration and State

After Terraform and the setup APIs have completed, you can verify that the Service Account is healthy and that regions are configured correctly.

5.1 Get Service Account

Endpoint: GET /flexscan-api/rest/v1/service-accounts/{accountId}

Path parameter

Name Type Required Description
accountId String Yes Tenancy OCID.

This API returns detailed configuration, including regions, scan interval, and tag filters.

5.2 Get Service Account State

Endpoint: GET /flexscan-api/rest/v1/service-accounts/{accountId}/state

Path parameter

Name Type Required Description
accountId String Yes Tenancy OCID.

The response includes:

  • state – one of: PENDING, REGISTERED, SUCCESS, PARTIAL_SUCCESS, DISABLED, FAILED.
  • cloudInfo – basic information about the underlying OCI tenancy.

Use this to confirm that all regions from the Service Account setup are in SUCCESS or equivalent healthy state before relying on snapshot-based scans.

6. Deregister the Service Account (Before Deleting the Connector)

When you want to remove a Service Account, always deregister it before deleting the corresponding connector in TotalCloud.

Endpoint: DELETE /flexscan-api/rest/v1/service-accounts/deregister

Headers: Same as Register Service Account.

Request body

{
  "accountId": "<tenancy-ocid>",
  "cloudType": "OCI"
}

This call:

  • Informs the external connector snapshot service that the Service Account is no longer active.
  • Prepares the environment so you can safely delete the connector and, if desired, tear down infrastructure (for example, using terraform destroy).

7. Verify Target Account State

Similar to the Service Account state API, you can verify the state of each Target Account.

Endpoint: GET /flexscan-api/rest/v1/target-accounts/{accountId}/state

Path parameter

Name Type Required Description
accountId String Yes Target account ID (for example, the tenancy OCID).

The response includes:

  • The current state of the associated Service Account (since Target Accounts inherit state from their parent).
  • Per-region cloudInfo that indicates which regions are fully set up and synchronized.

Use this API to verify that each target compartment is properly attached to the Service Account and ready for snapshot-based scanning.

View OS Findings in TotalCloud

After a successful snapshot-based scan, all findings are available in the TotalCloud application.

Navigate to the CSAM inventory and click an instance scanned by this FlexScan technique to view its details. Under the Security tab, you can find Vulnerabilities, and under Inventory, you can find Installed Software. Depending on your scan configuration, these findings are available for your analysis.

The following are examples of findings for an OCI instance.

Installed Software (under Inventory)

Installed Software panel under Inventory on the Inventory Details page of an OCI instance, showing the Application and Other tabs with software names and releases

Vulnerabilities

Vulnerabilities list for an OCI instance, showing QIDs, titles, detected dates, and severity