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

files: added x509 authentication to EOS offload. #718

Merged

Conversation

alejandromumo
Copy link
Member

@alejandromumo alejandromumo commented Feb 13, 2024

closes https://github.com/zenodo/ops/issues/322

I added docs on how to replace the certificate.

This was tested in zenodo-rdm-qa, inside a pod. I added the configmap to the worker deployment and mounted the certificates. The test was run in an invenio shell, using a requests.Session.get request to retrieve a file from eosmedia and it worked.

Deployment

⚠️ even though the changes are behind a configuration, please align with me before this is deployed

In Openshift, set the following variables (we need to create the deployment config first INVENIO_ZENODO_EOS_* so they are added to the application):

INVENIO_ZENODO_EOS_OFFLOAD_AUTH_X509 = True 
INVENIO_ZENODO_EOS_OFFLOAD_X509_CERT_PATH = "/etc/certificates/cert.pem"
INVENIO_ZENODO_EOS_OFFLOAD_X509_KEY_PATH = "/etc/certificates/key.pem"
INVENIO_ZENODO_EOS_OFFLOAD_HTTPHOST = "https://eosmedia.cern.ch:8444"

To create the config map and the volume in openshift:

# Create configmap
oc create configmap service-certificates --from-literal=key.pem=""  --from-literal=cert.pem=""

# Create volume in "worker" and "web" deployments
oc set volume deployment/worker --add  --name=service-certificates --type=configmap  --mount-path=/etc/certificates  --configmap-name=service-certificates
oc set volume deployment/web --add  --name=service-certificates --type=configmap  --mount-path=/etc/certificates  --configmap-name=service-certificates

Then add the certificate and key as detailed here

@alejandromumo alejandromumo requested a review from slint February 13, 2024 16:25
@alejandromumo alejandromumo merged commit a82821a into zenodo:master Feb 14, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants