1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/unit/plugins
David Hummel 7f96b7df60
nmcli: writing secrets to command line is a security hole (#3160)
* nmcli: use `stdin` for setting private `wifi_sec` options

I.E.:
* `802-11-wireless-security.leap-password`
* `802-11-wireless-security.psk`
* `802-11-wireless-security.wep-key0`
* `802-11-wireless-security.wep-key1`
* `802-11-wireless-security.wep-key2`
* `802-11-wireless-security.wep-key3`

* Changelog fragement formatting.

* Update changelogs/fragments/3160-pass-wifi-secrets-via-stdin-to-nmcli-module.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Make `wifi_sec_secret_options()` into a constant

* Minor cleanup

`'set ' + key + ' ' + value`
=>
`'set %s %s' % (key, value)`

* Change `casing`

* Change `WIFI_SEC_SECRET_OPTIONS` from `list` to `tuple`

* Update `edit_connection()` to not reset `edit_commands`

It will just re`set` them if `edit_connection()` is called more than 
once.

* Do not call `edit_connection()` if `connection_update(*)` fails

* Fixed `pep8` issue `E713` in tests

`test for membership should be 'not in'`

* Simplify `create_connection()`/`modify_connection()` logic

* `WIFI_SEC_SECRET_OPTIONS`=>`SECRET_OPTIONS`, options are prefixed

* Moved `if key in self.SECRET_OPTIONS` into `if value is not None` check

We don't need to do anything is the value is None

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-08-08 18:35:52 +02:00
..
become Use become test framework for sudosu tests. (#2629) 2021-05-26 10:34:35 +02:00
cache redis cache - better parsing of connection uri (#2579) 2021-05-26 07:07:09 +02:00
callback callback_splunk - Add user-configurable event correlation id (#2790) 2021-06-16 22:28:09 +04:30
connection Removal of docker content for 2.0.0 (#1304) 2020-11-23 13:03:19 +01:00
inventory Proxmox inventory: Added snapshots fact (#3044) 2021-07-22 22:55:07 +02:00
lookup Add dependent lookup plugin (#2164) 2021-05-11 19:27:05 +02:00
module_utils MH - dicts and lists change-tracking is fixed (#2951) 2021-07-08 07:20:01 +02:00
modules nmcli: writing secrets to command line is a security hole (#3160) 2021-08-08 18:35:52 +02:00
__init__.py Initial commit 2020-03-09 09:11:07 +00:00