简体   繁体   English

用于安全性的 Oracle 增量校验和加密

[英]Oracle Incremental Checksum Crypto for Security

I have a unique problem to solve.我有一个独特的问题要解决。 I have a legacy java application which connects to an Oracle RDBMS.我有一个连接到 Oracle RDBMS 的旧 Java 应用程序。 There are all sorts of queries and DMLs scattered over in the application - Inserts, Update, Delete and of course selects.应用程序中散布着各种查询和 DML - 插入、更新、删除,当然还有选择。 It uses JBC ( Preparedstatement ), though one recently added lodule uses JPA.它使用 JBC( Preparedstatement ),尽管最近添加的一个 lodule 使用 JPA。

I have a requirement to add a protection layer / logic to the application / Database whereby if any user (could even be A DBA or an OS root user) tries to modify the data (updates, inserts or deletes) bypassing the app, we are able to identify the operation as part of an audit.我需要向应用程序/数据库添加保护层/逻辑,如果任何用户(甚至可能是 DBA 或操作系统 root 用户)试图绕过应用程序修改数据(更新、插入或删除),我们能够将操作识别为审计的一部分。

Audit trail seemed to be the go to thing here, except that we cannot even trust the OS root user and thus a guy having DBA and root access can easily modify the data and remove the trace of it in the audit trails.审计跟踪似乎是这里要做的事情,除了我们甚至不能信任操作系统 root 用户,因此拥有 DBA 和 root 访问权限的人可以轻松修改数据并删除审计跟踪中的数据。

I was thinking to implement a cyclic crypto kind of algorithm on the sensitive tables so that on every DML executed by the application, a crypto / hash is introduced and it is incremental so that any change is easily caught by doing an audit using the application.我正在考虑在敏感表上实现一种循环加密算法,以便在应用程序执行的每个 DML 上,引入加密/散列并且它是增量的,以便通过使用应用程序进行审计可以轻松捕获任何更改。

In theory, it seems feasible except that it might get tricky because after every DML we would potentially need to recalculate the hash / checksum of a number of subsequent records and this might overburden the application / database.从理论上讲,这似乎是可行的,只是它可能会变得棘手,因为在每个 DML 之后,我们可能需要重新计算许多后续记录的哈希/校验和,这可能会使应用程序/数据库负担过重。

Is this a feasible solution?这是一个可行的解决方案吗?

You are right that computing a hash of every updated row of data will impose a burden on the system.你是对的,计算每个更新的数据行的哈希值会给系统带来负担。 Are you going to also validate that hash before changes are submitted to the database to ensure nothing has been changed outside the application?您是否还要在将更改提交到数据库之前验证该哈希值,以确保应用程序之外没有任何更改? That's even more overhead, and a lot more custom code for your application.这甚至是更多的开销,并且为您的应用程序提供了更多的自定义代码。 It also wouldn't help you identify who modified the data, or when, only that it had been updated outside of the app.它也无法帮助您确定谁修改了数据,或者何时修改了数据,只能确定它是在应用程序之外更新的。 Using a database trigger wouldn't work, as they are easily disabled and aren't capable of modifying the same table that calls them (you'd need a separate hash table with an entry for every row of data in every table you wanted to monitor).使用数据库触发器是行不通的,因为它们很容易被禁用,并且无法修改调用它们的同一个表(您需要一个单独的哈希表,其中每个表中的每一行数据都有一个条目)监视器)。 Auditing is still your best way to go, as it wouldn't require any modification to your app or your data schemas.审计仍然是您最好的方式,因为它不需要对您的应用程序或数据架构进行任何修改。

You have a couple of options in regards to auditing, depending on the version of Oracle you're using.您有几个关于审计的选项,具体取决于您使用的 Oracle 版本。 If you're using 12c or later, you can use Unified Auditing, which has its own set of permissions and roles to allow separation of duties (ie normal DBA from security admin).如果您使用的是 12c 或更高版本,您可以使用统一审计,它有自己的一组权限和角色来允许职责分离(即普通 DBA 与安全管理员)。 Even in older versions you can put an update/delete audit on the actual audit trail table, so that any attempt to modify the data will itself leave a fingerprint.即使在旧版本中,您也可以对实际的审计跟踪表进行更新/删除审计,这样任何修改数据的尝试都会留下指纹。

Lastly, you can use a tool like Splunk, Elastic Search, syslog, or Oracle's Database Audit Vault or some other file monitoring solution to centralize your audit records to another system as they are created by the database - making them inaccessible to the DBA or local sys admin.最后,您可以使用 Splunk、Elastic Search、syslog 或 Oracle 的 Database Audit Vault 或其他一些文件监控解决方案等工具将您的审计记录集中到另一个系统,因为它们是由数据库创建的 - 使 DBA 或本地无法访问它们系统管理员。 This will take some work by your DBA and/or sysadmin to configure in the first place, but can go a long way to securing your audit data.这首先需要您的 DBA 和/或系统管理员进行一些配置工作,但对保护您的审计数据大有帮助。

All that said, sooner or later you're going to have to trust two people: the sys admin and the DBA.说了这么多,迟早你将不得不信任两个人:在系统管理员和DBA。 If you can't trust them then you are in deep, deep trouble.如果你不能信任他们,那么你就陷入了深深的麻烦之中。

Oracle 20c has blockchain tables . Oracle 20c 有区块链表 Version 20c is currently only available in Oracle's cloud, but it will probably be available on-premise in a few months.版本 20c 目前仅在 Oracle 的云中可用,但它可能会在几个月内在本地可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:oracle.security.crypto.asn1.ASN1FormatException:得到标记0而不是16 - Error: oracle.security.crypto.asn1.ASN1FormatException: Got tag 0 instead of 16 oracle.security.crypto.asn1.ASN1FormatException:得到标签 7830 而不是 16。在容器中运行时 - oracle.security.crypto.asn1.ASN1FormatException: Got tag 7830 instead of 16. when running in container oracle.security.crypto.core.CipherException:无效的填充字符串(或错误的密码) - oracle.security.crypto.core.CipherException: Invalid padding string (or incorrect password) Spring Security / SPNEGO身份验证问题:校验和失败 - Spring Security/SPNEGO authentication issue: Checksum failed Spring Security Kerberos + AD,校验和失败 - Spring Security Kerberos + AD, Checksum Fail (Spring Security加密模块)加密数据搜索 - (Spring Security Crypto Module) encrypted data Search Spring Security Crypto最终块没有正确填充 - Spring Security Crypto final block not properly padded Oracle安全服务器errpr - Oracle security server errpr 使用Oracle的Spring Security UserDetails - Spring Security UserDetails with Oracle 无法创建加密类org.apache.ws.security.components.crypto.Merlin - Cannot create Crypto class org.apache.ws.security.components.crypto.Merlin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM