Skip to content

ansible: pin ANSIBLE_CONFIG to disable ambient config discovery - #643

Open
sfc-gh-ikryvanos wants to merge 1 commit into
mainfrom
ikryvanos/ansible-pin-config
Open

ansible: pin ANSIBLE_CONFIG to disable ambient config discovery#643
sfc-gh-ikryvanos wants to merge 1 commit into
mainfrom
ikryvanos/ansible-pin-config

Conversation

@sfc-gh-ikryvanos

Copy link
Copy Markdown
Collaborator

ansible-playbook auto-discovers a configuration file from the current working directory (./ansible.cfg) or the home directory (~/.ansible.cfg). Because the server runs privileged and its working directory is not guaranteed to be trusted, a caller able to drop a file in those locations could supply a config that points plugin/library/roles paths at attacker-controlled code and gain execution on the next run.

Pin ANSIBLE_CONFIG via a new bindable AnsibleConfigFile variable defaulting to os.DevNull, which loads an empty config and disables that discovery. Operators can set it to a trusted path to supply a real configuration.

ansible-playbook auto-discovers a configuration file from the current
working directory (./ansible.cfg) or the home directory (~/.ansible.cfg).
Because the server runs privileged and its working directory is not
guaranteed to be trusted, a caller able to drop a file in those locations
could supply a config that points plugin/library/roles paths at
attacker-controlled code and gain execution on the next run.

Pin ANSIBLE_CONFIG via a new bindable AnsibleConfigFile variable defaulting
to os.DevNull, which loads an empty config and disables that discovery.
Operators can set it to a trusted path to supply a real configuration.
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.

1 participant