Immutable z/OS data with immudb: lightweight on big iron

A huge percentage of the world’s most valuable data is processed on IBM mainframes. Mainframes are designed with reliability and security in mind since day one. Many libraries on mainframes should only be changed through a trusted pipeline. Tampering central and highly critical programs on a mainframe infrastructure of an organization would be a strike at the heart. Attacks like Sunburst showed that cyber-criminals act opportunistic and are able to create huge damage by tampering software. Hackers won’t stop at system frontiers but instead, look for a weak spot. Sometimes even mainframes get in their focus although known for being a highly secured platform. One example for that has been the Logica-Nordea mainframe hack. Next to cyber-security threats orchestrated by state-funded hacker organizations is the possibility of a malicious insider attack by actors like employees. Although this scenario is not very common the consequences would be equally devastating.

Immudb is an open-source, lightweight, high-speed immutable database with built-in cryptographic proof and verification. It can run on almost every architecture and you can track changes in sensitive data in your transactional databases and then record those changes permanently in a tamperproof immudb database. This allows you to keep an indelible history of sensitive data, for example, debit/credit card transactions or datasets and it’s members. Traditional DB transactions and logs are hard to scale and are mutable. So there is no way to know for sure if your data has been compromised. As such, immudb provides unparalleled insights retroactively of changes to your sensitive data, even if your perimeter has been compromised. immudb guarantees immutability by using cryptographic data structures internally.

Immudb architecture on IBM Z

Immudb is lightweight and at the same time delivering unprecedented performance. Every Hardware-Architecture that is supported by golang will be able to run immudb. S390X is the Architecture of IBM Z and it is fully supported. The immudb server should run in a different and protected environment. LPAR partitioning on IBM Z is EAL5 certified therefore offering a high level of protection. Of course, immudb is also able to run next to a mainframe on distributed systems.

We propose running immudb on Linux on Z on a different LPAR communicating with z/OS over in-memory HiperSockets reducing overhead and latency. Immugw is a middleware that provides a REST-API for immudb. The API can be consumed by z/OS through various programming languages and scripts. Take a look at rocket software’s open source tools for z/OS to expand your scope with tools like cURL.

Another very lean option is to use our SDKs. Z/OS is supporting three languages with already existing SDKs: Java, Python and Nodejs. The SDKs are relying on the very fast and efficient gRPC (gRPC Remote Procedure Calls) protocol based on HTTP/2 and protocol buffers.

Immudb and immugw can be deployed on Linux on Z without a hassle. Git clone the repositories and install golang. Switch to the repositories directory and type: make all. Start up ./immudb and ./immugw. Done.

Application design

One challenge of running highly critical systems is to ensure that no one tampered production software, as described above. Let’s start with a basic example, a developer pushed code into a protected library. Now he wants to notarize that member using immudb. He can do so by using a batch job that has the following steps:

  • Step 1: pull the original signing program or script and verify it
  • Step 2: generate checksum of his source code and set it in immudb

Now a build-job would look almost the same. First, the source will be verified. With immudb it is also possible to look up the history. An object with an unclear history wouldn’t be able to get into production.Each stakeholder (machine or developer) of the process can notarize and authenticate objects, therefore adding trust to the process. The program can then be build from the trusted source and the resulting load module has to be notarized.


In this blog we are showing how to communicate with immudb/immugw by using java on IBM Z. Java is a good candidate because it works in every environment even in Db2 as a stored procedure. It is even possible to backup data of DB2 tables on change. More about that later.

Our Java program can be run as a step in JCL Jobs (for example: build jobs or jobs that are altering). The target dataset can be set as a variable in JCL and passed to the java program.

//SYSPRINT DD SYSOUT=*                   <System stdout
//SYSOUT   DD SYSOUT=*                  <System stderr 
//STDOUT   DD SYSOUT=*                  <Java System.out 
//STDERR   DD SYSOUT=*                  <Java System.err 
//*The following DDs can/should be present in the calling JCL
//*STDIN   DD                       <OPTIONAL - Java
//*STDENV  DD                         <REQUIRED - JVM Environment script
//*MAINARGS DD                          <Preferred method to supply args

