mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
81b6e27eb8
* Adding commands for checks 117 and 118 * fix(check118): Minor fixes and error handling * fix(check117): Minor fixes and error handling Co-authored-by: Pepe Fagoaga <pepe@verica.io>
44 lines
2.7 KiB
Bash
44 lines
2.7 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.
|
|
|
|
CHECK_ID_check118="1.18"
|
|
CHECK_TITLE_check118="[check118] Ensure security contact information is registered"
|
|
CHECK_SCORED_check118="SCORED"
|
|
CHECK_CIS_LEVEL_check118="LEVEL1"
|
|
CHECK_SEVERITY_check118="Medium"
|
|
CHECK_ASFF_TYPE_check118="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
|
|
CHECK_ALTERNATE_check118="check118"
|
|
CHECK_SERVICENAME_check118="support"
|
|
CHECK_RISK_check118='AWS provides customers with the option of specifying the contact information for accounts security team. It is recommended that this information be provided. Specifying security-specific contact information will help ensure that security advisories sent by AWS reach the team in your organization that is best equipped to respond to them.'
|
|
CHECK_REMEDIATION_check118='Go to the My Account section and complete alternate contacts.'
|
|
CHECK_DOC_check118='https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-account-payment.html'
|
|
CHECK_CAF_EPIC_check118='IAM'
|
|
|
|
check118(){
|
|
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
|
|
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks." "${REGION}" "root"
|
|
else
|
|
# "Ensure security contact information is registered (Scored)"
|
|
GET_SECURITY_CONTACT_DETAILS=$("${AWSCLI}" account get-alternate-contact --alternate-contact-type SECURITY --output text ${PROFILE_OPT} --region "${REGION}" 2>&1)
|
|
if grep -E -q 'AccessDenied|UnauthorizedOperation|AuthorizationError' <<< "${GET_SECURITY_CONTACT_DETAILS}"; then
|
|
textInfo "${REGION}: Access Denied trying to get account contact information" "${REGION}"
|
|
else
|
|
if grep "SECURITY" <<< "${GET_SECURITY_CONTACT_DETAILS}"; then
|
|
textPass "${REGION}: Account has security contact information. Perhaps check for freshness of these details." "${REGION}" "root"
|
|
else
|
|
textFail "${REGION}: Account has not security contact information, or it was unable to capture. See section 1.18 on the CIS Benchmark guide for details." "${REGION}" "root"
|
|
fi
|
|
fi
|
|
fi
|
|
}
|