MySQL与Oracle数据库在网络安全等级方面用到的命令

  • MySQL数据库命令集
查看数据库版本
SELECT VERSION();
空口令查询
SELECT user,host,account_locked  FROM mysql.user WHERE user = '';
SELECT *  FROM mysql.user;
查询 用户的密码加密情况
SELECT HOST,USER,PLUGIN FROM mysql.`user`;
查询是否有空用户
SELECT host,user,plugin  FROM mysql.user WHERE user = '';
口令定期更换
SELECT host,user,password_lifetime, plugin FROM mysql.user;
是否口令复杂度模块
SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME='validate_password';
口令复杂度策略
SHOW VARIABLES LIKE 'validate_password%';
show variables like 'validate%';
超时连接退出
SHOW VARIABLES LIKE '%timeout%';
登录失败处理模块
SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME='connection_control';
SHOW VARIABLES LIKE 'connection_control%';
日志是否开启
SHOW variables LIKE 'general_log%';
权限分配
SELECT *  FROM mysql.user;
SELECT *  FROM mysql.db;
SELECT *  FROM mysql.tables_priv;
SELECT *  FROM mysql.columns_priv;
完整性
SHOW variables LIKE 'require_secure_transport';
SHOW variables LIKE '%ssl%';
SELECT user, password_expired FROM mysql.user;
  • Oracle数据库命令
SELECT USERNAME,USER_ID FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT USERNAME,PROFILE FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT * FROM DBA_PROFILES WHERE RESOURCE_TYPE= 'PASSWORD'
SELECT USERNAME,PROFILE FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT * FROM DBA_PROFILES WHERE RESOURCE_TYPE='PASSWORD'
SELECT * FROM DBA_PROFILES WHERE RESOURCE_TYPE='KERNEL'
权限:
SELECT * FROM DBA_ROLE_PRIVS;系统预设角色
SELECT * FROM DBA_SYS_PRIVS;
SELECT * FROM DBA_TAB_PRIVS;
SELECT * FROM DBA_COL_PRIVS;
SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT * FROM DBA_ROLE_PRIVS
SELECT * FROM DBA_ROLE_PRIVS
SELECT * FROM DBA_ROLE_PRIVS
日志:
SHOW PARAMETER AUDIT;
SELECT * FROM DBA_STMT_AUDIT_OPTS;
SELECT * FROM DBA_PRIV_AUDIT_OPTS;
SELECT * FROM DBA_OBJ_AUDIT_OPTS;

你可能感兴趣的:(等保测评,网络安全,数据库,mysql,oracle)