diff --git a/checks/check_extra7123 b/checks/check_extra7114 similarity index 60% rename from checks/check_extra7123 rename to checks/check_extra7114 index a6671e86..a728c83f 100644 --- a/checks/check_extra7123 +++ b/checks/check_extra7114 @@ -11,34 +11,34 @@ # CONDITIONS OF ANY KIND, either express or implied. See the License for the # specific language governing permissions and limitations under the License. -CHECK_ID_extra7123="7.123" -CHECK_TITLE_extra7123="[extra7123] Check if Glue security configurations used by ETL Development endpoints have Job bookmark encryption enabled." -CHECK_SCORED_extra7123="NOT_SCORED" -CHECK_TYPE_extra7123="EXTRA" -CHECK_SEVERITY_extra7123="Medium" -CHECK_ASFF_RESOURCE_TYPE_extra7123="AwsGlue" -CHECK_ALTERNATE_check7123="extra7123" +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" -extra7123(){ +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 [[ ! -z "$LIST_EP_SC" ]]; then + 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) + 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 Job Bookmark encryption enabled!" "$regx" + textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have S3 encryption enabled!" "$regx" else - textPass "$regx: Glue Development Endpoint $ENDPOINT_NAME has Job Bookmark encryption enabled" "$regx" + textPass "$regx: Glue development endpoint $ENDPOINT_NAME has S3 encryption enabled" "$regx" fi else - textInfo "$regx: No Glue security configuration found" "$regx" + 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" + textInfo "$regx: There are no Glue development endpoints" "$regx" fi done } diff --git a/checks/check_extra7119 b/checks/check_extra7119 index 081cbbd5..e8d60488 100644 --- a/checks/check_extra7119 +++ b/checks/check_extra7119 @@ -12,7 +12,7 @@ # specific language governing permissions and limitations under the License. CHECK_ID_extra7119="7.119" -CHECK_TITLE_extra7119="[extra7119] Check if Glue security configurations used by ETL Development endpoints have S3 encryption enabled." +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" @@ -22,25 +22,23 @@ 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 [[ ! -z "$LIST_EP_SC" ]]; then + 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" + 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 S3 encryption enabled" "$regx" + textPass "$regx: Glue development endpoint $ENDPOINT_NAME has CloudWatch logs encryption enabled" "$regx" fi else - textInfo "$regx: No Glue security configuration found for Development Endpoint $ENDPOINT_NAME" "$regx" + 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" + textInfo "$regx: There are no Glue development endpoints" "$regx" fi done } - - diff --git a/checks/check_extra7121 b/checks/check_extra7121 index 2aa1ef5a..0dd83446 100644 --- a/checks/check_extra7121 +++ b/checks/check_extra7121 @@ -12,7 +12,7 @@ # specific language governing permissions and limitations under the License. CHECK_ID_extra7121="7.121" -CHECK_TITLE_extra7121="[extra7121] Check if Glue security configurations used by ETL Development endpoints have CloudWatch logs encryption enabled." +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" @@ -22,23 +22,25 @@ 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 [[ ! -z "$LIST_EP_SC" ]]; then + 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" + 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 CloudWatch logs encryption enabled" "$regx" + textPass "$regx: Glue development endpoint $ENDPOINT_NAME has Job Bookmark encryption enabled" "$regx" fi else - textInfo "$regx: No Glue security configuration found" "$regx" + 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" + textInfo "$regx: There are no Glue development endpoints" "$regx" fi done } + + diff --git a/groups/group24_glue b/groups/group24_glue index 4e06b2d0..3722b2cb 100644 --- a/groups/group24_glue +++ b/groups/group24_glue @@ -15,5 +15,5 @@ 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]='extra7115,extra7116,extra7117,extra7118,extra7120,extra7122' +GROUP_CHECKS[24]='extra7114,extra7115,extra7116,extra7117,extra7118,extra7119,extra7120,extra7121,extra7122'