π AWS EC2 Security Group allows unrestricted traffic to MSSQL π’
- Contextual name: π Security Group allows unrestricted traffic to MSSQL π’
- ID:
/ce/ca/aws/ec2/security-group-allows-unrestricted-traffic-to-mssql
- Located in: π AWS EC2
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
- Internal
dec-x-f12d78aa
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-f12d78aa | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Review and restrict AWS EC2 Security Groups to ensure that inbound traffic to Microsoft SQL Server (port 1433) is limited to authorized IP addresses or trusted networks. Security Groups should be configured to restrict access to MSSQL instances to trusted IP addresses or internal networks, minimizing the risk of unauthorized access and potential exploitation.
Rationalβ
Unrestricted access to MSSQL can expose the database to various threats, including brute-force attacks, unauthorized data access, and data theft. MSSQL servers are frequently targeted by attackers due to weak authentication or vulnerabilities in outdated versions. By limiting access to only trusted sources, you reduce the attack surface and ensure that the database is protected from external threats.
Impactβ
Requires configuring the Security Group to maintain legitimate database access for authorized users and applications.
Auditβ
This policy marks an EC2 Security Group as
INCOMPLIANT
if it contains a rule that meets all the following conditions:... see more
Remediationβ
Remediationβ
From Command Lineβ
- Run the following command to remove or modify the unrestricted rule for MSSQL access:
aws ec2 revoke-security-group-ingress \
--region {{region-name}} \
--group-id {{security-group-id}} \
--protocol {{protocol}} \
--port 1433 \
--cidr {{0.0.0.0/0 or ::/0}}
Optionally, run the
authorise-security-group-ingress
command to create a new rule, specifying a trusted CIDR range instead of0.0.0.0/0
.
- Confirm the changes by describing the security group again and ensuring the unrestricted access rule has been removed or appropriately restricted:
aws ec2 describe-security-groups \
--region {{region-name}} \
--group-ids {{security-group-id}} \
--query 'SecurityGroups[*].IpPermissions[?FromPort==`1433`].{CIDR:IpRanges[*].CidrIp,Port:FromPort}'
- Monitor MSSQL access to ensure it's unaffected by the changes.