diff --git a/checks/check_extra7114 b/checks/check_extra7114 new file mode 100644 index 00000000..a728c83f --- /dev/null +++ b/checks/check_extra7114 @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Prowler - the handy cloud security tool (copyright 2018) 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_extra7114="7.114" +CHECK_TITLE_extra7114="[extra7114] Check if Glue development endpoints have S3 encryption enabled." +CHECK_SCORED_extra7114="NOT_SCORED" +CHECK_TYPE_extra7114="EXTRA" +CHECK_SEVERITY_extra7114="Medium" +CHECK_ASFF_RESOURCE_TYPE_extra7114="AwsGlue" +CHECK_ALTERNATE_check7114="extra7114" + +extra7114(){ + for regx in $REGIONS; do + LIST_EP_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].{Name:EndpointName,Security:SecurityConfiguration}' --output json) + if [[ $LIST_EP_SC != '[]' ]]; then + for ep in $(echo "${LIST_EP_SC}"| jq -r '.[] | @base64');do + ENDPOINT_NAME=$(echo $ep | base64 --decode | jq -r '.Name') + ENDPOINT_SC=$(echo $ep | base64 --decode | jq -r '.Security // empty') + if [[ ! -z "$ENDPOINT_SC" ]]; then + ENDPOINT_SC_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${ENDPOINT_SC}" $PROFILE_OPT --region $regx --query 'SecurityConfiguration.EncryptionConfiguration.S3Encryption[0].S3EncryptionMode' --output text) + if [[ "$ENDPOINT_SC_ENCRYPTION" == "DISABLED" ]]; then + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have S3 encryption enabled!" "$regx" + else + textPass "$regx: Glue development endpoint $ENDPOINT_NAME has S3 encryption enabled" "$regx" + fi + else + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have security configuration" "$regx" + fi + done + else + textInfo "$regx: There are no Glue development endpoints" "$regx" + fi + done +} + + diff --git a/checks/check_extra7119 b/checks/check_extra7119 new file mode 100644 index 00000000..e8d60488 --- /dev/null +++ b/checks/check_extra7119 @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Prowler - the handy cloud security tool (copyright 2018) 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_extra7119="7.119" +CHECK_TITLE_extra7119="[extra7119] Check if Glue development endpoints have CloudWatch logs encryption enabled." +CHECK_SCORED_extra7119="NOT_SCORED" +CHECK_TYPE_extra7119="EXTRA" +CHECK_SEVERITY_extra7119="Medium" +CHECK_ASFF_RESOURCE_TYPE_extra7119="AwsGlue" +CHECK_ALTERNATE_check7119="extra7119" + +extra7119(){ + for regx in $REGIONS; do + LIST_EP_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].{Name:EndpointName,Security:SecurityConfiguration}' --output json) + if [[ $LIST_EP_SC != '[]' ]]; then + for ep in $(echo "${LIST_EP_SC}"| jq -r '.[] | @base64');do + ENDPOINT_NAME=$(echo $ep | base64 --decode | jq -r '.Name') + ENDPOINT_SC=$(echo $ep | base64 --decode | jq -r '.Security // empty') + if [[ ! -z "$ENDPOINT_SC" ]]; then + ENDPOINT_SC_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${ENDPOINT_SC}" $PROFILE_OPT --region $regx --query 'SecurityConfiguration.EncryptionConfiguration.CloudWatchEncryption.CloudWatchEncryptionMode' --output text) + if [[ $ENDPOINT_SC_ENCRYPTION == "DISABLED" ]]; then + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have CloudWatch logs encryption enabled!" "$regx" + else + textPass "$regx: Glue development endpoint $ENDPOINT_NAME has CloudWatch logs encryption enabled" "$regx" + fi + else + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have security configuration" "$regx" + fi + done + else + textInfo "$regx: There are no Glue development endpoints" "$regx" + fi + done +} diff --git a/checks/check_extra7121 b/checks/check_extra7121 new file mode 100644 index 00000000..0dd83446 --- /dev/null +++ b/checks/check_extra7121 @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Prowler - the handy cloud security tool (copyright 2018) 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_extra7121="7.121" +CHECK_TITLE_extra7121="[extra7121] Check if Glue development endpoints have Job bookmark encryption enabled." +CHECK_SCORED_extra7121="NOT_SCORED" +CHECK_TYPE_extra7121="EXTRA" +CHECK_SEVERITY_extra7121="Medium" +CHECK_ASFF_RESOURCE_TYPE_extra7121="AwsGlue" +CHECK_ALTERNATE_check7121="extra7121" + +extra7121(){ + for regx in $REGIONS; do + LIST_EP_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].{Name:EndpointName,Security:SecurityConfiguration}' --output json) + if [[ $LIST_EP_SC != '[]' ]]; then + for ep in $(echo "${LIST_EP_SC}"| jq -r '.[] | @base64');do + ENDPOINT_NAME=$(echo $ep | base64 --decode | jq -r '.Name') + ENDPOINT_SC=$(echo $ep | base64 --decode | jq -r '.Security // empty') + if [[ ! -z "$ENDPOINT_SC" ]]; then + ENDPOINT_SC_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${ENDPOINT_SC}" $PROFILE_OPT --region $regx --query 'SecurityConfiguration.EncryptionConfiguration.JobBookmarksEncryption.JobBookmarksEncryptionMode' --output text) + if [[ "$ENDPOINT_SC_ENCRYPTION" == "DISABLED" ]]; then + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have Job Bookmark encryption enabled!" "$regx" + else + textPass "$regx: Glue development endpoint $ENDPOINT_NAME has Job Bookmark encryption enabled" "$regx" + fi + else + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have security configuration" "$regx" + fi + done + else + textInfo "$regx: There are no Glue development endpoints" "$regx" + fi + done +} + + diff --git a/groups/group24_glue b/groups/group24_glue index 518a6f24..a9b8c313 100644 --- a/groups/group24_glue +++ b/groups/group24_glue @@ -11,8 +11,8 @@ # CONDITIONS OF ANY KIND, either express or implied. See the License for the # specific language governing permissions and limitations under the License. -GROUP_ID[23]='glue' -GROUP_NUMBER[23]='23.0' -GROUP_TITLE[23]='Amazon Glue related security checks - [glue] ********' -GROUP_RUN_BY_DEFAULT[23]='N' # run it when execute_all is called -GROUP_CHECKS[23]='extra7115,extra7116,extra7117,extra7118,extra7120,extra7122' +GROUP_ID[24]='glue' +GROUP_NUMBER[24]='24.0' +GROUP_TITLE[24]='Amazon Glue related security checks - [glue] ******************' +GROUP_RUN_BY_DEFAULT[24]='N' # run it when execute_all is called +GROUP_CHECKS[24]='extra7114,extra7115,extra7116,extra7117,extra7118,extra7119,extra7120,extra7121,extra7122' \ No newline at end of file