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

Snowflake Security Dashboards - Configuration Management query inaccuracy #1502

Open
SnowflakeJim opened this issue Aug 22, 2024 · 0 comments

Comments

@SnowflakeJim
Copy link

Describe the bug
In the Snowflake Security Dashboards, step 8 (Configuration Management tiles) there is a query to show "Configuration Management: Privileged object changes by User.

The query won't return everything it should because it doesn't account for the CREATE OR REPLACE syntax

The query also doesn't filter out SHOW commands, which it should.

A potentially better version of the query is:

SELECT
query_text,
user_name,
role_name,
end_time
FROM snowflake.account_usage.query_history
WHERE execution_status = 'SUCCESS'
AND query_type NOT in ('SELECT', 'SHOW')
AND (query_text ILIKE '%create%role%'
OR query_text ILIKE '%manage grants%'
OR query_text ILIKE '%create%integration%'
OR query_text ILIKE '%create%share%'
OR query_text ILIKE '%create%account%'
OR query_text ILIKE '%monitor usage%'
OR query_text ILIKE '%ownership%'
OR query_text ILIKE '%drop table%'
OR query_text ILIKE '%drop database%'
OR query_text ILIKE '%create%stage%'
OR query_text ILIKE '%drop stage%'
OR query_text ILIKE '%alter stage%'
)
ORDER BY end_time desc;

URL of where you see the bug
https://quickstarts.snowflake.com/guide/security_dashboards_for_snowflake/index.html?index=..%2F..index#7

To Reproduce
N/A

Expected behavior
SHOW commands should not be in the output totals, and the totals should include instances where the CREATE OR REPLACE syntax was used instead of just CREATE statements

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant