Skip to main content

More Info:

No security group should allow unrestricted inbound access to TCP port 1521 (Oracle Database).

Risk Level

Medium

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Startup Security Baseline
  • AWS Well Architected Framework
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • FedRAMP
  • GDPR
  • HITRUST CSF
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST CSF
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • PCI
  • Reserve Bank of India (RBI) Cyber Security Framework
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SOC2
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the issue of unrestricted Oracle access in AWS, you can follow the below steps:
  1. Open the AWS Management Console and navigate to the RDS service.
  2. Select the affected RDS instance and click on the “Modify” button.
  3. Scroll down to the “Network & Security” section and click on the “Additional Configuration” tab.
  4. In the “Additional Configuration” tab, locate the “Publicly Accessible” option and set it to “No”.
  5. Next, locate the “VPC Security Group” option and select the appropriate security group that allows access only to the required IP addresses or CIDR ranges.
  6. Click on the “Continue” button and review the changes. If everything is correct, click on the “Modify DB Instance” button to apply the changes.
  7. After the changes have been applied, verify that the RDS instance is no longer publicly accessible and that access is restricted to the required IP addresses or CIDR ranges.
By following these steps, you can remediate the issue of unrestricted Oracle access in AWS and ensure that your RDS instance is secure.

To remediate the unrestricted Oracle access issue in AWS, you can follow the below steps using AWS CLI:
  1. Connect to your AWS account using AWS CLI.
  2. Identify the security group that allows unrestricted Oracle access. You can use the following command to list all security groups in your AWS account:
  1. Once you have identified the security group, use the following command to update the inbound rules of the security group to restrict access to Oracle:
This command will remove the inbound rule that allows unrestricted access to Oracle on port 1521 from any IP address.
  1. After running the above command, you can verify that the rule has been removed by running the following command:
This command will display the details of the security group, including the inbound rules.
  1. Finally, you should test the Oracle access to ensure that it is restricted as expected. If necessary, you can modify the security group rules further to allow access only from specific IP addresses or networks.
To remediate the “Unrestricted Oracle Access Should Not Be Allowed” misconfiguration in AWS using Python, you can follow these steps:
  1. Install the Boto3 AWS SDK for Python:
  1. Use Boto3 to connect to the AWS account:
  1. Use the describe_security_groups method to get a list of all the security groups in the account:
  1. Loop through the security groups and check if any of them have unrestricted Oracle access:
  1. If you find a security group with unrestricted Oracle access, use the revoke_security_group_ingress method to remove the rule:
This will remove the unrestricted Oracle access from the security group.
Remove (or do not create) any aws_vpc_security_group_ingress_rule (or inline ingress blocks) that have:
  • ip_protocol = "tcp", from_port = 1521, to_port = 1521 AND cidr_ipv4 = "0.0.0.0/0"
  • ip_protocol = "tcp", from_port = 1521, to_port = 1521 AND cidr_ipv6 = "::/0"
This mirrors the CLI fix by revoking ingress from 0.0.0.0/0 and ::/0; it may break clients that currently use that open access but does not replace the security group itself.Verification: terraform plan should show the aws_vpc_security_group_ingress_rule resources (or inline ingress rules) for TCP/1521 with 0.0.0.0/0 and/or ::/0 being destroyed, and only restricted CIDRs (if any) remaining.

Additional Reading: