diff options
author | Matt Martz <matt@sivel.net> | 2019-10-10 21:49:34 -0500 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-10-10 19:49:34 -0700 |
commit | baeff7462d5d877b6849aa78f50860e7d10ce950 (patch) | |
tree | c253a190080c93f73a50a334e9698f70079c528a /test/integration/targets/cli | |
parent | 7417d535469acd39d2f0cf843d7317e38de9c97e (diff) | |
download | ansible-baeff7462d5d877b6849aa78f50860e7d10ce950.tar.gz |
Wrap CLI passwords as AnsibleUnsafeText (#63352)
* isa string should rewrap as unsafe in get_validated_value
* _is_unsafe shouldn't be concerned with underlying types
* Start with passwords as text, instead of bytes
* Remove unused imports
* Add changelog fragment
* Update changelog with CVE
Diffstat (limited to 'test/integration/targets/cli')
-rw-r--r-- | test/integration/targets/cli/aliases | 2 | ||||
-rwxr-xr-x | test/integration/targets/cli/runme.sh | 7 | ||||
-rw-r--r-- | test/integration/targets/cli/setup.yml | 4 | ||||
-rwxr-xr-x | test/integration/targets/cli/test-cli.py | 21 |
4 files changed, 34 insertions, 0 deletions
diff --git a/test/integration/targets/cli/aliases b/test/integration/targets/cli/aliases new file mode 100644 index 0000000000..6b71e884a1 --- /dev/null +++ b/test/integration/targets/cli/aliases @@ -0,0 +1,2 @@ +needs/target/setup_pexpect +shippable/posix/group3 diff --git a/test/integration/targets/cli/runme.sh b/test/integration/targets/cli/runme.sh new file mode 100755 index 0000000000..d9e846256f --- /dev/null +++ b/test/integration/targets/cli/runme.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -eux + +ANSIBLE_ROLES_PATH=../ ansible-playbook setup.yml + +python test-cli.py diff --git a/test/integration/targets/cli/setup.yml b/test/integration/targets/cli/setup.yml new file mode 100644 index 0000000000..9f6ab11741 --- /dev/null +++ b/test/integration/targets/cli/setup.yml @@ -0,0 +1,4 @@ +- hosts: localhost + gather_facts: no + roles: + - setup_pexpect diff --git a/test/integration/targets/cli/test-cli.py b/test/integration/targets/cli/test-cli.py new file mode 100755 index 0000000000..9893d6652e --- /dev/null +++ b/test/integration/targets/cli/test-cli.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# Copyright (c) 2019 Matt Martz <matt@sivel.net> +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +import os + +import pexpect + +os.environ['ANSIBLE_NOCOLOR'] = '1' +out = pexpect.run( + 'ansible localhost -m debug -a msg="{{ ansible_password }}" -k', + events={ + 'SSH password:': '{{ 1 + 2 }}\n' + } +) + +assert b'{{ 1 + 2 }}' in out |