From 981e4f5bc5a83542471e96ed5902c667239541d4 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 3 Sep 2016 06:41:07 -0400 Subject: [PATCH] Configure AWS SDK logging configuration Because of security permissions that we do not grant to the AWS SDK (for use in discovery-ec2 and repository-s3 plugins), certain calls in the AWS SDK will lead to security exceptions that are logged at the warning level. These warnings are noise and we should suppress them. This commit adds plugin log configurations for discovery-ec2 and repository-s3 to ship with default Log4j 2 configurations that suppress these log warnings. Relates #20313 --- plugins/discovery-ec2/build.gradle | 6 ++++++ .../discovery-ec2/config/discovery-ec2/log4j2.properties | 8 ++++++++ plugins/repository-s3/build.gradle | 6 ++++++ .../repository-s3/config/repository-s3/log4j2.properties | 8 ++++++++ 4 files changed, 28 insertions(+) create mode 100644 plugins/discovery-ec2/config/discovery-ec2/log4j2.properties create mode 100644 plugins/repository-s3/config/repository-s3/log4j2.properties diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index 506215708e2..9ad2f8d02e2 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -42,6 +42,12 @@ dependencyLicenses { mapping from: /jackson-.*/, to: 'jackson' } +bundlePlugin { + from('config/discovery-ec2') { + into 'config' + } +} + test { // this is needed for insecure plugins, remove if possible! systemProperty 'tests.artifact', project.name diff --git a/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties b/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties new file mode 100644 index 00000000000..aa52f0232e0 --- /dev/null +++ b/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties @@ -0,0 +1,8 @@ +logger.com_amazonaws.name = com.amazonaws +logger.com_amazonaws.level = warn + +logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.name = com.amazonaws.jmx.SdkMBeanRegistrySupport +logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.level = error + +logger.com_amazonaws_metrics_AwsSdkMetrics.name = com.amazonaws.metrics.AwsSdkMetrics +logger.com_amazonaws_metrics_AwsSdkMetrics.level = error diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index a6610178ce8..b1369908670 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -48,6 +48,12 @@ dependencyLicenses { mapping from: /jaxb-.*/, to: 'jaxb' } +bundlePlugin { + from('config/repository-s3') { + into 'config' + } +} + test { // this is needed for insecure plugins, remove if possible! systemProperty 'tests.artifact', project.name diff --git a/plugins/repository-s3/config/repository-s3/log4j2.properties b/plugins/repository-s3/config/repository-s3/log4j2.properties new file mode 100644 index 00000000000..3fee57ce3e2 --- /dev/null +++ b/plugins/repository-s3/config/repository-s3/log4j2.properties @@ -0,0 +1,8 @@ +logger.com_amazonaws.name = com.amazonaws +logger.com_amazonaws.level = warn + +logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.name = com.amazonaws.jmx.SdkMBeanRegistrySupport +logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.level = error + +logger_com_amazonaws_metrics_AwsSdkMetrics.name = com.amazonaws.metrics.AwsSdkMetrics +logger_com_amazonaws_metrics_AwsSdkMetrics.level = error