Skip to content

Add: Add docker-client-tls-login action for client certificate authentication#1470

Draft
easamoah7 wants to merge 18 commits intomainfrom
DEVOPS-1709_docker_tls_login
Draft

Add: Add docker-client-tls-login action for client certificate authentication#1470
easamoah7 wants to merge 18 commits intomainfrom
DEVOPS-1709_docker_tls_login

Conversation

@easamoah7
Copy link
Contributor

@easamoah7 easamoah7 commented Sep 22, 2025

What

Add new docker-tls-login action that configures Docker with client TLS certificates for mutual authentication with Docker registries.

Why

The standard docker/login-action doesn't support client TLS certificate authentication required for external access to packages.greenbone.net.

References

Checklist

  • Tests - Validated in GitHub Actions environment
  • Documentation - Complete README with examples

@github-actions
Copy link

github-actions bot commented Sep 22, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA d28af6c.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@github-actions
Copy link

github-actions bot commented Sep 22, 2025

Conventional Commits Report

Type Number
Bug Fixes 2
Added 9

🚀 Conventional commits found.

Comment on lines 95 to 99
- name: Cleanup certificates (if logout enabled)
if: inputs.logout == 'true'
shell: bash
run: |
[[ -n "${CERT_DIR:-}" && -d "$CERT_DIR" ]] && rm -rf "$CERT_DIR"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we would store the certs directly into the docker config folder, do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pascalholthaus @easamoah7 do we store the tls certificates directly in the docker config folder? how do we get them into that folder?
In my humble understanding, we setup the TLS-Certificates like we setup an SSH-Key or GPG-Key, we pass the Certificate via GitHub Secrets into the action.
Maybe we additionally add support for runner hosted TLS-Certificates, but as open-source, this should be as generic as possible.

If we use these as secret variables this should reduce the bash code for this action, too.

@pascalholthaus
Copy link
Contributor

Can we test this in https://github.com/greenbone/pipeline-experiments ?

shell: bash
run: |
# Setup certificate directory
REGISTRY_URL="${{ inputs.registry-url }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I understand here is just a plain hostname required, and this wont work with an actual URL (https://my-registry.com/path-to-registry) , so I think it's better to name the variable and the workflow input parameter accordingly to avoid misunderstanding and wrong usage

run: |
# Setup certificate directory
REGISTRY_URL="${{ inputs.registry-url }}"
CERT_DIR="$HOME/.docker/certs.d/$REGISTRY_URL"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this has already been tried, but on my machine and @y0urself 's mac it worked well when we added these in /etc/docker/certs.d/HOSTNAME/*
so maybe we should keep working with that known good place.

If that works but we later want to rather have it in $HOME, we can try that too, but safe way is /etc for now

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.

4 participants