mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-21 23:51:09 +00:00
Adding cross-DBMS security configuration audit (--audit)
This commit is contained in:
parent
6530184e2c
commit
d0ad9b2e34
43 changed files with 1236 additions and 3 deletions
5
data/procs/postgresql/audit_configuration.sql
Normal file
5
data/procs/postgresql/audit_configuration.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SELECT audit_key,audit_value FROM (
|
||||
SELECT name AS audit_key,CASE WHEN setting IS NULL THEN 'N' ELSE 'V'||setting END AS audit_value
|
||||
FROM pg_catalog.pg_settings
|
||||
WHERE name IN ('ssl','password_encryption','row_security','logging_collector','log_statement','log_connections','log_disconnections')
|
||||
) audit_rows ORDER BY audit_key
|
||||
7
data/procs/postgresql/audit_identity.sql
Normal file
7
data/procs/postgresql/audit_identity.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
SELECT audit_key,audit_value FROM (
|
||||
SELECT 'effective account' AS audit_key,CASE WHEN CURRENT_USER IS NULL THEN 'N' ELSE 'V'||CAST(CURRENT_USER AS TEXT) END AS audit_value
|
||||
UNION ALL
|
||||
SELECT 'login identity' AS audit_key,CASE WHEN SESSION_USER IS NULL THEN 'N' ELSE 'V'||CAST(SESSION_USER AS TEXT) END AS audit_value
|
||||
UNION ALL
|
||||
SELECT 'database' AS audit_key,CASE WHEN CURRENT_DATABASE() IS NULL THEN 'N' ELSE 'V'||CAST(CURRENT_DATABASE() AS TEXT) END AS audit_value
|
||||
) audit_rows ORDER BY audit_key
|
||||
7
data/procs/postgresql/audit_privileges.sql
Normal file
7
data/procs/postgresql/audit_privileges.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
SELECT audit_key,audit_value FROM (
|
||||
SELECT 'superuser' AS audit_key,'V'||CASE WHEN rolsuper THEN '1' ELSE '0' END AS audit_value FROM pg_catalog.pg_roles WHERE rolname=CURRENT_USER
|
||||
UNION ALL
|
||||
SELECT 'bypass RLS','V'||CASE WHEN rolbypassrls THEN '1' ELSE '0' END FROM pg_catalog.pg_roles WHERE rolname=CURRENT_USER
|
||||
UNION ALL
|
||||
SELECT rolname,'V'||CASE WHEN pg_has_role(oid,'USAGE') THEN '1' ELSE '0' END FROM pg_catalog.pg_roles WHERE rolname IN ('pg_read_server_files','pg_write_server_files','pg_execute_server_program')
|
||||
) audit_rows ORDER BY audit_key
|
||||
Loading…
Add table
Add a link
Reference in a new issue