OCI CCF - Incorrect PEM file and passphrase processing
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 3.8k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 125
Description
**Describe the bug**
The OCI CCF Connector does not correctly process and validate the PEM file content and Passphrase.
If a Passphrase protected PEM file is provided with the correct passphrase, the following error occured:
`Error: BadRequest",
Message: Connectivity check failed. ConnectorId: oracle-cloud-infra-connector9c2e944b-3a43-4003-a872-8353f816076c, Status code:OCI40006, Message:An unknown exception occurred.`
If you provide a non protected PEM file without entering a passphrase in the UI (which is stated as optional by description), the following error occured:
`Triggered new deployment failed - {"status":"Failed","error":{"stack":"BatchResponseItemError: Deployment template validation failed: 'The provided value for the template parameter 'passPhrase' is not valid. Length of the value should be greater than or equal to '1'. Please see https://aka.ms/arm-syntax-parameters for usage details.'`
However, the OCI Connector conects successfully if you provided a non protected PEM file and a random string in the passphrase field.
**To Reproduce**
1. Open Sentinel Data Connectors
2. Search for Oracle Cloud Infrastructure (via Codeless Connector Framework) and open the Connector Page
3. Enter the needed OCI Connector configuration like Stream OCID. Tenant ID, UserID etc.
3.1 Provide the content of a passphrase protected PEM file and a Passphrase and click on connect
3.2 Provide the content of a non protected PEM file, leave the Passphrase field empty and click on connect
3.3 Provide the content of a non protected PEM file, enter a random Passphrase and click on connect
**Expected behavior**
1. The OCI Connector should connect successfully with a passphrase protected PEM file and the correct passphrase
2. The OCI Connector should connect successfully with a non protected PEM file and an empty passphrase field
**Screenshots**
**Desktop:**
- OS: Windows 11 Enterprise
- Browser: Microsoft Edge
- Version: 150.0.4078.48
**Additional context:**
We have validate the correctness of the PEM file and the passphrase with openssl:
`
openssl rsa -in sentinel_oci_key.pem -check -noout 2>&1 | head -5; echo "---"; openssl rsa -in sentinel_oci_key.pem -text -noout 2>&1 | head -3
Enter pass phrase for sentinel_oci_key.pem:
RSA key ok
---
Enter pass phrase for sentinel_oci_key.pem:
Private-Key: (4096 bit, 2 primes)
modulus:
00:a1:dd:63:3....
`
PEM Content:
`-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,[...]
rVfZ1EaMuGGxP
-----END RSA PRIVATE KEY-----
`
Contributor guide
Assessment
This issue has not been assessed yet.