Triage and Remediation
Remediation
Using Console
Using Console
To remediate the issue of unrestricted Oracle access in AWS, you can follow the below steps:
- Open the AWS Management Console and navigate to the RDS service.
- Select the affected RDS instance and click on the “Modify” button.
- Scroll down to the “Network & Security” section and click on the “Additional Configuration” tab.
- In the “Additional Configuration” tab, locate the “Publicly Accessible” option and set it to “No”.
- 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.
- Click on the “Continue” button and review the changes. If everything is correct, click on the “Modify DB Instance” button to apply the changes.
- 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.
Using CLI
Using CLI
To remediate the unrestricted Oracle access issue in AWS, you can follow the below steps using AWS CLI:This command will remove the inbound rule that allows unrestricted access to Oracle on port 1521 from any IP address.This command will display the details of the security group, including the inbound rules.
- Connect to your AWS account using AWS CLI.
- Identify the security group that allows unrestricted Oracle access. You can use the following command to list all security groups in your AWS account:
- 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:
- After running the above command, you can verify that the rule has been removed by running the following command:
- 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.
Using Python
Using Python
To remediate the “Unrestricted Oracle Access Should Not Be Allowed” misconfiguration in AWS using Python, you can follow these steps:This will remove the unrestricted Oracle access from the security group.
- Install the Boto3 AWS SDK for Python:
- Use Boto3 to connect to the AWS account:
- Use the
describe_security_groups
method to get a list of all the security groups in the account:
- Loop through the security groups and check if any of them have unrestricted Oracle access:
- If you find a security group with unrestricted Oracle access, use the
revoke_security_group_ingress
method to remove the rule: