Skip to content

Lab: 70 Vulnerability scanning

TanveeKhanDB edited this page Oct 13, 2026 · 4 revisions

1. Objective

Implement OCI Vulnerability Scanning to identify security vulnerabilities, missing OS patches, exposed ports, and configuration weaknesses across multiple OCI Compute instances.

This lab demonstrates how to configure IAM policies, create a scan recipe, configure a target, review scan reports, and plan remediation.

2. What Is OCI Vulnerability Scanning?

OCI Vulnerability Scanning Service (VSS) is a managed security service that scans supported Compute instances and Container Registry images for potential vulnerabilities.

“OCI Vulnerability Scanning is a managed security service that continuously scans Compute instances and container images for known vulnerabilities, missing patches, open ports, configuration weaknesses and CIS benchmark violations. We configure a scan recipe, associate it with a target containing one or multiple VMs, and review the generated findings by risk level with remediation guidance. However, it has platform and coverage limitations, so it should complement—not replace—other security and compliance toolsOCI Vulnerability Scanning Service (VSS) is a managed security service that scans supported Compute instances and Container Registry images for potential vulnerabilities.

Key capabilities:

  • Detect known OS and application vulnerabilities.
  • Identify missing security updates and patches.
  • Detect open ports on Compute instances.
  • Assess supported CIS security benchmarks.
  • Generate vulnerability reports with risk levels and remediation information.
  • Integrate with OCI Cloud Guard for centralized security visibility.

3. Architecture and Scanning Flow

OCI Tenancy
    |
    v
IAM Policies
    |
    v
Vulnerability Scanning Service
    |
    v
Scan Recipe
(What to scan and how often)
    |
    v
Scan Target
(Which VMs to scan)
    |
    v
OCI Compute Instances
  |       |       |
  v       v       v
 VM-01   VM-02   VM-03
    |
    v
Security Scan and Analysis
    |
    v
Scanning Reports
    |
    v
Critical / High / Medium / Low Findings
    |
    v
Patch, Remediate and Validate

Important concepts:

  • IAM Policy: Defines permissions for administrators and the scanning service.
  • Scan Recipe: Defines the scanning configuration and schedule.
  • Scan Target: Identifies the Compute instances to scan.
  • Scan Report: Contains the findings for an individual instance.
  • Remediation: Fixes identified vulnerabilities and verifies the results.

4. Prerequisites

Before starting the lab, ensure you have:

  • An active OCI tenancy and access to the OCI Console.
  • One or more supported Compute instances.
  • Appropriate IAM permissions to manage Vulnerability Scanning resources.
  • Supported operating system images and Oracle Cloud Agent compatibility for agent-based scanning.
  • A Service Gateway and suitable route rule for instances in private subnets or without public IP addresses when required.
  • Permission to review scanning reports.

5. Step 1 — Configure IAM Policies

OCI Vulnerability Scanning requires permissions for both the user managing the service and the service itself.

A. User or administrator permissions

For example, to allow a group named SecurityAdmins to manage Vulnerability Scanning resources in a compartment named CloudSecurity, create this policy:

Allow group SecurityAdmins to manage vss-family in compartment CloudSecurity

Replace the group and compartment names with your actual OCI configuration.

B. Service permissions for agent-based scanning

The Vulnerability Scanning service needs permission to deploy the Oracle Cloud Agent and read the required Compute and VNIC information.

Example for a dedicated compartment:

Allow service vulnerability-scanning-service to manage instances in compartment CloudSecurity
Allow service vulnerability-scanning-service to read compartments in compartment CloudSecurity
Allow service vulnerability-scanning-service to read vnics in compartment CloudSecurity
Allow service vulnerability-scanning-service to read vnic-attachments in compartment CloudSecurity

To updated for root level use tanancy instead of root.

Allow group SecurityAdmins to manage vss-family in tenancy
Allow service vulnerability-scanning-service to manage instances in tenancy
Allow service vulnerability-scanning-service to read compartments in tenancy
Allow service vulnerability-scanning-service to read vnics in tenancy
Allow service vulnerability-scanning-service to read vnic-attachments in tenancy

Policy placement: Create policies in the appropriate policy compartment. Use the tenancy root when the permissions must apply across the tenancy; otherwise, scope them to the required compartments.

If VNICs are located in a different compartment from the instances, grant the necessary VNIC permissions in that compartment as well.

These are example statements, not a universal policy set. Verify the required permissions against your recipe type and target configuration before implementation.

Official reference: https://docs.oracle.com/en-us/iaas/Content/scanning/using/required-iam-policy-host-scan.htm

6. Step 2 — Open Vulnerability Scanning

  1. Sign in to the OCI Console.
  2. Open the navigation menu.
  3. Navigate to Identity & Security → Scanning.
  4. Open the scan recipes section.

The available page labels may vary slightly with OCI Console updates.

7. Step 3 — Create a Compute Scan Recipe

Navigate to the Compute/Hosts scan recipes section and select Create Scan Recipe.

Configure the following:

Setting Example
Recipe name VM-Security-Scan-Recipe
Resource type Compute
Agent-based scanning Enable as required
Port scanning Enable as required
CIS benchmark scanning Configure as supported
Scan schedule Daily or weekly
Compartment CloudSecurity

Choose the scan settings appropriate for your environment.

Scanning methods

Agent-based scanning: Can identify OS vulnerabilities, supported security configuration issues, open ports on attached VNICs, and supported third-party application vulnerabilities.

Network port scanning: Checks public IP addresses for open ports. An open-port finding does not automatically mean the port is reachable from the public Internet.

Save the recipe after reviewing the configuration.

