What is Ballerina?
The OCI-Ballerina GitHub module:
The GitHub module provides the language to interact with OCI resources for a seamless native cloud application development process. The module would enable a user to efficiently provision and manage infrastructure resources on OCI. For example, a user might write business logic code or configuration code (e.g. provisioning scripts).
Risk Events Service from Oracle CASB
The Oracle Cloud Access Security Broker gives visibility into the entire cloud stack and acts as the security automation tool for the IT needs. For more details, check the details here. There are different modules like threat detection, predictivity analytics, and Security configuration available in CASB. In this example, we will take advantage of CASB’s risk events API to get the risk event data for the cloud tenancy. We will save this data to OCI Object Storage, which then could be leveraged to integrate with any other security and monitoring systems like Splunk, QRadar, or Oracle Management Cloud.
Once the module is downloaded from the GitHub, we need to configure the tenancy details as mentioned below. Once configured and tested, we can create an ociClient object to interact with OCI.
Image – Prerequisites to interact with OCI
Once we acquire the risk event data in JSON format, we can take the advantage of the native JSON to CSV file (shown below) converter available in the Ballerina language, to upload the file to object storage.
Image: JSON to CSV converter built in the language
Image: CSV file uploaded to OCI object storage
To create a micro-service that fetches risk event data from Oracle CASB, we took advantage of the GitHub module for OCI-Ballerina interaction. We obtained the risk events data in a JSON format, converted into a CSV file, and uploaded it to the OCI object storage. The GitHub module also allows a user to interact with other OCI resources to develop and deploy on OCI.