You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units
Sam Doran 7e4cffc5d2
[stable-2.10] Change default file permissions so they are not world readable (#70221) (#70824)
* Change default file permissions so they are not world readable

CVE-2020-1736

Set the default permissions for files we create with atomic_move() to 0o0660. Track
which files we create that did not exist and warn if the module supports 'mode'
and it was not specified and the module did not call set_mode_if_different(). This allows the user to take action and specify a mode rather than using the defaults.

A code audit is needed to find all instances of modules that call atomic_move()
but do not call set_mode_if_different(). The findings need to be documented in
a changelog since we are not warning. Warning in those instances would be frustrating
to the user since they have no way to change the module code.

- use a set for storing list of created files
- just check the argument spac and params rather than using another property
- improve the warning message to include the default permissions.
(cherry picked from commit 5260527c4a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
6 years ago
..
_vendor transparent downstream vendoring (#69850) 6 years ago
ansible_test Add Azure Pipelines support to ansible-test. 6 years ago
cli ansible-galaxy - fix collection installation with trailing slashes (#70016) 6 years ago
compat Move unit test compat code out of `lib/ansible/`. (#46996) 7 years ago
config [stable-2.10] Clean up unit test boilerplate. 6 years ago
errors Remove empty overridden unittest.setUp and unittest.tearDown methods. 6 years ago
executor refactor Python module_utils locator (#70610) (#70711) 6 years ago
galaxy [2.10] Improve ansible-galaxy STDOUT messages for collections (#70379) 6 years ago
inventory [stable-2.10] Clean up unit test boilerplate. 6 years ago
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 11 years ago
mock [stable-2.10] Clean up unit test boilerplate. 6 years ago
module_utils [stable-2.10] Change default file permissions so they are not world readable (#70221) (#70824) 6 years ago
modules [stable-2.10] Clean up unit test boilerplate. 6 years ago
parsing [stable-2.10] Ensure single vaulted values aren't counted as sequences. Fixes #70784 (#70786) (#70791) 6 years ago
playbook [stable-2.10] Clean up unit test boilerplate. 6 years ago
plugins Make filter type errors 'loop friendly' (#70417) (#70574) 6 years ago
regex Add toggle to control invalid character substitution in group names (#52748) 7 years ago
template Do not treat AnsibleUndefined as being unsafe (#65202) 6 years ago
utils [stable-2.10] Clean up unit test boilerplate. 6 years ago
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 6 years ago
__init__.py Add empty-init code-smell script. (#18406) 9 years ago
requirements.txt Remove unnecessary unit test requirements. 6 years ago
test_constants.py [stable-2.10] Clean up unit test boilerplate. 6 years ago
test_context.py [stable-2.10] Clean up unit test boilerplate. 6 years ago