LAB 70 ‐ Vulnerability scanning - DevWithNehaCloud/Oracle-Cloud-Infrastructure-wiki GitHub Wiki

OCI Vulnerability Scanning – Complete Practical Guide

1. What Is Vulnerability Scanning in OCI?

Vulnerability Scanning is a security process used to identify weaknesses, missing security patches, outdated software, open ports, and configuration issues in cloud resources.

In Oracle Cloud Infrastructure (OCI), the Vulnerability Scanning Service (VSS) helps administrators identify security risks in Compute instances and container images. It generates reports containing detected vulnerabilities, risk levels, and remediation information.

What Is a Vulnerability?

A vulnerability is a weakness in an operating system, application, software package, or system configuration that could be exploited by an attacker.

Examples:

  • Missing critical operating system security patches.

  • Outdated OpenSSL or other vulnerable software packages.

  • Unnecessarily open network ports.

  • Weak security configurations.

  • Failed CIS security benchmark checks.

  • Vulnerabilities in third-party application files.

Important: A vulnerability is not necessarily a Critical or High risk issue. Vulnerabilities are categorized by severity, such as Critical, High, Medium, Low, and Minor. Critical and High findings generally require the highest priority.

Example

Suppose we have an Oracle Linux 9 Compute instance running an application.

The operating system has an outdated software package with a known security vulnerability.

The Vulnerability Scanning Service can identify the issue and report its associated CVE, severity, and remediation information.

The administrator reviews the report, applies the appropriate patch or configuration fix, and scans again to verify whether the issue has been resolved.


2. Why Do We Use Vulnerability Scanning?

Vulnerability scanning helps organizations:

  • Identify security weaknesses before attackers exploit them.

  • Find missing security updates and critical patches.

  • Review open ports and unnecessary network exposure.

  • Check operating system security configurations.

  • Monitor CIS benchmark compliance.

  • Generate security reports for clients and security teams.

  • Prioritize remediation according to severity.

  • Verify whether remediation activities have resolved the findings.

  • Improve the overall security posture of cloud infrastructure.


3. OCI Services Used for Vulnerability Remediation

OCI Service | Purpose -- | -- Vulnerability Scanning Service (VSS) | Detects vulnerabilities and generates scan reports. OS Management Hub (OSMH) | Manages operating system updates, security patches, and update jobs for registered instances. Cloud Guard | Provides centralized visibility into security problems and configuration risks. Compute | Hosts the virtual machines being scanned. IAM Policies | Control who can manage scanning resources and which permissions the scanning service receives. Service Gateway | Enables supported private-subnet instances to access Oracle Services without requiring a public IP.

Interview point: Do not claim that Qualys is always more expensive or always better. Pricing and capabilities depend on the selected edition, license, scope, and organizational requirements.


18. Important Troubleshooting Lessons from This Lab

During the lab, we created a Compute Scan Recipe and a Target, then investigated why the Vulnerability Scanning plugin remained disabled.

The Oracle Cloud Agent service was running, and the plugin directory existed on the instance.

The agent logs repeatedly showed:

Plugin [oci-vulnerabilityscan] has [Disable] desired state

This observation confirmed that the plugin was being reported in a disabled desired state. It did not, by itself, establish whether the cause was instance configuration, a service-side problem, or a permission/configuration issue.

The correct troubleshooting approach is to:

  1. Verify the instance agent service.

  2. Verify the plugin and supported image configuration.

  3. Check the instance's agent configuration in OCI.

  4. Review the required IAM policies.

  5. Check network connectivity where applicable.

  6. Review relevant logs and console notifications.

  7. Contact the tenancy administrator or Oracle Support if the state remains unexplained.

Example Commands

sudo systemctl is-active oracle-cloud-agent

rpm -qa | grep oracle-cloud-agent

sudo journalctl -u oracle-cloud-agent -n 100 --no-pager

sudo grep -i vulnerability /var/log/oracle-cloud-agent/agent.log | tail -20

These commands help investigate the agent service and plugin state. They do not, on their own, prove that VSS is functioning end to end.

Lab result: The recipe and target were created, and agent/plugin troubleshooting was performed. Because the Vulnerability Scanning plugin remained disabled, successful host scanning and vulnerability remediation were not yet demonstrated. The next step is to resolve the plugin configuration issue and then verify scan results.


OCI Vulnerability Scanning – Interview Questions and Answers

Q1. What is vulnerability scanning in OCI?

Vulnerability scanning is a security process that identifies potential weaknesses in Compute instances and container images, including missing OS patches, vulnerable packages, open ports, and supported security configuration issues.

Q2. What is a vulnerability?

A vulnerability is a weakness in software, an operating system, or a configuration that could potentially be exploited by an attacker.

Q3. What is OCI Vulnerability Scanning Service?

It is an OCI security service that scans supported hosts and container images and generates reports containing security findings, severity levels, and remediation information.

