Menu

Ansible looked for our old partner certificates on the CI runner and left them on every gateway
📰

Ansible looked for our old partner certificates on the CI runner and left them on every gateway

DEV Community: ansible·Sergey Shinder·10 days ago
#lOXDuZP8
#devtoansible#devto#dev#gateway#task
Reading 0:00
15s threshold

Our API gateway authenticates partners with client certificates. Each partner's CA certificate is a file in /etc/gateway/trusted on six gateway servers, and the reload step joins every file in that directory into the bundle nginx reads. When a partner leaves, a playbook removes their files and reloads the gateways. In May our contract with a regional carrier ended, and the offboarding run removed them, as far as anybody could see.

In October their old tracking system called our booking API. The account check refused it further in, but the TLS handshake had accepted their certificate, and the access log showed the same client certificate calling twice a day since May.

The task that should have removed it looked like this:

name: Remove retired partner certificates ansible.builtin.file: path: "{{ item }}" state: absent with_fileglob:

"/etc/gateway/trusted/{{ retired_partner }}-*.pem"

fileglob is a lookup, and lookups run on the Ansible controller, not on the hosts the play targets.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.