From df62520f58574f1737d8a0761c8a724235a0aaee Mon Sep 17 00:00:00 2001 From: Claire Villard Date: Wed, 18 Dec 2024 15:57:28 +0100 Subject: SONAR-23968 Log a warning when encrypted properties are used on Scanner side --- .../src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap') diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java index 85b0fcd41bd..a766101f54a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java @@ -23,6 +23,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import javax.annotation.concurrent.Immutable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.api.config.internal.Encryption; import static org.sonar.api.CoreProperties.ENCRYPTION_SECRET_KEY_PATH; @@ -33,6 +35,7 @@ import static org.sonar.api.CoreProperties.PROJECT_KEY_PROPERTY; */ @Immutable public class ScannerProperties { + private static final Logger LOG = LoggerFactory.getLogger(ScannerProperties.class); private final Map properties; private final Encryption encryption; @@ -43,6 +46,7 @@ public class ScannerProperties { for (Map.Entry entry : properties.entrySet()) { String value = entry.getValue(); if (value != null && encryption.isEncrypted(value)) { + LOG.warn("Property '{}' is encrypted. The encryption of scanner properties is deprecated and will soon be removed.", entry.getKey()); try { value = encryption.decrypt(value); } catch (Exception e) { -- cgit v1.2.3