It's very complicated because the vulnerability can be found in so many places... to put it simply: it's a mess and you risk having it for days, or even weeks, especially since this vulnerability arrives in the middle of Christmas, right during your end-of-year freezes (your annual "freeze" of any modification on your infrastructures).
You have to be able to map your information system in the broadest sense by identifying all the editors in order to know if they are vulnerable as well as all your software, services, applications... in Java that could be vulnerable.
For the editors, it is necessary to follow the alert bulletins, to use the SwitHak git mentioned above and to follow the security news because it is likely to move very quickly in the next few days.
Then, you have to know if your software uses Log4j in the vulnerable versions (see ANSSI bulletin), which is not trivial. Depending on the version of Java, the version of Log4j... you will have to decide to update or to apply a workaround.
At the same time, it is important to keep looking for potential exploits of the vulnerability everywhere.
The ANSSI bulletin: https://www.cert.ssi.gouv.fr/alerte/CERTFR-2021-ALE-022/
Correct
The best is to update with the latest version of log4j because intermediate versions are vulnerable to a denial of service or a remote code execution.
In theory it is possible to stay in 2.16.0 as it is only a denial of service, but I recommend rather to weigh the pros and cons by asking yourself this question: is it easier/quicker for me to qualify the need for this new update vs the time and difficulty to update.
If the update is a 1-click or single command update to 2000 servers, with no platform availability impact, feel free to upgrade to 2.17.1 😉.
If you have to restart hypervisors with a complete shutdown of your services for 2 hours, stay in 2.16.0 for now.
Workarounds
It is possible to set up a variable disabling name resolutions, limiting the exploitation of the vulnerability but not fixing it:
Either by modifying the command line of the software call: # java ... -Dlog4j2.formatMsgNoLookups=True ... -jar my_appli_every_month.jar
Or by setting an environment variable in the .profile file of the account running the service: " export LOG4J_FORMAT_MSG_NO_LOOKUPS=true"
For Docker applications, in the " Dockerfile " file, you must add " ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true ".
Or in the "Dockerfile" file, at the command line level, add "CMD "java", "-Dlog4j.formatMsgNoLookups=true", "-jar", "..."".
Or in the "docker-compose.yml" file, you need to add:
web:
environment:
- LOG4J_FORMAT_MSG_NO_LOOKUPS=true
More details here: https://www.docker.com/blog/apache-log4j-2-cve-2021-44228/
Virtual patching
Several companies, including AWS, offer solutions to fix the vulnerability just by restarting the service with an additional library to fix the problem in memory.
Here are three of them:
https://github.com/corretto/hotpatch-for-apache-log4j2 (AWS team)
https://github.com/nccgroup/log4j-jndi-be-gonehttps://blog.fox-it.com/2021/12/14/log4j-jndi-be-gone-a-simple-mitigation-for-cve-2021-44228/
With the sentence below, the last article makes it clear that paid software with DRM embeds free software 🤦♂️ :
<<The benefit ... negate the vulnerability ... so long as it isn't obfuscated (e.g. with proguard), in which canse you may not be in a good position to update it anyway. >>
Partitioning
This is part of the good practices: you have to strictly filter the flows, especially outgoing ones, in order to prevent a vulnerable server from fetching an exploit code somewhere or from talking to a command and control (C2) server.
Good luck to everyone!
As I write this, Guillaume Poupard, the director of ANSSI, has just published:
<< 🚨A vulnerability has been discovered in the Apache log4j logging library. ...
This vulnerability allows an attacker to cause remote arbitrary code execution if they have the ability to submit data to an application that uses the log4j library to log the event. This attack can be performed without being authenticated, for example by taking advantage of an authentication page that logs authentication errors.
Proofs of concept have already been published and exploit codes are likely to be quickly developed.
Details in the CERTFR-2021-ALE-022👇 alert
https://www.cert.ssi.gouv.fr/alerte/CERTFR-2021-ALE-022/
https://www.linkedin.com/posts/guillaume-poupard-3604531b5_objet-vuln%C3%A9rabilit%C3%A9-dans-apache-log4j-activity-6875847639280234496-2mcz