From 41f3680dfdbd0342539e6d3d1867ee17435deaea Mon Sep 17 00:00:00 2001 From: Tatsuya Hoshino Date: Fri, 10 Feb 2017 03:16:54 +0900 Subject: [PATCH] Mask login_password in log (#21199) --- lib/ansible/modules/cloud/openstack/_keystone_user.py | 2 +- lib/ansible/modules/cloud/webfaction/webfaction_app.py | 2 +- lib/ansible/modules/cloud/webfaction/webfaction_db.py | 2 +- lib/ansible/modules/cloud/webfaction/webfaction_domain.py | 2 +- lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py | 2 +- lib/ansible/modules/cloud/webfaction/webfaction_site.py | 2 +- lib/ansible/modules/database/misc/mongodb_user.py | 2 +- lib/ansible/modules/database/mssql/mssql_db.py | 2 +- lib/ansible/modules/database/postgresql/postgresql_db.py | 2 +- lib/ansible/modules/database/postgresql/postgresql_schema.py | 2 +- lib/ansible/modules/database/vertica/vertica_configuration.py | 2 +- lib/ansible/modules/database/vertica/vertica_facts.py | 2 +- lib/ansible/modules/database/vertica/vertica_role.py | 2 +- lib/ansible/modules/database/vertica/vertica_schema.py | 2 +- lib/ansible/modules/database/vertica/vertica_user.py | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/ansible/modules/cloud/openstack/_keystone_user.py b/lib/ansible/modules/cloud/openstack/_keystone_user.py index f563974d5fa..ffe539b2d1d 100644 --- a/lib/ansible/modules/cloud/openstack/_keystone_user.py +++ b/lib/ansible/modules/cloud/openstack/_keystone_user.py @@ -343,7 +343,7 @@ def main(): default="http://127.0.0.1:35357/v2.0"), token=dict(required=False), login_user=dict(required=False), - login_password=dict(required=False), + login_password=dict(required=False, no_log=True), login_tenant_name=dict(required=False) )) # keystone operations themselves take an endpoint, not a keystone auth_url diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_app.py b/lib/ansible/modules/cloud/webfaction/webfaction_app.py index cf47bda5020..5d4464e2d5e 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_app.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_app.py @@ -122,7 +122,7 @@ def main(): extra_info = dict(required=False, default=""), port_open = dict(required=False, type='bool', default=False), login_name = dict(required=True), - login_password = dict(required=True), + login_password = dict(required=True, no_log=True), machine = dict(required=False, default=False), ), supports_check_mode=True diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_db.py b/lib/ansible/modules/cloud/webfaction/webfaction_db.py index 545176c4bf4..a6ce3762b39 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_db.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_db.py @@ -114,7 +114,7 @@ def main(): type = dict(required=True), password = dict(required=False, default=None), login_name = dict(required=True), - login_password = dict(required=True), + login_password = dict(required=True, no_log=True), machine = dict(required=False, default=False), ), supports_check_mode=True diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_domain.py b/lib/ansible/modules/cloud/webfaction/webfaction_domain.py index 8c145f18cbd..99b2fe368a0 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_domain.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_domain.py @@ -103,7 +103,7 @@ def main(): state = dict(required=False, choices=['present', 'absent'], default='present'), subdomains = dict(required=False, default=[]), login_name = dict(required=True), - login_password = dict(required=True), + login_password = dict(required=True, no_log=True), ), supports_check_mode=True ) diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py b/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py index 84d3763a89e..7fbf523f4ae 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py @@ -90,7 +90,7 @@ def main(): mailbox_password=dict(required=True), state=dict(required=False, choices=['present', 'absent'], default='present'), login_name=dict(required=True), - login_password=dict(required=True), + login_password=dict(required=True, no_log=True), ), supports_check_mode=True ) diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_site.py b/lib/ansible/modules/cloud/webfaction/webfaction_site.py index f4a81d6f52c..c13a25767b8 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_site.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_site.py @@ -122,7 +122,7 @@ def main(): subdomains = dict(required=False, type='list', default=[]), site_apps = dict(required=False, type='list', default=[]), login_name = dict(required=True), - login_password = dict(required=True), + login_password = dict(required=True, no_log=True), ), supports_check_mode=True ) diff --git a/lib/ansible/modules/database/misc/mongodb_user.py b/lib/ansible/modules/database/misc/mongodb_user.py index ea372a34f5c..a757737aa6c 100644 --- a/lib/ansible/modules/database/misc/mongodb_user.py +++ b/lib/ansible/modules/database/misc/mongodb_user.py @@ -345,7 +345,7 @@ def main(): module = AnsibleModule( argument_spec = dict( login_user=dict(default=None), - login_password=dict(default=None), + login_password=dict(default=None, no_log=True), login_host=dict(default='localhost'), login_port=dict(default='27017'), login_database=dict(default=None), diff --git a/lib/ansible/modules/database/mssql/mssql_db.py b/lib/ansible/modules/database/mssql/mssql_db.py index 4010404f479..b021df165fe 100644 --- a/lib/ansible/modules/database/mssql/mssql_db.py +++ b/lib/ansible/modules/database/mssql/mssql_db.py @@ -159,7 +159,7 @@ def main(): argument_spec=dict( name=dict(required=True, aliases=['db']), login_user=dict(default=''), - login_password=dict(default=''), + login_password=dict(default='', no_log=True), login_host=dict(required=True), login_port=dict(default='1433'), target=dict(default=None), diff --git a/lib/ansible/modules/database/postgresql/postgresql_db.py b/lib/ansible/modules/database/postgresql/postgresql_db.py index 97bf5626ce4..3bfcb96107e 100755 --- a/lib/ansible/modules/database/postgresql/postgresql_db.py +++ b/lib/ansible/modules/database/postgresql/postgresql_db.py @@ -246,7 +246,7 @@ def main(): module = AnsibleModule( argument_spec=dict( login_user=dict(default="postgres"), - login_password=dict(default=""), + login_password=dict(default="", no_log=True), login_host=dict(default=""), login_unix_socket=dict(default=""), port=dict(default="5432"), diff --git a/lib/ansible/modules/database/postgresql/postgresql_schema.py b/lib/ansible/modules/database/postgresql/postgresql_schema.py index 82b3562c863..af8d8d9506a 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_schema.py +++ b/lib/ansible/modules/database/postgresql/postgresql_schema.py @@ -180,7 +180,7 @@ def main(): module = AnsibleModule( argument_spec=dict( login_user=dict(default="postgres"), - login_password=dict(default=""), + login_password=dict(default="", no_log=True), login_host=dict(default=""), login_unix_socket=dict(default=""), port=dict(default="5432"), diff --git a/lib/ansible/modules/database/vertica/vertica_configuration.py b/lib/ansible/modules/database/vertica/vertica_configuration.py index 3b018f449ab..5985d8a7dc2 100644 --- a/lib/ansible/modules/database/vertica/vertica_configuration.py +++ b/lib/ansible/modules/database/vertica/vertica_configuration.py @@ -145,7 +145,7 @@ def main(): cluster=dict(default='localhost'), port=dict(default='5433'), login_user=dict(default='dbadmin'), - login_password=dict(default=None), + login_password=dict(default=None, no_log=True), ), supports_check_mode = True) if not pyodbc_found: diff --git a/lib/ansible/modules/database/vertica/vertica_facts.py b/lib/ansible/modules/database/vertica/vertica_facts.py index 4796a53612c..82402676abb 100644 --- a/lib/ansible/modules/database/vertica/vertica_facts.py +++ b/lib/ansible/modules/database/vertica/vertica_facts.py @@ -230,7 +230,7 @@ def main(): port=dict(default='5433'), db=dict(default=None), login_user=dict(default='dbadmin'), - login_password=dict(default=None), + login_password=dict(default=None, no_log=True), ), supports_check_mode = True) if not pyodbc_found: diff --git a/lib/ansible/modules/database/vertica/vertica_role.py b/lib/ansible/modules/database/vertica/vertica_role.py index 4e420b009b3..601bdbd7cae 100644 --- a/lib/ansible/modules/database/vertica/vertica_role.py +++ b/lib/ansible/modules/database/vertica/vertica_role.py @@ -185,7 +185,7 @@ def main(): cluster=dict(default='localhost'), port=dict(default='5433'), login_user=dict(default='dbadmin'), - login_password=dict(default=None), + login_password=dict(default=None, no_log=True), ), supports_check_mode = True) if not pyodbc_found: diff --git a/lib/ansible/modules/database/vertica/vertica_schema.py b/lib/ansible/modules/database/vertica/vertica_schema.py index 0317fc19fb2..8dd70a05a16 100644 --- a/lib/ansible/modules/database/vertica/vertica_schema.py +++ b/lib/ansible/modules/database/vertica/vertica_schema.py @@ -254,7 +254,7 @@ def main(): cluster=dict(default='localhost'), port=dict(default='5433'), login_user=dict(default='dbadmin'), - login_password=dict(default=None), + login_password=dict(default=None, no_log=True), ), supports_check_mode = True) if not pyodbc_found: diff --git a/lib/ansible/modules/database/vertica/vertica_user.py b/lib/ansible/modules/database/vertica/vertica_user.py index 6afdbb8bbcf..d357d2963d2 100644 --- a/lib/ansible/modules/database/vertica/vertica_user.py +++ b/lib/ansible/modules/database/vertica/vertica_user.py @@ -315,7 +315,7 @@ def main(): cluster=dict(default='localhost'), port=dict(default='5433'), login_user=dict(default='dbadmin'), - login_password=dict(default=None), + login_password=dict(default=None, no_log=True), ), supports_check_mode = True) if not pyodbc_found: