From 6c2d6a63e7c17130cbba0f9f88a0378d9f5341dc Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 13 Aug 2015 15:47:35 -0400 Subject: [PATCH] Change default sensitive redaction behavior * Only project updates will contain sensitive data redaction logic when displaying stdout --- awx/main/models/projects.py | 4 ++++ awx/main/models/unified_jobs.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index 8657c3098d..3bbbe55fa9 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -353,6 +353,10 @@ class ProjectUpdate(UnifiedJob, ProjectOptions): def task_impact(self): return 20 + @property + def result_stdout(self): + return self._result_stdout_raw(redact_sensitive=True, escape_ascii=True) + def get_absolute_url(self): return reverse('api:project_update_detail', args=(self.pk,)) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index e9b5e4bfd2..b2afb9df54 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -623,7 +623,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique ansi_escape = re.compile(r'\x1b[^m]*m') return ansi_escape.sub('', content) - def _result_stdout_raw(self, redact_sensitive=True, escape_ascii=False): + def _result_stdout_raw(self, redact_sensitive=False, escape_ascii=False): content = self.result_stdout_raw_handle().read() if redact_sensitive: content = UriCleaner.remove_sensitive(content)