Last active
December 11, 2021 01:03
-
-
Save jasonwbarnett/f18a8e04533b8b8d63ae3609171a7128 to your computer and use it in GitHub Desktop.
Revisions
-
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,6 @@ sudo ps -ef | grep -i elastic If you see an elasticsearch process than this fix will most likley work for you. If you're running an older version of Chef Infra Server you might not even be effected by the vulnerability because the solr instance uses log4j 1.x which, according to some [articles][1], doesn't have the vulnerability. [1]: https://www.randori.com/blog/cve-2021-44228/ -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,4 @@ sudo ps -ef | grep -i elastic If you see an elasticsearch process than this fix will most likley work for you. If you're running an older version of Chef Infra Server you might not even be effected by the vulnerability because the solr instance uses log4j 1.x which, according to some articles, doesn't have the vulnerability. -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ If for some reason you can't upgrade soon here is an alternative. I highly recom This only works if you're using a version of Chef Infra Server that ships with elasticsearch. If you're using an old version of Chef Infra Server that is still using solr this won't work. Quickly validate that you're using a moden version of Chef Infra Server: ```bash sudo ps -ef | grep -i elastic -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Chef Progress has already begun working on a fix that will be released in the ne If for some reason you can't upgrade soon here is an alternative. I highly recommend upgrading instead of using this fix. This fix is meant to be a stop gap solution. ## Alternative Fix This only works if you're using a version of Chef Infra Server that ships with elasticsearch. If you're using an old version of Chef Infra Server that is still using solr this won't work. -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Chef Progress has already begun working on a fix that will be released in the next Chef Infra Server release, see: https://github.com/chef/chef-server/pull/2992 If for some reason you can't upgrade soon here is an alternative. I highly recommend upgrading instead of using this fix. This fix is meant to be a stop gap solution. # Alternative Fix -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,19 @@ # Overview Chef Progress has already begun working on a fix that will be released in the next Chef Infra Server release, see: https://github.com/chef/chef-server/pull/2992 If for some reason you can't upgrade soon here is an alternative. I highly recommend upgrading instead of using this fix. This fix is meant as a stop gap solution. # Alternative Fix This only works if you're using a version of Chef Infra Server that ships with elasticsearch. If you're using an old version of Chef Infra Server that is still using solr this won't work. Quickly validate with you're using a moden version of Chef Infra Server: ```bash sudo ps -ef | grep -i elastic ``` If you see an elasticsearch process than this fix will most likley work for you. If you're running an older version of Chef Infra Server you might not even been effected by the vulnerability because the solr instance used log4j 1.x which, according to some articles, doesn't have the vulnerability. -
jasonwbarnett renamed this gist
Dec 11, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jasonwbarnett revised this gist
Dec 11, 2021 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,4 @@ Quickly validate with: sudo ps -ef | grep -i elastic ``` If you see an elasticsearch process than this fix will most likley work for you. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,4 @@ sudo chef-server-ctl restart elasticsearch # Validate sudo tail -n10 /var/opt/opscode/elasticsearch/config/jvm.options sudo ps -ef | grep formatMsgNoLookups -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,4 @@ sudo chef-server-ctl restart elasticsearch # Validate sudo tail -n10 /var/opt/opscode/elasticsearch/config/jvm.options sudo ps -ef | grep formatMsgNoLookups -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,4 +15,5 @@ sudo chef-server-ctl reconfigure sudo chef-server-ctl restart elasticsearch # Validate sudo tail -n10 /var/opt/opscode/elasticsearch/config/jvm.options sudo ps -ef | grep elastic | grep formatMsgNoLookups -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ # Update This only works if you're using a version of Chef Infra Server that ships with elasticsearch. If you're using an old version of Chef Infra Server that is still using solr this won't work. Quickly validate with: ```bash sudo ps -ef | grep -i elastic ``` If you see an elasticsearch process than this fix will most likley work for you. -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,4 +13,6 @@ eof sudo chef-server-ctl reconfigure sudo chef-server-ctl restart elasticsearch # Validate sudo tail -n10 /var/opt/opscode/elasticsearch/config/jvm.options -
jasonwbarnett revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ cat <<'eof' | sudo tee -a /opt/opscode/embedded/cookbooks/private-chef/templates -Dlog4j2.formatMsgNoLookups=true eof sudo chef-server-ctl reconfigure sudo chef-server-ctl restart elasticsearch sudo tail -15 /opt/opscode/embedded/cookbooks/private-chef/templates/default/elasticsearch_jvm.opts.erb -
jasonwbarnett created this gist
Dec 11, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # Update This only works if you're using a version of Chef Infra Server that ships with elasticsearch. If you're using an old enough version of Chef Infra Server that it's still using solr this won't work. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/bin/bash sudo cp -a /opt/opscode/embedded/cookbooks/private-chef/templates/default/elasticsearch_jvm.opts.erb /opt/opscode/embedded/cookbooks/private-chef/templates/default/elasticsearch_jvm.opts.erb-bak cat <<'eof' | sudo tee -a /opt/opscode/embedded/cookbooks/private-chef/templates/default/elasticsearch_jvm.opts.erb ## RCE 0-day exploit found in log4j, a popular Java logging package #https://www.randori.com/blog/cve-2021-44228/ #https://github.com/elastic/elasticsearch/issues/81618 -Dlog4j2.formatMsgNoLookups=true eof sudo chef-server-ctl reconfigure sudo chef-server-ctl restart elasticsearch sudo tail -15 /opt/opscode/embedded/cookbooks/private-chef/templates/default/elasticsearch_jvm.opts.erb