GBase 8s 存储加密配置
程序员文章站
2022-07-01 07:53:27
...
1. 概述
存储加密一种数据库安全技术, 在数据库主程序启动时加载扩展插件,可以实现:
(1)在数据写入存储介质前将数据进行加密,实现数据的存储加密;
(2)在从存储介质加载数据到内存前进行数据解密,实现数据的解密使用。
GBase 8s使用存储加密必须要数据库初始化之前完成数据库参数及存储加密参数的配置。
本文基于数据库版本为GBase 8s V8.7 2.0.1a2_2,操作系统为CentOS 7.8编写。
2. 配置文件配置
2.1. secswitch.std配置文件
数据库实例GBASEDBTSERVER使用secswitch.$GBASEDBTSERVER(该文件以secswitch.std为模板)为名的配置,配置文件位$GBASEDBTDIR/etc目录下。
需要修改的参数包括:
[switches]
#switch for user authentication:
#turn off totally : 0
#turn on seperately in bit :
##1 -- first bit means check complexity of the password
##2 -- second bit means check timelimit of the password
##4 -- third bit means check failure counts when logging in
SECURITY_AUTHENTICATION=0
#switch for storage encryption: 0(OFF),1(ON)
SECURITY_STORAGE_ENCRYPTION=1 # 修改为1
#switch for backup encryption: 0(OFF),1 (ON)
SECURITY_BACKUP_RESTORE=1 # 修改为1
启用存储加密,备份加密。
2.2. securityconfig.std 配置文件
据库实例GBASEDBTSERVER使用securityconfig.$GBASEDBTSERVER(该文件以securityconfig.std为模板)为名的配置,配置文件位于$GBASEDBTDIR/etc目录下。
需要修改的参数包括:
[switches]
#switch for user authentication:
#turn off totally : 0
#turn on seperately in bit :
##1 -- first bit means check complexity of the password
##2 -- second bit means check timelimit of the password
##4 -- third bit means check failure counts when logging in
SECURITY_AUTHENTICATION=0
#switch for storage encryption: 0(OFF),1(ON)
SECURITY_STORAGE_ENCRYPTION=1
#switch for backup encryption: 0(OFF),1 (ON)
SECURITY_BACKUP_RESTORE=1
[[email protected] etc]$ more securityconfig.gbase01
#the configuration for user authentication
[authentication]
##the min length of the password
PASSWORD_MIN_LENGTH=8
##the expire days of password
PASSWORD_EXPIRE_DAYS=14
#the configuration for storage encryption
[storage]
##the type of storage encryption
ENCRYPTION_TYPE=SOFT # 修改为SOFT
#the configuration for backup encryption
[backup]
##the type of backup encryption
ENCRYPTION_TYPE=SOFT # 修改为SOFT
修改存储加密、备份加密的方法为SOFT
2.3. seccfg配置文件
seccfg配置文件位于$GBASEDBTDIR/dbssodir目录下,确认内容如下:
IXUSERS=*
2.4. ONCONFIG配置文件
按实际环境配置ONCONFIG配置文件。
2.5. 初始化数据库
按实际环境初始化数据库,此时数据库使用存储加密。