The code snippet below is showing a clean way of doing HTTP-API calls with only using HttpURLConnection. That way you will not face missing dependencies in different runtime locations. The function postRequest needs to be provided with the URL of immugw and a JSON-string. The JSON-string will be converted to bytes and posted. The response is being returned.


public class Main {

    public static String postRequest(String urlStr, String jsonBodyStr, String authorization) throws IOException {
        URL url = new URL(urlStr);
        HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
        httpURLConnection.setRequestProperty("Content-Type", "application/json");
        if (authorization != ""){
            httpURLConnection.setRequestProperty("Authorization", authorization);
        try (OutputStream outputStream = httpURLConnection.getOutputStream()) {
        if (httpURLConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
            try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()))) {
                String line;
                while ((line = bufferedReader.readLine()) != null) {
                    return line;
        return "Error code: "+Integer.toString(httpURLConnection.getResponseCode());

The first request will be the login request. The Api returns a token that will be used as authorization string later on.

        String URLString = "http://LINUXONZ:3323/v1/immurestproxy/login";
        //jsonInputString for default credentials, note b64 encoded
        String jsonInputString = "{"user": "aW1tdWRi", "password": "aW1tdWRi"}";
        String response = postRequest(URLString,jsonInputString,"");

Read in the file for creating the checksum. Use JZOS ( and a hash-function of your favor. It is recommended to use IBM Z’s extensive crypto-hardware support (for example for hash functions) like IBMJCECCA. Set the dataset name and its hash value in immudb. Look into our immugw blog to read more about using the immugw api.

         String ddname = ZFile.allocDummyDDName();
         String cmd = "alloc fi("+ddname+") da(HLQ.MYDATA) reuse shr msg(2)";
         RecordReader reader = null;
         try {
           reader = RecordReader.newReaderForDD(ddname);
           byte[] recordBuf = new byte[reader.getLrecl()];
           while ((bytesRead = >= 0) {

Getting checksums of datasets on change event

With z/OS it is possible to detect changes of datasets. There are two ways of doing that. Either write a started task and listen to the SMF realtime api (SMF15) or monitor a module that gets loaded by CLOSE via CSVEXIT. Intercepting the CLOSE SVC is a delicate job but possible. Then use the name of the changed dataset create a hash and set it in immudb. That way you can track changes of datasets immutably and tamperproof.

Overcoming EBCDIC and ASCII conversion challenges

Objects will change their checksum when they are converted from EBCDIC to ASCII and the other way around. Many code signing solutions will lose track of the object. Immudb is capable of storing JSON-Objects as value. Metadata can be added to an object including the ASCII/EBCDIC checksum of the object or many other information.

  "ascii.checksum" : "d7e4d83a94d161837aa4038cbaf9708b2bb2d91675a20493a982ce4b17d8012e"
  "ebcdic.checksum": "cffeab52f4f186936e3697bf1c69a6ec72d298ff94e0b40d603f453285707e2e"

Immutability for DB2

A possible cyber-attack could focus on databases. Bad actors could gain access to databases by using SQL injections or other methods. They then use their access levels to encrypt whatever they get their hands on. Immudb can keep up with the fastest databases and back up their data. Read more about that in our randomware blog. Keep in mind: immudb has to be run in a different protected environment. Now, even if immudb writes encrypted values, it still has the history of the record that can not be touched.

This is how it works: triggers in Db2 will notify about changes of tables. Set an alter trigger and execute a stored procedure to store the new data of the table in immudb. Push the java code to Db2 and create the stored procedure. After that, it is callable by SQL. When the trigger is called, set the parameters and call javaproc. Use the OUT STATUS variable to report the HTTP-Code.

                           IN COLUMN CHAR(99),
                           IN KEY(99),
                           OUT STATUS INTEGER)
   EXTERNAL NAME 'DS_20180823161823:com.userid.JAVAPROC.x_JAVAPROC'

Call the stored procedure with SQL:


Immudbs performance can keep up with high-speed databases. Add immutability to your database, not just by offline tape.

Innovative software for your future proof hardware

The hardware of IBM Z is suited very well for the crypto technologies of the future. Get the best of both worlds Linux and z/OS and make your system immutable. Back up critical data or secure your build process. Proof immutability for your transaction-logs. Or maybe you already have a use-case in mind we didn’t even think about yet.



Open Source and easy to use in new applications and easy to integrate into existing application.

Subscribe to Our Newsletter

Get the latest product updates, company news, and special offers delivered right to your inbox.

Subscribe to our newsletter

Use Case - Tamper-resistant Clinical Trials


Blockchain PoCs were unsuccessful due to complexity and lack of developers.

Still the goal of data immutability as well as client verification is a crucial. Furthermore, the system needs to be easy to use and operate (allowing backup, maintenance windows aso.).


immudb is running in different datacenters across the globe. All clinical trial information is stored in immudb either as transactions or the pdf documents as a whole.

Having that single source of truth with versioned, timestamped, and cryptographically verifiable records, enables a whole new way of transparency and trust.

Use Case - Finance


Store the source data, the decision and the rule base for financial support from governments timestamped, verifiable.

A very important functionality is the ability to compare the historic decision (based on the past rulebase) with the rulebase at a different date. Fully cryptographic verifiable Time Travel queries are required to be able to achieve that comparison.


While the source data, rulebase and the documented decision are stored in verifiable Blobs in immudb, the transaction is stored using the relational layer of immudb.

That allows the use of immudb’s time travel capabilities to retrieve verified historic data and recalculate with the most recent rulebase.

Use Case - eCommerce and NFT marketplace


No matter if it’s an eCommerce platform or NFT marketplace, the goals are similar:

  • High amount of transactions (potentially millions a second)
  • Ability to read and write multiple records within one transaction
  • prevent overwrite or updates on transactions
  • comply with regulations (PCI, GDPR, …)


immudb is typically scaled out using Hyperscaler (i. e. AWS, Google Cloud, Microsoft Azure) distributed across the Globe. Auditors are also distributed to track the verification proof over time. Additionally, the shop or marketplace applications store immudb cryptographic state information. That high level of integrity and tamper-evidence while maintaining a very high transaction speed is key for companies to chose immudb.

Use Case - IoT Sensor Data


IoT sensor data received by devices collecting environment data needs to be stored locally in a cryptographically verifiable manner until the data is transferred to a central datacenter. The data integrity needs to be verifiable at any given point in time and while in transit.


immudb runs embedded on the IoT device itself and is consistently audited by external probes. The data transfer to audit is minimal and works even with minimum bandwidth and unreliable connections.

Whenever the IoT devices are connected to a high bandwidth, the data transfer happens to a data center (large immudb deployment) and the source and destination date integrity is fully verified.

Use Case - DevOps Evidence


CI/CD and application build logs need to be stored auditable and tamper-evident.
A very high Performance is required as the system should not slow down any build process.
Scalability is key as billions of artifacts are expected within the next years.
Next to a possibility of integrity validation, data needs to be retrievable by pipeline job id or digital asset checksum.


As part of the CI/CD audit functionality, data is stored within immudb using the Key/Value functionality. Key is either the CI/CD job id (i. e. Jenkins or GitLab) or the checksum of the resulting build or container image.

White Paper — Registration

We will also send you the research paper
via email.

CodeNotary — Webinar

White Paper — Registration

Please let us know where we can send the whitepaper on CodeNotary Trusted Software Supply Chain. 

Become a partner

Start Your Trial

Please enter contact information to receive an email with the virtual appliance download instructions.

Start Free Trial

Please enter contact information to receive an email with the free trial details.