Oracle Cloud Infrastructure - Terraform Setup
If you wish to set up the integration manually, return to the Get Started with Oracle Cloud Infrastructure page and choose your manual setup option.
We use Terraform to automate the OCI functions. The Terraform script provisions the central resources in the home region, as well as all necessary regional resources to allow the forwarding of logs to the central bucket.
Scope and Limitations
We have set the retention lock in the automation to 15 days (360h), because Terraform runs so fast that minor clock differences between your system and OCI's servers can cause a 14-day request to be rejected (OCI requires retention locks to be set at least 14 days in the future). Manual setup is slow enough that this is not an issue.
This automation supports complete rollback/teardown, however the central bucket and docker image cannot be removed via Terraform due to known limitations within OCI.
If you need to perform a rollback (such as to retry the setup process), make sure to use the
./deploy.sh rollbackcommand to do so. This ensures all resources are removed in a way that does not create a conflict if you re-create resources of the same name.The central bucket must be removed manually, unless you wish to use a different bucket name if/when you retry the setup.
The compartment can be removed via Terraform, but we recommend you remove it manually because compartment deletion may take several minutes to hours if done via Terraform.
We do not recommend you remove the docker image.
Prerequisites
Make sure there is a user from your organization with Admin-level cloud access to the relevant cloud environment.
The account you use could be your own OCI account, or it could be an administrator account.
Make sure you have an email address from your organization that can be used to associate with the Expel Machine User you will create.
This email will be used by you to generate the API credentials for Expel.
You should choose an organizational email you can access, like a shared security team mailbox or your work email.
Before You Begin
Locate all region identifiers for the regions you wish to onboard. You will need to specify these identifiers when you configure the automation resources.
Obtain the tenancy OCID and tenancy namespace for the OCI admin user (the one deploying the resources), which you will need when you configure the automation resources. You can find these values under Profile > Tenancy > Tenancy details (the namespace is labeled "Object storage namespace").
Step 1: Download the Automation Files
The expel_oci_automation.zip file contains the Terraform configurations, function code, and deployment scripts you need to complete this guide.
terraform/central
Terraform configuration
Creates central/global resources (run once per tenant).
terraform/regional
Terraform configuration
Creates regional resources (run once per region).
function/
Dockerfile, func.py, func.yaml, requirements.txt
Function code deployed to each region.
config.env
Configuration file
User-provided values for the automation.
deploy.sh
Deployment script
Executes the setup process.
Step 2: Configure the Automation Resources
In this step, you will unzip the files you downloaded in the previous step so that you can update the config.env file. After you have finished and saved that update, you must re-zip the folder so that it can be used by the automation script in a later step.
Unzip the file you downloaded in Step 1.
In the top-level expel_oci_automation folder, locate the config.env file and open it in the text editor of your choice.
First, update the OCIR_USERNAME with an OCI account that has permissions to create all required resources.
The account you use here could be your own OCI account, or it could be an administrator account.
For native users, use the format NAMESPACE/EMAIL. Example: idhl111labc/example.user@email.com
For federated users, use the format NAMESPACE/oracleidentitycloudservice/EMAIL. Example: idhl111labc/oracleidentitycloudservice/example.user@email.com
Update the remaining values:
TENANCY_OCID - enter your tenancy OCID. If you need help locating this value, see the Troubleshooting.
EXPEL_AUDIT_USER_EMAIL - enter the org email you want to use for the Expel Machine User.
EXPEL_AUDIT_USER_FIRST_NAME - enter "Expel".
EXPEL_AUDIT_USER_LAST_NAME - enter "User".
REGIONS - enter the region identifiers for the regions you wish to onboard, using a csv string (example: “us-ashburn-1,us-chicago-1,us-phoenix-1”). If you need help locating the correct identifiers, see the Troubleshooting.
Save and close the updated file.
Re-zip the updated expel_oci_automation folder (you will need to use this folder in .zip format when you run the automation script in a later step).
Step 3: Generate an Auth Token
An auth token is required in order to deploy the automation script later in this guide.
In the top right, select your username/email.

Select the Tokens and keys tab.
In the Auth tokens section, select Generate token.
Enter a description for the token, such as "Expel token".
Select Generate token.
Copy and save the generated token, as you will need it for a future step and it will not be available again.
Select Close.
Step 4: Upload the Automation File to OCI
You will use OCI's Cloud Shell to perform this step.
Make sure you are in your home region.
In the Developer Tools menu in the top right, select Cloud Shell. Wait for your machine to be created, and then continue to the next step.

In the top right of the Cloud Shell window, select Settings > Upload.