Official reference: https://docs.oracle.com/en-us/iaas/Content/scanning/using/create-host-recipe.htm

8. Step 4 — Create a Scan Target

A target determines which Compute instances will be scanned using the selected recipe.

  1. Navigate to Scanning → Targets.
  2. Open the Compute/Hosts tab.
  3. Select Create Target.
  4. Enter the target name: Production-VM-Scan-Target.
  5. Select the scan recipe created in Step 3.
  6. Select the target compartment.
  7. Choose either:
    • All Compute instances in the selected compartment and its subcompartments.
    • Specific Compute instances.
  8. Review the configuration and create the target.

Enterprise tip: If you need to scan multiple VMs, selecting all instances in the appropriate compartment can reduce manual work. A target created at the tenancy root can cover all Compute instances in the tenancy, subject to the service configuration and permissions.

Official reference: https://docs.oracle.com/en-us/iaas/Content/scanning/using/create-host-target.htm

9. Step 5 — Review Scanning Results

After creating the target, allow time for the initial scan to complete.

Navigate to:

Identity & Security → Scanning → Scanning Reports → Hosts

Select the relevant compartment and inspect the available reports.

Review:

  • Instance name and scan status.
  • Vulnerability identifiers, including CVEs where available.
  • Severity or risk level.
  • Missing security patches.
  • Open ports.
  • Supported CIS benchmark findings.
  • Remediation information.

OCI generally makes results available within about 15 minutes, but the initial scan can take up to 24 hours.

Note: OCI creates a separate host-scan report for each Compute instance in the target. Vulnerability reports can also summarize a particular vulnerability across affected resources.

Official reference: https://docs.oracle.com/en-us/iaas/Content/scanning/using/host-scan-reports.htm

10. Step 6 — Analyze Findings and Remediate

Prioritize findings based on severity, business impact, exposure, and available remediation guidance.

Severity Recommended action
Critical Investigate and remediate immediately according to incident policy.
High Prioritize remediation and assess exposure.
Medium Schedule remediation based on risk.
Low / Minor Review and resolve according to the security baseline.

Example

Suppose three Compute instances produce these findings:

VM Finding Action
APP-VM-01 Critical package vulnerability Verify the affected package and apply the appropriate security fix.
WEB-VM-02 Unexpected open port Validate business requirements and restrict access if unnecessary.
DB-VM-03 CIS benchmark failure Review the failed recommendation and apply an approved configuration change.

After remediation:

  1. Verify the patch or configuration change.
  2. Confirm the application remains healthy.
  3. Allow the next scan to complete.
  4. Review the latest report to verify the finding is resolved.

Important: Vulnerability Scanning identifies potential problems; it does not automatically patch every finding. Apply changes through your approved patch-management and change-control process.

11. Private Subnet Considerations

For instances in private subnets or without public IP addresses, verify that the VCN has the required Service Gateway and route rule for Oracle services when required.

Check:

  • Service Gateway is available for the relevant Oracle services.
  • The subnet route table has the appropriate route.
  • IAM permissions allow the required scanning operations.
  • The instance uses a supported image and agent configuration.

Do not expose a private VM to the Internet solely to enable vulnerability scanning.

Official reference: https://docs.oracle.com/en-us/iaas/Content/scanning/using/create-host-target.htm

12. Limitations

  • Supported platforms: Scanning is intended for supported Compute images and Container Registry images; unsupported or end-of-support images may not receive full coverage.
  • Windows coverage: Windows scanning uses NVD data but does not include OVAL or CIS benchmark data, so it should not be the sole mechanism for Windows security assurance.
  • Not a penetration test: The service does not replace penetration testing or a comprehensive application security assessment.
  • Open ports require analysis: A reported open port is not proof that it is publicly reachable or necessarily unsafe.
  • Possible false positives or gaps: Results can be incomplete or inaccurate for unsupported operating systems and some package configurations.
  • PCI compliance: OCI Vulnerability Scanning is not a PCI-compliant scanner.
  • No automatic remediation guarantee: Findings must be investigated and fixed using an appropriate remediation process.

Official reference: https://docs.oracle.com/en-us/iaas/Content/scanning/using/overview.htm

13. Troubleshooting Checklist

Problem What to check
Cannot create a recipe or target Confirm IAM permissions and the selected compartment.
Agent-based scan does not work Check required service policies, supported image and Oracle Cloud Agent compatibility.
Private VM is not scanned as expected Verify Service Gateway, route rules and required permissions.
No reports appear Confirm that the target exists, the recipe is associated, and sufficient time has elapsed.
Unexpected port finding Validate the listening service, security rules, NSGs and actual network reachability.
Finding remains after patching Verify the installed package/version, patch status and latest scan result.

14. Lab Validation Checklist

  • IAM policies reviewed and configured.
  • Compute scan recipe created.
  • Required scan settings enabled.
  • Scan target created for one or multiple VMs.
  • Private-subnet connectivity verified where applicable.
  • Initial scan completed.
  • Host reports reviewed.
  • Findings prioritized by severity.
  • Remediation performed through change control.
  • Latest scan results checked after remediation.

15. Final Summary

OCI Vulnerability Scanning = Discover → Assess → Prioritize → Remediate → Validate

The service helps Cloud Administrators improve security visibility across multiple Compute instances by identifying known vulnerabilities, open ports, and supported configuration weaknesses from a centralized OCI Console.

Key takeaway: Create the recipe to define what to scan, create the target to select the VMs, review the findings, and verify remediation with a subsequent scan.

Steps to perform VS in OCI console.

1. Create a req policy: image image

2.Go to Identity & Security > Scanning > Scanning Recipes. image image

3.Scan Target image image

4.Scanning Reports

image

Clone this wiki locally