Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: does the plugin support OCI Resource Principal? #11

Open
veny opened this issue Jun 10, 2021 · 0 comments
Open

Question: does the plugin support OCI Resource Principal? #11

veny opened this issue Jun 10, 2021 · 0 comments

Comments

@veny
Copy link

veny commented Jun 10, 2021

Vault version: 1.3.2
Underlying OS: Oracle Linux 7.9

I am able to authenticate against Vault from an OCI VM with use of Instance Principle. my setup follows this guideline and it works:

Then I changed my Dynamic Group definition to an OCI resource like this:

Any {resource.compartment.id = 'ocid1.compartment.oc1..aaaaaaaarqa72sgaavyXXXXXXXXXXXX7kdlg2t6a'}

and I started exactly the same Python code previously working on a VM with Instance Principal as a ML Job having a Resource Principle:

#signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner()
signer = oci.auth.signers.get_resource_principals_signer()
endpoint = "http://hostname:8200/v1/auth/oci/login/devrole"
response = requests.get(endpoint, auth=signer)
date = response.request.headers['date']
authorization = response.request.headers['authorization']
body = {
    "request_headers":{
        "Date":[date],
        "(request-target)":["get /v1/auth/oci/login/devrole"],
        "host":["hostname:8200"],
        "Content-Type":["application/json"],
        "Authorization":[authorization]
    }
}
response = requests.put(endpoint, json=body) # fails with 401

the first GET request delivers signature like this:

Signature algorithm=\"rsa-sha256\",headers=\"date (request-target) host\",keyId=\"ST$eyJraWQiOiJhc3d...SHORTENED...96lXYVCf+qAvHkFJw23JYovm6w==\",version=\"1\"

and in the PUT request I get 401 Unauthorized.

Does the plugin work also with Resource Principal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant