Skip to content

CI: Avoid leaking credentials in container image builds #937

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

Merged
merged 6 commits into from
Feb 13, 2024

Conversation

markgoddard
Copy link
Contributor

  • Revert "Don't verify Apt repo CA initially when using HTTPS in container build"
  • Revert "Add package repository credentials to container image build"
  • Add Ansible Galaxy roles and collections to .gitignore
  • Add a playbook to deploy an authenticating Pulp proxy
  • Use authenticating Pulp proxy during container image builds

…ner build"

This reverts commit f8947a9.

This approach is not secure and leaves credentials in images.
This reverts commit 05e1995.

This approach is not secure and leaves credentials in images.
There is currently no practical, secure way to provide credentials for
accessing Ark's authenticated package repositories from within a Kolla
build.  Docker provides build secrets, but these must be explicitly
requested for each RUN statement, making them challenging to use in
Kolla.

This change adds a playbook that deploys an Nginx container that runs as
a reverse proxy, injecting an HTTP basic authentication header into
requests.

Because this proxy bypasses Pulp's authentication, it must not be
exposed to any untrusted environment.

[1] https://docs.docker.com/build/building/secrets/
@markgoddard markgoddard requested a review from a team as a code owner February 13, 2024 13:49
@markgoddard markgoddard self-assigned this Feb 13, 2024
@markgoddard markgoddard force-pushed the yoga-secure-container-builds branch from 250fb76 to bd03772 Compare February 13, 2024 13:53
This change uses the authenticating Pulp proxy added in
6320be9 to provide container image
builds access to Ark's authenticated package repositories without
injecting the credentials into the built images or their metadata.
Running the hello-world container from Dockerhub at the beginning of
workflows can cause us to hit rate limits. Switch to a simple docker ps.
@markgoddard
Copy link
Contributor Author

AIO jobs are failing with an issue seen upstream:

[WARNING]: Skipping plugin (/home/zuul/kayobe-
venv/share/kayobe/ansible/filter_plugins/networks.py) as it seems to be
Python 3.7.0 or higher is required!

- name: Install Docker Python SDK
run: |
pip install --user docker
sudo pip install docker
Copy link
Member

Choose a reason for hiding this comment

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

sudo pip

😬

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not ideal, but necessary with connection=local and ansible_python_interpreter=/usr/bin/python3.

@markgoddard markgoddard merged commit f12e38d into stackhpc/yoga Feb 13, 2024
@markgoddard markgoddard deleted the yoga-secure-container-builds branch February 13, 2024 15:13
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