-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extra checks glue queries (#426)
- Loading branch information
1 parent
fb8658e
commit 7143dce
Showing
10 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ select | |
region, | ||
account_id | ||
from | ||
aws_ec2_load_balancer_listener; | ||
aws_ec2_load_balancer_listener; |
15 changes: 15 additions & 0 deletions
15
query/glue/glue_data_catalog_encryption_settings_metadata_encryption_enabled.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
select | ||
-- Required Columns | ||
case | ||
when encryption_at_rest is not null and encryption_at_rest ->> 'CatalogEncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as "status", | ||
case | ||
when encryption_at_rest is not null and encryption_at_rest ->> 'CatalogEncryptionMode' != 'DISABLED' then 'enabled glue data catalog metadata encryption in ' || region | ||
else 'disabled glue data catalog metadata encryption in ' || region | ||
end as reason, | ||
-- Additional Dimensions | ||
region, | ||
account_id | ||
from | ||
aws_glue_data_catalog_encryption_settings; |
15 changes: 15 additions & 0 deletions
15
query/glue/glue_data_catalog_encryption_settings_password_encryption_enabled.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
select | ||
-- Required Columns | ||
case | ||
when connection_password_encryption is not null and connection_password_encryption ->> 'ReturnConnectionPasswordEncrypted' != 'false' then 'ok' | ||
else 'alarm' | ||
end as "status", | ||
case | ||
when connection_password_encryption is not null and connection_password_encryption ->> 'ReturnConnectionPasswordEncrypted' != 'false' then 'enabled glue data catalog connection password encryption in ' || region | ||
else 'disabled glue data catalog connection password encryption in ' || region | ||
end as reason, | ||
-- Additional Dimensions | ||
region, | ||
account_id | ||
from | ||
aws_glue_data_catalog_encryption_settings; |
17 changes: 17 additions & 0 deletions
17
query/glue/glue_dev_endpoint_cloudwatch_logs_encryption_enabled.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
select | ||
-- Required Columns | ||
e.arn as resource, | ||
case | ||
when cloud_watch_encryption is not null and cloud_watch_encryption ->> 'CloudWatchEncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as status, | ||
case | ||
when cloud_watch_encryption is not null and cloud_watch_encryption ->> 'CloudWatchEncryptionMode' != 'DISABLED' then e.title || ' CloudWatch logs encryption enabled.' | ||
else e.title || ' CloudWatch logs encryption disabled.' | ||
end as reason, | ||
-- Additional Dimensions | ||
e.region, | ||
e.account_id | ||
from | ||
aws_glue_dev_endpoint as e | ||
left join aws_glue_security_configuration as c on e.security_configuration = c.name; |
17 changes: 17 additions & 0 deletions
17
query/glue/glue_dev_endpoint_job_bookmarks_encryption_enabled.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
select | ||
-- Required Columns | ||
e.arn as resource, | ||
case | ||
when job_bookmarks_encryption is not null and job_bookmarks_encryption ->> 'JobBookmarksEncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as "status", | ||
case | ||
when job_bookmarks_encryption is not null and job_bookmarks_encryption ->> 'JobBookmarksEncryptionMode' != 'DISABLED' then e.title || ' job bookmarks encryption enabled.' | ||
else e.title || ' job bookmarks encryption disabled.' | ||
end as reason, | ||
-- Additional Dimensions | ||
e.region, | ||
e.account_id | ||
from | ||
aws_glue_dev_endpoint as e | ||
left join aws_glue_security_configuration as c on e.security_configuration = c.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
select | ||
-- Required Columns | ||
d.arn as resource, | ||
case | ||
when e is not null and e ->> 'S3EncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as "status", | ||
case | ||
when e is not null and e ->> 'S3EncryptionMode' != 'DISABLED' then d.title || ' s3 encryption enabled.' | ||
else d.title || ' s3 encryption disabled.' | ||
end as reason, | ||
-- Additional Dimensions | ||
d.region, | ||
d.account_id | ||
from | ||
aws_glue_dev_endpoint as d | ||
left join aws_glue_security_configuration s on d.security_configuration = s.name, | ||
jsonb_array_elements(s.s3_encryption) e; |
17 changes: 17 additions & 0 deletions
17
query/glue/glue_job_cloudwatch_logs_encryption_enabled.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
select | ||
-- Required Columns | ||
j.arn as resource, | ||
case | ||
when cloud_watch_encryption is not null and cloud_watch_encryption ->> 'CloudWatchEncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as status, | ||
case | ||
when cloud_watch_encryption is not null and cloud_watch_encryption ->> 'CloudWatchEncryptionMode' != 'DISABLED' then j.title || ' CloudWatch logs encryption enabled.' | ||
else j.title || ' CloudWatch logs encryption disabled.' | ||
end as reason, | ||
-- Additional Dimensions | ||
j.region, | ||
j.account_id | ||
from | ||
aws_glue_job as j | ||
left join aws_glue_security_configuration as c on j.security_configuration = c.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
select | ||
-- Required Columns | ||
j.arn as resource, | ||
case | ||
when job_bookmarks_encryption is not null and job_bookmarks_encryption ->> 'JobBookmarksEncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as status, | ||
case | ||
when job_bookmarks_encryption is not null and job_bookmarks_encryption ->> 'JobBookmarksEncryptionMode' != 'DISABLED' then j.title || ' job bookmarks encryption enabled.' | ||
else j.title || ' job bookmarks encryption disabled.' | ||
end as reason, | ||
-- Additional Dimensions | ||
j.region, | ||
j.account_id | ||
from | ||
aws_glue_job as j | ||
left join aws_glue_security_configuration as c on j.security_configuration = c.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
select | ||
-- Required Columns | ||
j.arn as resource, | ||
case | ||
when e is not null and e ->> 'S3EncryptionMode' != 'DISABLED' then 'ok' | ||
else 'alarm' | ||
end as status, | ||
case | ||
when e is not null and e ->> 'S3EncryptionMode' != 'DISABLED' then j.title || ' enabled s3 encryption.' | ||
else j.title || ' disabled s3 encryption.' | ||
end as reason, | ||
-- Additional Dimensions | ||
j.region, | ||
j.account_id | ||
from | ||
aws_glue_job as j | ||
left join aws_glue_security_configuration as s on j.security_configuration = s.name, | ||
jsonb_array_elements(s.s3_encryption) e; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ select | |
region, | ||
account_id | ||
from | ||
aws_securityhub_standards_subscription; | ||
aws_securityhub_standards_subscription; |