Filter Queries
Found 60 queries.
- All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
- Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
- Statistics about the catalog content and project home in GitHub that has additional information.
#1. All database privileges
system catalog base tables onlyFind the privileges to use the database. c - CONNECT; C - CREATE; T - TEMPORARY.
#2. All security policies
system catalog base tables onlyFind all security policies.
#3. Are the passwords hashed?
INFORMATION_SCHEMA+system catalog base tablesFind base table columns that name refers to the possibility that these are used to register passwords. Return a value from each such column. Make sure that the password is not registered as open text.
#4. Base table columns for storing username, password, and salt
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register usernames, passwords, and salt. Password should not be open text. It should be a hash value that has been hashed by using salt.
#5. Database can be accessed through PUBLIC privileges
system catalog base tables onlyFind as to whether the database access by users (applications) can take place thanks to PUBLIC privileges, i.e., find as to whether PUBLIC (all current and future users) has CONNECT privilege in the database. PUBLIC gets the privilege by default.
#6. Database connect privilege is missing
INFORMATION_SCHEMA+system catalog base tablesFind non-superusers who have a privilege to use a table or a routine but do not have the privilege to connect to the database.
#7. Different search paths of SECURITY DEFINER functions
INFORMATION_SCHEMA+system catalog base tablesFind the different search paths used in case of SECURITY DEFINER functions and the number of their occurrences. Make sure that these have been specified correctly and consistently and that they do not refer to any non-existent schemas.
#8. Excessive privileges on databases, schemas, domains, types, languages, foreign data wrappers, and foreign servers
system catalog base tables onlyFind excessive privileges on databases, schemas, domains, collations, sequences, foreign data wrappers, and foreign servers that are probably not needed by a typical application.
#9. Extension routines that execution privilege has been granted to PUBLIC
INFORMATION_SCHEMA+system catalog base tablesKnow the privileges that users have in your system. Probably all the database users do not need these privileges.
#10. Grantable column privileges
INFORMATION_SCHEMA+system catalog base tablesFind column privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.
#11. Grantable privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers
system catalog base tables onlyFind privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.
#12. Grantable roles
system catalog base tables onlyFind roles that a member can grant to others, i.e., the role has been granted with ADMIN OPTION. The number of privileges that can be passed on should be as small as possible.
#13. Grantable routine privileges
INFORMATION_SCHEMA+system catalog base tablesFind routine privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.
#14. Grantable table privileges
INFORMATION_SCHEMA+system catalog base tablesFind table privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.
#15. Grantable usage privileges
INFORMATION_SCHEMA+system catalog base tablesFind usage privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.
#16. Granted roles
system catalog base tables onlyFind membership relations between roles.
#17. Grantees
INFORMATION_SCHEMA onlyDatabase must be used by users who have minimal set of privileges for performing tasks. The query helps to find out as to whether some user/role other than PUBLIC and a superuser have rights to use tables and routines of the database.
#18. Incorrect password hash update
INFORMATION_SCHEMA+system catalog base tablesFind row level update triggers that incorrectly implement update of password hash. It should not be that the new password hash is calculated based on the existing hash.
#19. Installed extensions
system catalog base tables onlyTry to use as much the possibilities of the DBMS as possible. On the other hand, do not install extensions that are not needed in order not to overcomplicate the database.
#20. Insufficient routine privileges
INFORMATION_SCHEMA+system catalog base tablesYou must give rights to use routines to the users/roles that correspond to applications.
| # | Name (sorted ascending) | Goal | Type | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 1 | All database privileges | Find the privileges to use the database. c - CONNECT; C - CREATE; T - TEMPORARY. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 2 | All security policies | Find all security policies. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 3 | Are the passwords hashed? | Find base table columns that name refers to the possibility that these are used to register passwords. Return a value from each such column. Make sure that the password is not registered as open text. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 4 | Base table columns for storing username, password, and salt | Find base table columns that name refers to the possibility that these are used to register usernames, passwords, and salt. Password should not be open text. It should be a hash value that has been hashed by using salt. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 5 | Database can be accessed through PUBLIC privileges | Find as to whether the database access by users (applications) can take place thanks to PUBLIC privileges, i.e., find as to whether PUBLIC (all current and future users) has CONNECT privilege in the database. PUBLIC gets the privilege by default. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 6 | Database connect privilege is missing | Find non-superusers who have a privilege to use a table or a routine but do not have the privilege to connect to the database. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 7 | Different search paths of SECURITY DEFINER functions | Find the different search paths used in case of SECURITY DEFINER functions and the number of their occurrences. Make sure that these have been specified correctly and consistently and that they do not refer to any non-existent schemas. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 8 | Excessive privileges on databases, schemas, domains, types, languages, foreign data wrappers, and foreign servers | Find excessive privileges on databases, schemas, domains, collations, sequences, foreign data wrappers, and foreign servers that are probably not needed by a typical application. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 9 | Extension routines that execution privilege has been granted to PUBLIC | Know the privileges that users have in your system. Probably all the database users do not need these privileges. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 10 | Grantable column privileges | Find column privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 11 | Grantable privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers | Find privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 12 | Grantable roles | Find roles that a member can grant to others, i.e., the role has been granted with ADMIN OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 13 | Grantable routine privileges | Find routine privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 14 | Grantable table privileges | Find table privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 15 | Grantable usage privileges | Find usage privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 16 | Granted roles | Find membership relations between roles. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 17 | Grantees | Database must be used by users who have minimal set of privileges for performing tasks. The query helps to find out as to whether some user/role other than PUBLIC and a superuser have rights to use tables and routines of the database. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 18 | Incorrect password hash update | Find row level update triggers that incorrectly implement update of password hash. It should not be that the new password hash is calculated based on the existing hash. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 19 | Installed extensions | Try to use as much the possibilities of the DBMS as possible. On the other hand, do not install extensions that are not needed in order not to overcomplicate the database. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 20 | Insufficient routine privileges | You must give rights to use routines to the users/roles that correspond to applications. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |