Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foundational_security_rds_9 reporting logs not enabled - sqlserver-express. Closes #295 #296

Merged
merged 2 commits into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions query/rds/rds_db_instance_logging_enabled.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ select
arn as resource,
engine,
case
when engine like any (array ['mariadb', '%mysql']) and enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery'] then 'ok'
when engine like any (array['%postgres%']) and enabled_cloudwatch_logs_exports ?& array ['postgresql','upgrade'] then 'ok'
when engine like 'oracle%' and enabled_cloudwatch_logs_exports ?& array ['alert','audit', 'trace','listener'] then 'ok'
when engine like 'sqlserver%' and enabled_cloudwatch_logs_exports ?& array ['error','agent'] then 'ok'
when engine like any (array ['mariadb', '%mysql']) and enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery'] then 'ok'
when engine like any (array['%postgres%']) and enabled_cloudwatch_logs_exports ?& array ['postgresql','upgrade'] then 'ok'
when engine like 'oracle%' and enabled_cloudwatch_logs_exports ?& array ['alert','audit', 'trace','listener'] then 'ok'
when engine = 'sqlserver-ex' and enabled_cloudwatch_logs_exports ?& array ['error'] then 'ok'
when engine like 'sqlserver%' and enabled_cloudwatch_logs_exports ?& array ['error','agent'] then 'ok'
else 'alarm'
end as status,
case
when engine like any (array ['mariadb', '%mysql']) and enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery']
then title || ' ' || engine || ' logging enabled.'
when engine like any (array['%postgres%']) and enabled_cloudwatch_logs_exports ?& array ['postgresql','upgrade']
then title || ' ' || engine || ' logging enabled.'
when engine like 'oracle%' and enabled_cloudwatch_logs_exports ?& array ['alert','audit', 'trace','listener']
then title || ' ' || engine || ' logging enabled.'
when engine like 'sqlserver%' and enabled_cloudwatch_logs_exports ?& array ['error','agent']
then title || ' ' || engine || ' logging enabled.'
when engine like any (array ['mariadb', '%mysql']) and enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery']
then title || ' ' || engine || ' logging enabled.'
when engine like any (array['%postgres%']) and enabled_cloudwatch_logs_exports ?& array ['postgresql','upgrade']
then title || ' ' || engine || ' logging enabled.'
when engine like 'oracle%' and enabled_cloudwatch_logs_exports ?& array ['alert','audit', 'trace','listener']
then title || ' ' || engine || ' logging enabled.'
when engine = 'sqlserver-ex' and enabled_cloudwatch_logs_exports ?& array ['error']
then title || ' ' || engine || ' logging enabled.'
when engine like 'sqlserver%' and enabled_cloudwatch_logs_exports ?& array ['error','agent']
then title || ' ' || engine || ' logging enabled.'
else title || ' logging not enabled.'
end as reason,
-- Additional Dimensions
region,
account_id
from
aws_rds_db_instance;
aws_rds_db_instance;