mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
36 lines
2.4 KiB
Bash
36 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.
|
|
|
|
CHECK_ID_check113="1.13"
|
|
CHECK_TITLE_check113="[check113] Ensure MFA is enabled for the root account"
|
|
CHECK_SCORED_check113="SCORED"
|
|
CHECK_TYPE_check113="LEVEL1"
|
|
CHECK_SEVERITY_check113="Critical"
|
|
CHECK_ASFF_TYPE_check113="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
|
|
CHECK_ALTERNATE_check113="check113"
|
|
CHECK_SERVICENAME_check113="iam"
|
|
CHECK_RISK_check113='The root account is the most privileged user in an AWS account. MFA adds an extra layer of protection on top of a user name and password. With MFA enabled when a user signs in to an AWS website they will be prompted for their user name and password as well as for an authentication code from their AWS MFA device. When virtual MFA is used for root accounts it is recommended that the device used is NOT a personal device but rather a dedicated mobile device (tablet or phone) that is managed to be kept charged and secured independent of any individual personal devices. ("non-personal virtual MFA") This lessens the risks of losing access to the MFA due to device loss / trade-in or if the individual owning the device is no longer employed at the company.'
|
|
CHECK_REMEDIATION_check113='Using IAM console navigate to Dashboard and expand Activate MFA on your root account.'
|
|
CHECK_DOC_check113='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user_manage_mfa'
|
|
CHECK_CAF_EPIC_check113='IAM'
|
|
|
|
check113(){
|
|
# "Ensure MFA is enabled for the root account (Scored)"
|
|
COMMAND113=$($AWSCLI iam get-account-summary $PROFILE_OPT --region $REGION --output json --query 'SummaryMap.AccountMFAEnabled')
|
|
if [ "$COMMAND113" == "1" ]; then
|
|
textPass "$REGION: Virtual MFA is enabled for root" "$REGION" "MFA"
|
|
else
|
|
textFail "$REGION: MFA is not ENABLED for root account" "$REGION" "MFA"
|
|
fi
|
|
}
|