为 Solr/lucene 个索引添加加密

Adding Encryption to Solr/lucene indexes

我目前正在使用 Solr 对一些敏感记录执行搜索服务。

由于 Solr/lucene 通过在磁盘上以纯文本形式存储敏感信息的倒排索引来提供快速搜索,因此需要对这些索引文件进行加密,以便未经授权的人无法通过绕过它们来访问它们系统的安全性。

我发现在 Apache JIRA 上打开了类似的补丁 AES encrypted directory and Codec for index-level encryption

AES 加密目录看起来很有希望,但是这个补丁已经为 lucene 3.1 实现了,因为我使用的是较新的版本,我不确定这个补丁是否可以与 lucene 版本 5 或更高版本一起使用。

我想知道是否有一种方法可以实施加密索引的安全措施,或者是否可以编写一些自定义插件来 encrypt/decrypt I/O 级别的索引(即FsDirectory)?

LUCENE-6966 you have shared is really interesting. I would reason with this quote of Robert Muir 评论部分的讨论认为 Solr 中没有任何东西,而且可能永远不会。

More importantly, with file-level encryption, data would reside in an unencrypted form in memory which is not acceptable to our security team and, therefore, a non-starter for us.

这很能说明问题。你应该解雇你的安全团队!你在浪费时间担心这个:如果你使用 lucene,你的数据将以明文形式以你无法控制的方式存储在内存中,对此你无能为力!

试图保证比“休息”更好的任何事情是严肃的事情,听起来你的团队已经超出了他们的头脑。

因此您应该考虑加密 Solr 在 OS 级别上使用的存储。这对于 Solr 应该是透明的。但是如果有人进入你的系统,他应该无法复制Solr数据。

这也是Lucidwors的Erick Erickson的文章Encrypting Solr/Lucene indexes最后得出的结论

The short form is that this is one of those ideas that doesn't stand up to scrutiny. If you're concerned about security at this level, it's probably best to consider other options, from securing your communications channels to using an encrypting file system to physically divorcing your system from public networks. Of course, you should never, ever, let your working Solr installation be accessible directly from the outside world, just consider the following: http://server:port/solr/update?stream.body=<delete><query>*:*</query></delete>!