Add OCI detection via IMDS metadata server - #30
Merged
kshivakumar merged 1 commit intoJul 19, 2026
Conversation
shimonelfassy-lang
force-pushed
the
add-oci-imds-detection
branch
from
July 2, 2026 09:06
b8a9bbf to
13d8944
Compare
kshivakumar
reviewed
Jul 9, 2026
Contributor
Author
|
Hi @dgzlopes 👋 Just a heads-up on the red CI here — the failures don't seem related to this change:
Is there anything blocking this from being merged? Glad to address any feedback. |
Collaborator
|
@shimonelfassy-lang I will set the minimum Python version as 3.9 since older versions are way past EOL. I will raise a PR in a day or two and rebase yours. |
Collaborator
|
@shimonelfassy-lang I can't rebase since the branch doesn't exist in this repo. Please rebase your PR (there will be small conflicts) |
OCIProvider now queries the OCI instance metadata service in addition to the DMI vendor file, mirroring the AWS/GCP/Alibaba providers. It GETs the IMDS endpoint (v2 with the `Authorization: Bearer Oracle` header, and the v1 fallback) and confirms the instance `id` starts with `ocid1.instance.`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Shimon Elfassy <shimon.elfassy@sweet.security>
shimonelfassy-lang
force-pushed
the
add-oci-imds-detection
branch
from
July 19, 2026 09:35
13d8944 to
48c2f67
Compare
Contributor
Author
|
Hi,
Thanks for the reply.
I rebased and pushed.
Can you take a look?
…On Sun, Jul 19, 2026 at 9:20 AM Shiva Kumar K ***@***.***> wrote:
*kshivakumar* left a comment (dgzlopes/cloud-detect#30)
<#30 (comment)>
@shimonelfassy-lang <https://github.com/shimonelfassy-lang> I can't
rebase since the branch doesn't exist in this repo. Please rebase your PR
(there will be small conflicts)
—
Reply to this email directly, view it on GitHub
<#30?email_source=notifications&email_token=CEQ7ISNB27FOKLR7IJW6EMD5FRSETA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBRGQ3DQNBUGEZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5014684413>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CEQ7ISMIXYDSFEEDWIVU4OT5FRSETAVCNFSNUABFKJSXA33TNF2G64TZHMZDAMBSGE4DQNRXHNEXG43VMU5TINZZGI4TANJXHAZ2C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CEQ7ISMK2EISZTSQLEKQNBT5FRSETA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBRGQ3DQNBUGEZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/CEQ7ISJM5QYWNF734R7L7HL5FRSETA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBRGQ3DQNBUGEZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
--
Shimon Elfassy
Senior Software Engineer
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OCI detection via IMDS metadata server
OCIProviderpreviously only detected Oracle Cloud via the DMI vendor file(
/sys/class/dmi/id/chassis_asset_tag) and raisedNotImplementedErrorfor themetadata server. This adds metadata-server detection so OCI is identified the
same way as the AWS/GCP/Alibaba providers.
What it does
identify()now runscheck_vendor_file() or await check_metadata_server()._get_metadata/_get_metadata_v2structure:_get_metadata()— GETs the v1 endpoint (http://169.254.169.254/opc/v1/instance/)._get_metadata_v2()— delegates to_get_metadataagainst the v2 endpoint(
.../opc/v2/instance/) with the requiredAuthorization: Bearer Oracleheader.asyncio.gather;check_metadata_server()returnsany(...).169.254.169.254link-local IP) by checking the returned instance
idstarts withocid1.instance..Tests
test_valid_metadata_server_checkandtest_invalid_metadata_server_checkusing
aresponses, mirroring the AWS metadata tests.flake8 --max-line-length 100clean.