-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating the version of log4j2 #47298
Conversation
Updating to latest 2.12.1 closes elastic#45523
Pinging @elastic/es-core-infra |
I am facing some problems with security permission with this log4j2 version the discussion https://jira.apache.org/jira/browse/LOG4J2-2266 the test that is failing
@pugnascotia Should we add a security grant for log4j to allow this? |
Let's ask @rjernst. |
Logging is initialized before we set the security manager, which is why this does not fail in production. I think the permission could be avoided if we mock or subclass the LoggerContext interface in the test instead of extending SimpleLoggerContext? Separately, this looks like a regression in log4j, as there is special handling there to detect security manager and do best effort when it does not allow certain permissions. The problem here is the loop traversing the hierarchy of classloaders. The calls to getParent() should be protected in LoaderUtil.getClassLoaders() so that if a security manager is installed without this permission, only the classloader of LoaderUtil gets returned. We should at least report this issue back to log4j. |
I suspect the problem with I am getting a lot of edit: the fix is actually scheduled for version 3.0. |
But is this correct? if we initialise logging before security manager, then some of the logging static settings will be incorrect. Like with class loading. See here in old 2.11 version - the same logic is in latest log4j version |
awaits a fix within log4j |
We need another quick update to patch Elastic against the new #log4shell hack vector! |
Have a look at
https://discuss.elastic.co/t/apache-log4j2-remote-code-execution-rce-vulnerability-cve-2021-44228-esa-2021-31/291476
we're trying to keep all the communications for log4jshell in one spot we
can patch as things change.
…On Sun, Dec 12, 2021, 4:26 PM Len ***@***.***> wrote:
We need another quick update to patch Elastic against the new #log4shell
hack vector!
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#47298 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUXIRRIOBYHVEX5XU27WLUQUHPBANCNFSM4I33UR3A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Originally we tried to a log4j update in elastic#47298, but we were unable to that due to the `DeprecationLoggerTests.testLogPermissions` test failing. The test relied on mocking and got removed in https://github.com/elastic/elasticsearch/pull/61474/files#diff-70de5a6ba5c637e7f19c51341417760d6e957beb5a1fa5703049095ea2719ee0L47 Now we should be able to the upgrade and then we can address the Security Manager permission questions raised in elastic#47298 separately.
We discussed this with @ChrisHegarty and @arteam The failing |
Agreed. From the perspective of LoaderUtil, there are no substantive differences relating to how permissions are determined and checked. The code does not take into account the dynamic nature of the security manager, and permission stack walking, but that is not new in 2.15, it's there in prior versions too. We'll proceed with the upgrade, and circle back to the aforementioned issue in log4j at some future point. |
Originally we tried to a log4j update in #47298, but we were unable to that due to the `DeprecationLoggerTests.testLogPermissions` test failing. The test relied on mocking and got removed in https://github.com/elastic/elasticsearch/pull/61474/files#diff-70de5a6ba5c637e7f19c51341417760d6e957beb5a1fa5703049095ea2719ee0L47 Now we should be able to the upgrade and then we can address the Security Manager permission questions raised in #47298 separately. * Initialize pattern layout with AccessController.doPrivileged We need the `getClassLoader` permissions * Disable the SecurityManager for command testing because of `CommandLoggingConfigurator` which fails under the `SecurityManager`
closing as log4j was updated to 2.17 |
Updating to latest 2.12.1
closes #45523