Files
prowler/checks/check_extra7151
2021-09-20 10:16:52 -05:00

54 lines
2.4 KiB
Bash

#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Remediation:
#
# https://docs.aws.amazon.com/cli/latest/reference/route53domains/update-domain-contact-privacy.html
#
# update-domain-contact-privacy \
# --region us-east-1 \
# --domain-name example.com \
# --admin-privacy \
# --registrant-privacy \
# --tech-privacy
CHECK_ID_extra7151="7.151"
CHECK_TITLE_extra7151="[extra7151] Enable Privacy Protection for domain contact information"
CHECK_SCORED_extra7151="NOT_SCORED"
CHECK_TYPE_extra7151="EXTRA"
CHECK_SEVERITY_extra7151="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7151="AwsRoute53Domain"
CHECK_ALTERNATE_check7151="extra7151"
CHECK_SERVICENAME_extra7151="route53"
CHECK_RISK_extra7151='Without privacy protection enabled, ones personal information is published to the public WHOIS database'
CHECK_REMEDIATION_extra7151='Ensure default VPC is deleted'
CHECK_DOC_extra7151='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-privacy-protection.html'
CHECK_CAF_EPIC_extra7151='Data Protection'
extra7151(){
echo "Route53 is a global service, looking for domains in US-EAST-1"
DOMAIN_NAMES=$($AWSCLI route53domains list-domains $PROFILE_OPT --region us-east-1 --query 'Domains[*].DomainName' --output text )
if [[ $DOMAIN_NAMES ]];then
for domain_name in $DOMAIN_NAMES;do
DOMAIN_DETAIL=$($AWSCLI route53domains get-domain-detail $PROFILE_OPT --region us-east-1 --query 'AdminPrivacy' --domain-name $domain_name)
if [[ $DOMAIN_DETAIL == false ]]; then
textFail "$regx: Contact information public for: $domain_name" "$regx" "$domain_name"
else
textPass "$regx: All contact information is private for: $domain_name" "$regx" "$domain_name"
fi
done
else
textPass "$regx: No Domain Names found" "$regx"
fi
}