Q4. What is a Scan Recipe?

A Scan Recipe defines the scanning configuration, including the types of checks and the scan schedule.

Q5. What is a Scan Target?

A Scan Target identifies the Compute instances or other supported resources that should be scanned using a selected recipe.

Q6. What is the difference between a Scan Recipe and a Target?

A recipe defines how to scan; a target defines what resources to scan.

Q7. What is a CVE?

CVE stands for Common Vulnerabilities and Exposures. It is a common identifier for a publicly known vulnerability.

Q8. What are the severity levels?

OCI reports can classify findings as Critical, High, Medium, Low, and Minor. Critical and High findings generally receive the highest remediation priority.

Q9. What is CIS benchmark scanning?

It checks supported system security configurations against recommendations published by the Center for Internet Security.

Q10. What is the role of Oracle Cloud Agent?

Oracle Cloud Agent supports management and monitoring functions on Compute instances. The appropriate Vulnerability Scanning plugin configuration is required for agent-based host scanning.

Q11. What is OSMH?

OS Management Hub is an OCI service for managing operating-system updates, security patches, and update jobs on registered and supported instances.

Q12. Can OSMH resolve every vulnerability?

No. OSMH can apply supported operating-system updates, but application vulnerabilities, open ports, insecure configurations, and other findings may require different remediation methods.

Q13. What is the difference between Host Scans and Vulnerability Reports?

Host Scans provide findings for individual scanned hosts. Vulnerability Reports organize information about detected vulnerability types and the affected resources.

Q14. What if the scan report is empty?

Verify the target, recipe, selected compartment, plugin state, scan completion, and report type. An empty report alone does not prove that the instance has no vulnerabilities.

Q15. Does a public IP have to be assigned to a VM for host vulnerability scanning?

No. Agent-based host scanning can work without a public IP, provided the required service connectivity and configuration are in place. Public IP port scanning is a separate scanning capability.

Q16. What should you do if the plugin remains disabled?

Check the agent configuration, plugin support, IAM policies, service connectivity, and logs. If the cause remains unclear, involve the tenancy administrator or Oracle Support.

Q17. How do you remediate a missing security patch?

Identify the affected package and advisory, verify the available update, apply it through an approved patch-management method such as OSMH, and perform a subsequent scan to validate remediation.

Q18. What if the vulnerability cannot be patched?

Assess the risk, apply available mitigations, document the issue, follow the security exception process if applicable, and track a vendor fix or upgrade plan. Escalate service-side issues through the appropriate support channel.

Q19. Why should we scan again after patching?

A follow-up scan helps verify whether the original vulnerability has actually been resolved. A successful update job alone is not sufficient evidence that every finding is fixed.

Q20. What is the difference between OCI VSS and Qualys?

OCI VSS is natively integrated with OCI, whereas Qualys is a third-party security platform. The appropriate choice depends on coverage requirements, features, licensing, and the organization's security architecture.

Q21. Can we schedule vulnerability scanning?

Yes. Scan Recipes support scheduling options such as daily or weekly scans, depending on the recipe configuration.

Q22. What information should a vulnerability report contain?

It should identify the affected host, vulnerability or CVE, severity, affected package or configuration, remediation recommendation, action taken, and verification status.

Q23. What would you do if a Critical vulnerability were detected in production?

I would validate the finding, assess exposure and business impact, notify the appropriate security and operations teams, prioritize remediation according to the organization's incident and change-management procedures, apply the approved fix, and verify the result through rescanning.

Q24. Explain your vulnerability scanning lab.

I created a Compute Scan Recipe and a Target, reviewed the required permissions, and investigated the Oracle Cloud Agent and Vulnerability Scanning plugin. The plugin remained disabled, and the logs showed a disabled desired state. I documented the evidence and identified the need for further configuration or service-side investigation before validating scan results.

Q25. What is the complete vulnerability management lifecycle?

Identify → Scan → Analyze → Prioritize → Remediate → Verify → Report → Monitor


19. Official Oracle Documentation


20. Final Summary

OCI Vulnerability Scanning helps identify security weaknesses in supported cloud resources. Scan Recipes define the scanning configuration, Targets select the resources, and Reports present the findings.

After analyzing the findings, administrators apply the appropriate remediation. OSMH can help manage supported OS security updates, while network, application, and configuration findings may require other corrective actions. If a service-side problem persists, the team investigates the configuration and permissions and escalates through the appropriate support process.

The final step is always verification: scan again, review the updated findings, document the outcome, and share the authorized report with the client or security team.

STEPS

image image image image image

as of now for lab I have disabled the option of file scan(It was asking for file path and as of now for me its not required)

image image image image image image

in report it is showing nothing because vulnerability scanning is disable

image

now enabling it by clicking on 3 dots

⚠️ **GitHub.com Fallback** ⚠️