Skip to content

Conversation

@jackhodgkiss
Copy link
Contributor

The original approach caused secrets to be leaked in the event of a task failing.

TASK [stackhpc.pulp.pulp_repository : Setup DEB repositories] *****************************************************************************************
Monday 21 November 2022  17:08:53 +0000 (0:00:00.024)       0:00:00.493 *******
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: urllib.error.URLError: <urlopen error timed out>
failed: [localhost] (item=Ubuntu focal) => changed=false
  ansible_loop_var: item
  item:
    architectures: amd64
    base_path: ubuntu/focal/
    components: main restricted universe multiverse
    distribution_name: ubuntu-focal-
    distributions: focal focal-updates focal-backports focal-security
    mirror: true
    mode: verbatim
    name: Ubuntu focal
    policy: on_demand
    publish: false
    short_name: ubuntu_focal
    state: present
    sync: false
    url: http://nova.clouds.archive.ubuntu.com/ubuntu/
  module_stderr: |-
    Traceback (most recent call last):
      File 

The new approach involves iterating over the map against an attribute that can be disclosed such as name. Combined with an index_var and the modules will still receive the information they require.

The original loop approach would leak sensitive data in the event the
task fails. This new approach does not have this issue as it loops over
`name` and use an `index_var` to access the contents of the items.

This same approach will also be included in other roles contained within
this repository.
@jackhodgkiss jackhodgkiss self-assigned this Nov 22, 2022
@jackhodgkiss jackhodgkiss marked this pull request as ready for review November 22, 2022 13:24
@jackhodgkiss jackhodgkiss requested a review from a team as a code owner November 22, 2022 13:24
Copy link

@markgoddard markgoddard left a comment

Choose a reason for hiding this comment

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

Nice job

@markgoddard markgoddard merged commit 22aa5f6 into master Nov 22, 2022
@markgoddard markgoddard deleted the dev-786-stop-leaks branch November 22, 2022 16:02
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.

3 participants