Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

关于Symfoware的透明加密

0
0

Symfoware V12基于PostgreSQL,并提供了一些功能增强,其中包括表空间级的透明加密。

概述 加密key和keystore 每个表空间的数据由各自的Key加密 表空间Key由Master Key加密 Master Key整个数据库实例只有1个,使用者通过密码加密保存在keystore中 加密算法

采用AES算法,利用Intel Xeon内置的AES-NI(Advanced Encryption Standard New Instructions)硬件加密,可加减少加解密的资源消耗。

加密范围 表空间内的所有文件
数据,索引,临时表,临时索引。 备份数据
pgx_dmpall和pg_basebackup命令输出的备份的文件 WAL和临时文件(排序和Join产生的临时文件) 流复制主备间传送的数据 使用方法

在postgres.conf中设置keystore文件存放位置

keystore_location = '/key/store/location'

设置master key

SELECT pgx_set_master_key('passphrase');

这个函数会生成master key,并通过passphrase加密存储到keystore_location设定目录的keystore.ks中。passphrase即keystore的密码。

打开keystore

SELECT pgx_open_keystore('passphrase');

每次启动数据库后,需要打开keystore,把master key加载到内存。这里的passphrase是前面传入pgx set master_key()的密码。

表空间的加密

设置以后创建的表空间自动数据加密

SET tablespace_encryption_algorithm = 'AES256';
CREATE TABLESPACE secure_tablespace LOCATION '/My/Data/Dir';

设置以后创建的表空间不使用加密

SET tablespace_encryption_algorithm = 'none';

keystore的密码变更

SELECT pgx_set_keystore_passphrase('old_passphrase', 'new_passphrase');

设置自动打开keystore

pgx_keystore --enable-auto-open /key/store/location/keystore.ks

执行后生成keystore.aks文件,keystore.aks是keystore.ks解密后再经过混淆后的结果。 生成keystore.aks后,每次数据库启动时会自动打开keystore,加载master key,无需输入密码。

注意事项 内存中的数据是解密后的明文,所有要防止core文件和swap泄密。 防止包含keystore密码的SQL语句记录到日志或在通信过程中泄密。 参考

http://software.fujitsu.com/jp/manual/manualfiles/m140019/j2ul1736/05z200/index.html


Viewing all articles
Browse latest Browse all 12749

Latest Images

Trending Articles





Latest Images