-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Security auto-configuration for packaged installations #75144
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
Merged
Merged
Changes from all commits
Commits
Show all changes
293 commits
Select commit
Hold shift + click to select a range
7d9b6f5
generate password on installation time and show it to the user. We se…
jkakavas 2598dd3
More error handling
albertzaharovits 9c29107
Merge branch 'master' into auto_conf_security
albertzaharovits e566c3e
Merge branch 'auto_conf_security' into packaged-auto-conf
jkakavas d104c9b
add undocumented parameter to the autoconfig CLI tool so that users d…
jkakavas 38ba6b5
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 6fd7123
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 3ecbb0f
remove old version of file
jkakavas 576b608
no need to all a CLI tool from postinst
jkakavas d566434
wip
jkakavas 3aab03e
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 21fcc13
add class to generate and store password hash
jkakavas 6d924e5
more wip
jkakavas 6fd451e
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 0d4ad2f
more wip - commit to run some packaging tests
jkakavas 1239ab7
spotless
jkakavas 75c26e2
sudo -g doesn't work in all OS
jkakavas b88f1ec
create .elasticsearch.keystore.initial_md5sum
jkakavas 0113694
fix tests?
jkakavas dcc40e3
fix filtering
jkakavas 776a155
remove auto-config dir on purge
jkakavas 882c191
fix filtering
jkakavas f0b1a38
spotless
jkakavas fd4e4f9
further test fixes
jkakavas ea8dfb9
fix purging
jkakavas 26ec0e3
more
jkakavas 072a672
fix purging?
jkakavas b58fe80
create first
jkakavas 6cc80bf
correct updated permissions in tests
jkakavas f6a313d
d
jkakavas c1fa865
one of these days, packaging tests... one of these days...
jkakavas 776de7c
remove keystore on purge
jkakavas 3a37699
fix group owner
jkakavas f6ecd0d
Fix test matcher
jkakavas 5c732e2
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 680503f
Revert unecessary changes
jkakavas 5fb7152
fix
jkakavas bc1c78a
revert unncessary change
jkakavas 1e702a5
make banners shorter
jkakavas 076f1f9
change upgrade test
jkakavas c88cbc6
hopefully make a meaningful test this time
jkakavas 72fc1fd
one last time..
jkakavas a97c469
fix ownership
jkakavas 7b70758
typos
jkakavas 7a48d74
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 19df189
simplify postinst
jkakavas 3bf3962
add check for package upgades
jkakavas 9a2f6ef
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 7bbb58d
Possible disable security when upgrading to 8.0.0 (temporarily)
jkakavas 99485ea
minor changes to postinst and some additional tests
jkakavas 7db3187
null check
jkakavas 9ed95b1
meh
jkakavas 2ab4d37
meh^2
jkakavas 9f81dab
one of these days, I'll figure out how to read docs
jkakavas 5f65641
tighten test assertion
jkakavas 423dbd6
Update docs/changelog/75144.yaml
jkakavas 639f5fd
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas f73aa25
Single area label!
jkakavas d7e8cf4
change changelog
jkakavas 3c8416c
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas 5f173f9
Merge branch 'master' into packaged-auto-conf
elasticmachine 15e1eff
Merge branch 'master' into packaged-auto-conf
elasticmachine 2795c3a
Attemp TLS config
albertzaharovits bc28f81
Checkstyle
albertzaharovits d0a1122
Crazy typo
albertzaharovits 48c7c80
move does not support attributes
albertzaharovits d0c9270
Archives
albertzaharovits d0ad3c1
Nit
albertzaharovits c75dda6
Spotless
albertzaharovits 71bd34d
Facepalm
albertzaharovits fa4b93e
QA OS Make request with https
albertzaharovits 83d4036
Merge branch 'master' into config_tls_when_node_starts
albertzaharovits cce8094
working on archive tests
albertzaharovits 9c82a71
Archives tests still
albertzaharovits 7afeee2
ArchiveTests test51
albertzaharovits 169b3e7
ArchiveTests still
albertzaharovits a05bb85
Commons io FileUtils
albertzaharovits b66c345
Commons io precommit
albertzaharovits 230a364
Verbose auto-conf pacakging tests
albertzaharovits 26ad69a
More info about why the node doesn't start
albertzaharovits f9b74fd
Remove explicit CLI tool
jkakavas 4360d08
Updates from feedback
jkakavas b0cbdfc
fix cert DN and remove references to deleted CLI tool
jkakavas 1feac33
don't exit with 0 all the time
jkakavas 5dc4258
more packaging
jkakavas c05732d
more packaging2
jkakavas 4dcbc84
remove tripping assertion
jkakavas 4f0a743
Enable nodes running TEST INTEG distribution to call ConfigInitialNod…
jkakavas 3535b00
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas 26e7811
fix keystore management tests
jkakavas 7dcfd2f
test20KeystorePasswordOnStandardInput runs before we ever start the n…
jkakavas f86e6a8
Wait for enough time for ES in docker to complete auto-configuration
jkakavas 11834f1
missing colon that took me 4 hours to spot
jkakavas bdcd267
more test fixes
jkakavas d83fd6c
take TLS autoconfiguration in consideration for ArchiveGenerateInitia…
jkakavas d90104b
guess what
jkakavas 9fd5e77
:/ :(
jkakavas 0ef54aa
Use autoconfigured TLS when needed in Docker, disable it otherwise
jkakavas da5e3de
fix docker (for good ?) and print debug to retain my sanity
jkakavas c29e3e7
what's another commit
jkakavas c8785c4
disable auto-configuration in unrelated docker tests, fix stupid bug …
jkakavas 1498131
On linux too
jkakavas 84046fd
Create user after we verify installation so that upon installation ve…
jkakavas cd8c285
We might not have an elasticsearch.yml file in Docker
jkakavas 182c45d
revert previous unnecessary changes
jkakavas 8ac2890
spotless
jkakavas 1e439a6
more adjustments
jkakavas 48da88c
more adjustments
jkakavas dd5f118
this should fix all in linux
jkakavas 9791b77
plugin and configuration tests
jkakavas 71c934e
some more
jkakavas bc68b30
some more
jkakavas 9cd79e0
config tests
jkakavas 69990d1
add temp debug info
jkakavas 6221408
get the certificate from the right path
jkakavas a754c1e
add support for auto-configuration to windows batch file
jkakavas c150a08
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas 3f1d58a
Docker packaging tests now use auto-configured TLS
jkakavas 73be68f
CertGenCliTests do not need TLS auto-configuration
jkakavas a69986c
cleanup
jkakavas c55d9dd
spotless
jkakavas deafd2d
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas ec3c51f
fix certgen tests
jkakavas 6ccf723
don't sstop on success
jkakavas c1771d8
minor updates
jkakavas 749ba9b
fix
jkakavas 084b2f9
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas a8f7c47
Catch Throwables and amend how we populate SANs for certificates
jkakavas a5baae0
add more tests
jkakavas 28bca9e
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas 90a9022
spotless
jkakavas 90bd0f6
minor fixes
jkakavas 7d2219c
cleanup data dir after test to avoid false positives
jkakavas 4449fd5
test adjustments
jkakavas 9ecc182
spotless
jkakavas 9781eba
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas 9145898
revert fix for local invocation
jkakavas ea5932d
spotless
jkakavas a781149
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas ae591d3
Use legacy MAC algorithm for PKCS12 in tests until we can bump minimu…
jkakavas 10f3474
Main
albertzaharovits 6076aab
Nit rename & javadoc
albertzaharovits 674202d
ReservedRealm security index param remove fallout
albertzaharovits 98e3ed9
Merge branch 'master' into set-auto-conf-password
albertzaharovits ccd1dbe
WIP
albertzaharovits c2092d8
ReservedRealm tests
albertzaharovits 0b89640
Merge branch 'master' into set-auto-conf-password
albertzaharovits e8b390c
Exception serialization test
albertzaharovits 93abfb2
Almost
albertzaharovits ed8646f
ReservedRealm tests
albertzaharovits 1a3220d
call external class properly
jkakavas 42d88e9
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas 6ebcebc
fix elasticsearch-env
jkakavas 405c60d
fix tests for windows
jkakavas c3124d2
typo
jkakavas 53443bd
NativeUsersStoreTests
albertzaharovits 5645b7d
isElasticUserAutoConfigured
albertzaharovits 125480c
minor fix
jkakavas 8decc71
fix for windows
jkakavas 4a9f987
set read only with attrib on windows
jkakavas 41d6067
undo read only before deletion
jkakavas 1e4648f
test
jkakavas 8ac813e
temp ugly debug
jkakavas a0cd8de
Address feedback related to packaging tests
jkakavas de20c38
adjust test after enabling auto-config
jkakavas ba6720c
windows fixes
jkakavas 6cde022
windows
jkakavas 5798743
add bugurl
jkakavas 38df918
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas ff48940
spotless
jkakavas 7b86021
more spotless
jkakavas 820fd28
wrong password instead of empty
jkakavas b59c55f
Mute on windows the test that I've been trying all morning to fix on …
jkakavas b070178
windows debugging
jkakavas b25cc0a
guess what spotless didn't like
jkakavas f4e784f
deBUG
jkakavas 8fb6362
debugging windows packaging tests
jkakavas 14e1f36
Negative integ tests
albertzaharovits a7e4c49
Merge branch 'master' into set-auto-conf-password
albertzaharovits 4128d61
Merge fallout
albertzaharovits 59c2542
Checkstyle
albertzaharovits 299c710
Nit
albertzaharovits 1b2eed3
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas f908c25
path fix
jkakavas c5eeb4f
temp debug
jkakavas d646a3b
test fixes
jkakavas dcb6ee5
spotless
jkakavas b0377e1
moar spotless
jkakavas a33a1da
windows file ownership
jkakavas 6f2be87
test fixes
jkakavas c83160d
Merge remote-tracking branch 'origin/master' into config_tls_when_nod…
jkakavas 4cf3243
remove default from env
jkakavas 4a7e626
Merge remote-tracking branch 'albertzaharovits/config_tls_when_node_s…
jkakavas 0d75418
Merge branch 'packaged-auto-conf' of github.com:jkakavas/elasticsearc…
jkakavas 53e6a2d
merge woes
jkakavas b28bd52
spotless
jkakavas be9eefa
test fixes
jkakavas bc8d9c5
selective mute to check the rest of the tests on windows
jkakavas 1acd0cc
more fixes
jkakavas 8df3cbf
unused import
jkakavas 35b9845
fix autoconfig check for packages
jkakavas 6f752ab
fix certgen
jkakavas ea66082
Merge remote-tracking branch 'albertzaharovits/set-auto-conf-password…
jkakavas a8337c2
...
jkakavas 622dffd
fix package upgrade tests
jkakavas 507b3f6
fix package upgrade tests for real now
jkakavas df561e8
adjustments
jkakavas 514a240
bump leniency
jkakavas 0ca655b
Merge remote-tracking branch 'albertzaharovits/config_tls_when_node_s…
jkakavas ba30af4
temp debugging
jkakavas 4d1658b
fix docker issues on startup
jkakavas dd2f567
additional windows debug temp logging
jkakavas e175b5c
unused imports
jkakavas 99b649c
spotless
jkakavas 178580b
check if FileUtils.deleteDirectory from apache commons does the job o…
jkakavas 99b4ad0
spotless
jkakavas 5d793a3
test fixes
jkakavas dbf7250
Revert "check if FileUtils.deleteDirectory from apache commons does t…
jkakavas 8bda57f
attempt to explicitly own the dir before removing it
jkakavas c3547ec
Merge remote-tracking branch 'albertzaharovits/config_tls_when_node_s…
jkakavas e3d0825
fix tests
jkakavas 8abbf94
almost there
jkakavas 1e981e0
almost, almost, there
jkakavas 7e817d0
more
jkakavas ceca0f1
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas cbf60bd
spotless
jkakavas af4d838
Can't use setup passwords for packaged installations
jkakavas 2089d1c
fix tests
jkakavas 6e72adb
add user when needed
jkakavas 27a655c
remove temp dirs correctly in windows
jkakavas 05c2efe
remove temp dirs correctly in windows2
jkakavas bae98d3
fix deletion
jkakavas 738eb2e
fix autoformat
jkakavas c72b48d
hello spotless my old friend
jkakavas 40a05af
proper windows cleaning
jkakavas 5e6db81
spotless
jkakavas 0f2d589
sort all first
jkakavas f721f19
print without deleting for troubleshooting
jkakavas a8eeff9
blind testing
jkakavas f0f7b65
spaces are important
jkakavas c3c6329
dbg
jkakavas 3b0e7ff
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas a77460f
unused import
jkakavas 211391e
fixes
jkakavas bbb38b9
spotless
jkakavas ffc4f88
Merge remote-tracking branch 'origin/master' into packaged-auto-conf
jkakavas ffce3d3
revert unecessary changes and fix merge
jkakavas bda567b
unused imports
jkakavas 7cdf1e9
Update docs/changelog/75144.yaml
jkakavas 2e19810
fix test
jkakavas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,7 +254,7 @@ def commonPackageConfig(String type, String architecture) { | |
| } | ||
| } | ||
|
|
||
| // this is package indepdendent configuration | ||
| // this is package independent configuration | ||
| ospackage { | ||
| maintainer 'Elasticsearch Team <[email protected]>' | ||
| summary 'Distributed RESTful search engine built for the cloud' | ||
|
|
||
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ export ES_PATH_CONF=${ES_PATH_CONF:[email protected]@} | |
|
|
||
| REMOVE_DIRS=false | ||
| REMOVE_JVM_OPTIONS_DIRECTORY=false | ||
| REMOVE_SECURITY_AUTO_CONFIG_DIRECTORY=false | ||
| REMOVE_ELASTICSEARCH_KEYSTORE=false | ||
| REMOVE_USER_AND_GROUP=false | ||
|
|
||
|
|
@@ -31,6 +32,7 @@ case "$1" in | |
| purge) | ||
| REMOVE_DIRS=true | ||
| REMOVE_JVM_OPTIONS_DIRECTORY=true | ||
| REMOVE_SECURITY_AUTO_CONFIG_DIRECTORY=true | ||
| REMOVE_ELASTICSEARCH_KEYSTORE=true | ||
| REMOVE_USER_AND_GROUP=true | ||
| ;; | ||
|
|
@@ -99,6 +101,16 @@ if [ "$REMOVE_DIRS" = "true" ]; then | |
| fi | ||
| fi | ||
|
|
||
| # delete the security auto config directory if we are purging | ||
| if [ "$REMOVE_SECURITY_AUTO_CONFIG_DIRECTORY" = "true" ]; then | ||
| for dir in "${ES_PATH_CONF}"/tls_auto_config_initial_node_* | ||
| do | ||
| echo -n "Deleting security auto-configuration directory..." | ||
| rm -rf "${dir}" | ||
| echo "OK" | ||
| done | ||
| fi | ||
|
|
||
| # delete the elasticsearch keystore if we are purging | ||
| if [ "$REMOVE_ELASTICSEARCH_KEYSTORE" = "true" ]; then | ||
| if [ -e "${ES_PATH_CONF}/elasticsearch.keystore" ]; then | ||
|
|
||
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pr: 75144 | ||
| summary: Security auto-configuration for packaged installations | ||
| area: Security | ||
| type: enhancement | ||
| issues: | ||
| - 78306 |
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 characters
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 characters
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 characters
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 characters
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 characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.