From d4dccff20ccf00acd0dbfc3852ee72cde833bfc3 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 de894c6c7a..aaf9c8351d 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 00deb50691..90f22afdc0 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -622,7 +622,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)