Check your Oracle Cloud Infrastructure (OCI) network security groups for inbound rules that allow unrestricted access (i.e. 0.0.0.0/0) on TCP port 22 and limit the access to trusted IP addresses or IP ranges only in order to implement the Principle of Least Privilege (POLP) and reduce the attack surface. TCP port 22 is used for secure remote login by connecting an SSH client application with an SSH server.
Exposing TCP port 22 (Secure Shell - SSH) to the Internet can increase opportunities for malicious activities such as hacking, Man-In-The-Middle (MITM) attacks, and brute-force attacks. Therefore, it is highly recommended to configure your OCI network security groups (NSGs) to limit inbound traffic on TCP port 22 to known and trusted IP addresses only.
Audit
To determine if your OCI network security groups (NSGs) allow unrestricted access on TCP port 22 (SSH), perform the following operations:
Remediation / Resolution
To update the inbound rule configuration for your OCI network security groups (NSGs) in order to limit SSH access to trusted networks and machines only (i.e., authorized IP addresses and IP address ranges) or to remove the non-compliant rule entirely, perform the following operations:
References
- Oracle Cloud Infrastructure Documentation
- Network Security Group Management
- Network Security Groups
- Managing Security Rules for an NSG
- Oracle Cloud Infrastructure CLI Documentation
- compartment list
- nsg list
- nsg rules list
- nsg rules update
- nsg rules remove