From 436a15d536fac8dc136ae8102441979f572726a8 Mon Sep 17 00:00:00 2001 From: aldbr Date: Tue, 15 Oct 2024 08:07:22 +0200 Subject: [PATCH 1/2] fix(Resources): hide private key from the logs --- src/DIRAC/Resources/LogFilters/SensitiveDataFilter.py | 1 + src/DIRAC/Resources/LogFilters/test/Test_LogFilter.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/DIRAC/Resources/LogFilters/SensitiveDataFilter.py b/src/DIRAC/Resources/LogFilters/SensitiveDataFilter.py index 8240c24b88c..eed05e10ec3 100644 --- a/src/DIRAC/Resources/LogFilters/SensitiveDataFilter.py +++ b/src/DIRAC/Resources/LogFilters/SensitiveDataFilter.py @@ -43,6 +43,7 @@ def __filter(self, record): # a list of sensitive words to replace sensitiveData = [ r"-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----", + r"-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----", ] # record.args can be a tuple diff --git a/src/DIRAC/Resources/LogFilters/test/Test_LogFilter.py b/src/DIRAC/Resources/LogFilters/test/Test_LogFilter.py index 748b4f27791..4cebee7da2a 100644 --- a/src/DIRAC/Resources/LogFilters/test/Test_LogFilter.py +++ b/src/DIRAC/Resources/LogFilters/test/Test_LogFilter.py @@ -93,6 +93,14 @@ def test_pf(pf, record, result): ("blablabla ***REDACTED*** blablabla", "Variable message"), # should not display the certificate ), + ( + ( + "blablabla -----BEGIN PRIVATE KEY-----\n12345\n45678\n-----END PRIVATE KEY----- blablabla", + "Variable message", + ), + ("blablabla ***REDACTED*** blablabla", "Variable message"), + # should not display the certificate + ), ((5, ""), ("5", "")), # special case (("", 5), ("", "5")), # special case (({"ce": "test"}, ""), ("{'ce': 'test'}", "")), # special case From 361518f648fd496ece6e1aa0b21ff65efcdd8a2a Mon Sep 17 00:00:00 2001 From: aldbr Date: Tue, 15 Oct 2024 08:16:59 +0200 Subject: [PATCH 2/2] fix: release note trailing space --- release.notes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.notes b/release.notes index 79f9dbd2b90..0a9f17f680b 100644 --- a/release.notes +++ b/release.notes @@ -9,7 +9,7 @@ FIX: (#7818) AREXCE returns an error if a queue is not found in the ARC instance *TransformationSystem -NEW: (#7812) +NEW: (#7812) CHANGE: (#7812) Improve getTransformationFiles performance FIX: (#7811) SSHCE, Try python3 before unversioned python