diff --git a/core/src/main/java/org/elasticsearch/common/settings/KeyStoreWrapper.java b/core/src/main/java/org/elasticsearch/common/settings/KeyStoreWrapper.java index 1176ed28cb8..441bb131f03 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/KeyStoreWrapper.java +++ b/core/src/main/java/org/elasticsearch/common/settings/KeyStoreWrapper.java @@ -330,7 +330,7 @@ public class KeyStoreWrapper implements SecureSettings { PosixFileAttributeView attrs = Files.getFileAttributeView(keystoreFile, PosixFileAttributeView.class); if (attrs != null) { // don't rely on umask: ensure the keystore has minimal permissions - attrs.setPermissions(PosixFilePermissions.fromString("rw-------")); + attrs.setPermissions(PosixFilePermissions.fromString("rw-rw----")); } } diff --git a/distribution/src/main/packaging/scripts/postinst b/distribution/src/main/packaging/scripts/postinst index f2bf4c083ce..a7ffda92d1e 100644 --- a/distribution/src/main/packaging/scripts/postinst +++ b/distribution/src/main/packaging/scripts/postinst @@ -100,6 +100,7 @@ fi chown -R elasticsearch:elasticsearch /var/lib/elasticsearch chown -R elasticsearch:elasticsearch /var/log/elasticsearch chown -R root:elasticsearch /etc/elasticsearch +chmod g+s /etc/elasticsearch chmod 0750 /etc/elasticsearch if [ -f /etc/default/elasticsearch ]; then diff --git a/qa/vagrant/src/test/resources/packaging/utils/packages.bash b/qa/vagrant/src/test/resources/packaging/utils/packages.bash index bcd4ec8f52c..86e182dbbff 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/packages.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/packages.bash @@ -94,7 +94,7 @@ verify_package_installation() { assert_file "$ESHOME/bin/elasticsearch-plugin" f root root 755 assert_file "$ESHOME/bin/elasticsearch-translog" f root root 755 assert_file "$ESHOME/lib" d root root 755 - assert_file "$ESCONFIG" d root elasticsearch 750 + assert_file "$ESCONFIG" d root elasticsearch 2750 assert_file "$ESCONFIG/elasticsearch.yml" f root elasticsearch 660 assert_file "$ESCONFIG/jvm.options" f root elasticsearch 660 assert_file "$ESCONFIG/log4j2.properties" f root elasticsearch 660