This document outlines the process and results of configuring Docker authentication for GitLab CI/CD runners. The objective was to test various authentication scenarios across multiple groups, subgroups, and GitLab instances to ensure smooth authentication and pipeline execution.
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
## Initial Configuration
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
The following setup was implemented on the kistembd VM for GitLab runners:
## Add your files
* Docker authentication was set up within the [[runners]] configuration using the **DOCKER_AUTH_CONFIG** environment variable:
-[ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-[ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
* This configuration allowed the runner to authenticate and push/pull from Docker Hub using stored credentials.
-[ ] [Set up project integrations](https://git-ce.rwth-aachen.de/mbd/gitlab_runner_auth/-/settings/integrations)
**Objective:** Verify that a runner configured with a group token can push and pull images from multiple repositories within the same group.
## Collaborate with your team
**Setup:**
-[ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-[ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-[ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
* A runner was configured with a group token for mbd_outreach.
## Test and Deploy
* Pipelines were triggered for presentation-platform and presentation-platform-1.
Use the built-in continuous integration in GitLab.
**Result:** ✅ Passed. Both repositories successfully pushed and pulled images using the same runner and token.
-[ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
-[ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-[ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-[ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-[ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
**Test Case 2: Cross-Group Authentication**
***
**Objective:** Test authentication failure when using a token from Group 1 in a runner for Group 2.
# Editing this README
**Setup:**
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
* Group 1: mbd_outreach
## Suggestions for a good README
* Group 2: gitlab_credential_test
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
* A token from mbd_outreach was added to the runner for gitlab_credential_test.
## Name
Choose a self-explaining name for your project.
* A pipeline was triggered in gitlab_credential_test.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
**Result:** ❌ Failed. Authentication failed as expected since a token from mbd_outreach cannot authenticate in gitlab_credential_test.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
**Test Case 3: Subgroup Authentication Hierarchy**
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
**Objective:** Validate the inheritance and limitations of authentication tokens across subgroups.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
**Setup:**
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
* Group 1: mbd_outreach
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
* Subgroup 1: outreach_1 (Runner configured with token_outreach_1)
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
* Subgroup 2: outreach_2 (Runner only inherits the group runner if active)
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
**Results:**
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
✅ outreach_1 pipelines always succeeded.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
✅ outreach_2 pipelines succeeded only when the group runner for mbd_outreach was active.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
❌ If no active runner was present in mbd_outreach, outreach_2 pipeline failed.
## License
For open source projects, say how it is licensed.
**Test Case 4: Shared Runner Authentication**
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
**Objective:** Verify if two subgroups using the same runner and token can execute pipelines successfully.
**Setup:**
Both outreach_1 and outreach_2 inherited Runner 1, which was registered with token_outreach_1.
**Result:** ✅ Passed. Both subgroups successfully executed pipelines using the shared runner and token.
Test Case 5: Multi-GitLab Instance Authentication
**Objective:** Ensure runners on the same VM can authenticate to separate GitLab instances simultaneously.
**Setup:**
* Two GitLab instances: git and git-ce
* Group 1 (git): gitlab-credential-test, Runner1 with Group1 credentials
* Group 2 (git-ce): gitlab-credential-ce, Runner2 with Group2 credentials
* Pipelines triggered simultaneously in presentation (Repo1) and presentation-ce (Repo2)
**Result**:✅Passed. Both pipelines executed successfully without authentication conflicts.
This document outlines the process and results of configuring Docker authentication for GitLab CI/CD runners. The objective was to test various authentication scenarios across multiple groups, subgroups, and GitLab instances to ensure smooth authentication and pipeline execution.
Initial Configuration
The following setup was implemented on the kistembd VM for GitLab runners:
Docker authentication was set up within the [[runners]] configuration using the DOCKER_AUTH_CONFIG environment variable:
This configuration allowed the runner to authenticate and push/pull from Docker Hub using stored credentials.
Test Cases and Results
Test Case 1: Single Group Authentication
Objective: Verify that a runner configured with a group token can push and pull images from multiple repositories within the same group.
Setup:
A runner was configured with a group token for mbd_outreach.
Pipelines were triggered for presentation-platform and presentation-platform-1.
Result: ✅ Passed. Both repositories successfully pushed and pulled images using the same runner and token.
Test Case 2: Cross-Group Authentication
Objective: Test authentication failure when using a token from Group 1 in a runner for Group 2.
Setup:
Group 1: mbd_outreach
Group 2: gitlab_credential_test
A token from mbd_outreach was added to the runner for gitlab_credential_test.
A pipeline was triggered in gitlab_credential_test.
Result: ❌ Failed. Authentication failed as expected since a token from mbd_outreach cannot authenticate in gitlab_credential_test.
Test Case 3: Subgroup Authentication Hierarchy
Objective: Validate the inheritance and limitations of authentication tokens across subgroups.
Setup:
Group 1: mbd_outreach
Subgroup 1: outreach_1 (Runner configured with token_outreach_1)
Subgroup 2: outreach_2 (Runner only inherits the group runner if active)
Results:
✅ outreach_1 pipelines always succeeded.
✅ outreach_2 pipelines succeeded only when the group runner for mbd_outreach was active.
❌ If no active runner was present in mbd_outreach, outreach_2 pipeline failed.
Test Case 4: Shared Runner Authentication
Objective: Verify if two subgroups using the same runner and token can execute pipelines successfully.
Setup:
Both outreach_1 and outreach_2 inherited Runner 1, which was registered with token_outreach_1.
Result: ✅ Passed. Both subgroups successfully executed pipelines using the shared runner and token.
Test Case 5: Multi-GitLab Instance Authentication
Objective: Ensure runners on the same VM can authenticate to separate GitLab instances simultaneously.
Setup:
Two GitLab instances: git and git-ce
Group 1 (git): gitlab-credential-test, Runner1 with Group1 credentials
Group 2 (git-ce): gitlab-credential-ce, Runner2 with Group2 credentials
Pipelines triggered simultaneously in presentation (Repo1) and presentation-ce (Repo2)
Result:✅Passed. Both pipelines executed successfully without authentication conflicts.