Drop or select the re-zipped, updated expel_oci_automation.zip file you configured in Step 2.
Select Upload.
Step 5: Deploy the Automation Script
Still in the Cloud Shell window, use the following command to unzip the file you just uploaded:
Switch to the file's directory:
Grant execution permissions to the deployment script:
Execute the deployment script:
When prompted, enter the auth token you generated in Step 3.
All global and central resources will now be created, along with the regional resources in the selected regions.
When the process has finished, copy and save the following two values:
Stream OCID (this will be the Stream ID in Workbench)
Stream Endpoint (this will be the Stream endpoint in Workbench)

Step 6: Validate All Resources
Before continuing with the setup process, make sure all resources have been created and that there are no errors.
You may search for the resources in whatever way is easiest for you. For more details, see Inspecting Resources in the OCI documentation.
Search for each resource in the charts by name, as this is the name that was created by Terraform.
If you find any discrepancies or issues, follow the Troubleshooting steps to perform a correct rollback and try the setup process again or contact Support for help.
Step 7: Obtain the Expel Credentials
These credentials will be used when you configure the security device in Workbench.
Before you begin, make sure you have logged out of OCI and looked for the activation email from Oracle.
Step 1: Generate the Credentials
Log in to OCI with the Expel Machine User email address you specified in the automation resources. You should have already received an activation email from Oracle.
In the top right, select the username/email.

Select the Tokens and keys tab.
Select Add API key.
Choose the Generate API key pair option.
Download the private key. This file will download as a .pem file.
Select Add.
In the Configuration file preview, use the Copy button to quickly copy and save the following values:
User (this will be the OCI user in Workbench)
Fingerprint (this will be the OCI key fingerprint in Workbench)
Tenancy (this will be the OCI user tenancy in Workbench)
Region (this will be the OCI region in Workbench)

Step 2: Base64 Encode the API Key
You must now format your private API key as a base64-encoded string, and save the output. This string is what you will use for the API key when you configure the security device in Workbench.
For security reasons, we do NOT recommend using an online Base64 encoding website.
Open PowerShell.
Run the following command (drag your .pem file into the window after entering the first part):
Copy and save the output as your base64-encoded API key.
Open Terminal.
Run the following command (drag your .pem file into the window after entering the first part):
Copy and save the output as your base64-encoded API key.
You may delete the .pem file after you have successfully set up the security device in Workbench. Please retain it until then. If you need to verify that your API key was encoded correctly, see the Troubleshooting.
Step 8: Add Oracle Cloud Infrastructure as a Security Device in Workbench
In the side menu, navigate to Organization Settings > Security Devices. If you have multiple organizations, you must select the appropriate organization name from the list.
Select Add Security Device.
In the search box, type “Oracle” and then select the Oracle Cloud Infrastructure integration.
Complete the fields as follows:
Name - enter a name that might help you more easily identify this integration, such as “CompanyName OCI”; this name will display in Workbench under the Name column, and is a text string that you can filter on.
Location - enter the location of your integration, for example “cloud;” this is also a text string that you can filter on, so we recommend being consistent with location naming across your Expel integrations.
Stream ID - enter the stream ID you saved in Step 5.
Stream endpoint - enter the stream endpoint you saved in Step 5.
OCI user - enter the user value from the configuration file you saved in Step 7.
OCI key fingerprint - enter the fingerprint value from the configuration file you saved in Step 7.
OCI user tenancy - enter the tenancy value from the configuration file you saved in Step 7.
OCI region - enter the region identifier from the configuration file you saved in Step 7.
OCI user key - enter the base64-encoded string for the private API key, which you created in Step 7.
Select Save.
Select No thanks, I will not provide console access from the console access dropdown.
Your device should be created successfully within a few seconds. A few reminders:
After your connection is healthy, it will take some time for your device to begin polling and receiving data.
To check on the status, select the downward arrow for your device in the first column and choose View details.
Polling will happen first; data will be received after that. You must refresh the page to see updates.
If your device does not begin polling within 15 minutes, and does not begin receiving data within 30 minutes, contact our support team for help.
To check if alerts are coming through, navigate to Dashboards > Alert Analysis. Scroll to the device you want to check, and select the Expel Alerts tab to reveal more alert information. It can take 36 to 72 hours for alerts to appear after setup, as we tune your device.
Troubleshooting
Device Connection Issues
Region Identifier
When you set up the region-specific policy, you must use the correct region identifier. To determine the region identifier:
In the upper right, select Manage regions.

Locate your region to find its region identifier.

Tenancy OCID
You can find the tenancy OCID under Profile > Tenancy > Tenancy details.
Tenancy Namespace
You can find it on the same page as the Tenancy OCID, labeled as Object storage namespace.

Base64 Encoding
To verify your API key, you can decode your Base64 string and make sure the key matches the one in your .pem file.
Open PowerShell and run:
Open Terminal and run:
Last updated
Was this helpful?

