Back to Checks
A security group rule should not allow unrestricted ingress traffic from any IP address.
NIF-0011
Service: rdbSeverity: critical
OfficialBuilt-inVerified
Opening up ports to allow connections from the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
Run this check with Prowler
Run in Prowler CloudRun
prowler iac --checks NIF-0011Recommendation
Set a more restrictive cidr range
Check Code
# METADATA
# title: A security group rule should not allow unrestricted ingress traffic from any IP address.
# description: |
# Opening up ports to allow connections from the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.
# scope: package
# schemas:
# - input: schema["cloud"]
# related_resources:
# - https://pfs.nifcloud.com/api/rdb/AuthorizeDBSecurityGroupIngress.htm
# custom:
# id: NIF-0011
# long_id: nifcloud-rdb-no-public-ingress-db-sgr
# aliases:
# - AVD-NIF-0011
# - no-public-ingress-db-sgr
# - nifcloud-rdb-no-public-ingress-db-sgr
# provider: nifcloud
# service: rdb
# severity: CRITICAL
# recommended_action: Set a more restrictive cidr range
# input:
# selector:
# - type: cloud
# subtypes:
# - service: rdb
# provider: nifcloud
# examples: checks/cloud/nifcloud/rdb/no_public_ingress_db_sgr.yaml
package builtin.nifcloud.rdb.nifcloud0011
import rego.v1
import data.lib.net
deny contains res if {
some sg in input.nifcloud.rdb.dbsecuritygroups
some c in sg.cidrs
net.cidr_allows_all_ips(c.value)
res := result.new("Security group rule allows unrestricted ingress from any IP address.", c)
}