mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
Added a third parameter to checks textFail and textPass to identify resource name in finding.
45 lines
2.2 KiB
Bash
45 lines
2.2 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_extra797="7.97"
|
|
CHECK_TITLE_extra797="[extra797] Ensure Kubernetes Secrets are encrypted using Customer Master Keys (CMKs)"
|
|
CHECK_SCORED_extra797="NOT_SCORED"
|
|
CHECK_TYPE_extra797="EXTRA"
|
|
CHECK_SEVERITY_extra797="Medium"
|
|
CHECK_ASFF_RESOURCE_TYPE_extra797="AwsEksCluster"
|
|
CHECK_ALTERNATE_check797="extra797"
|
|
CHECK_SERVICENAME_extra797="eks"
|
|
CHECK_RISK_extra797='Implementing envelope encryption is considered a security best practice for applications that store sensitive data and is part of a defense in depth security strategy.'
|
|
CHECK_REMEDIATION_extra797=' Setup your own Customer Master Key (CMK) in KMS and link this key by providing the CMK ARN when you create an EKS cluster.'
|
|
CHECK_DOC_extra797='https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html'
|
|
CHECK_CAF_EPIC_extra797='Data Protection'
|
|
|
|
extra797(){
|
|
textInfo "Looking for encryption config for EKS clusters across all regions... "
|
|
for regx in $REGIONS; do
|
|
CLUSTERS=$($AWSCLI eks list-clusters $PROFILE_OPT --region $regx --query 'clusters[]' --output text)
|
|
if [[ $CLUSTERS ]]; then
|
|
for CLUSTER in $CLUSTERS;do
|
|
ENC_CONFIG=$($AWSCLI eks describe-cluster $PROFILE_OPT --region $regx --name $CLUSTER --query 'cluster.encryptionConfig')
|
|
|
|
if [[ $ENC_CONFIG == "null" ]]; then
|
|
textFail "$regx: Encryption for Kubernetes secrets is not configured for EKS cluster $CLUSTER" "$regx" "$CLUSTER"
|
|
else
|
|
textPass "$regx: Encryption for Kubernetes secrets is configured for EKS cluster $CLUSTER" "$regx" "$CLUSTER"
|
|
fi
|
|
done
|
|
else
|
|
textInfo "$regx: No EKS clusters found" "$regx"
|
|
fi
|
|
done
|
|
}
|