Commit Graph

20 Commits

Author SHA1 Message Date
Jan Heise
cc52dcb5b0 DataNode: using JWT for authentication/authorisation (#16334)
* jwt implementation, adding preflight + versionprobe

* adding JWT auth to anomaly detection client, some minor refactorings

* added missing license

* added provider, refactorings

* fixing small bugs

* set smaller default expiration

* using the correct OpenSearch distro for the erchitecture

* added config options

* small refactorings, fixing tests, adding dependencies for running tests from inside IntelliJ

* fixing import to correct Duration class

* removing unnecessary debug output

* fixing tests

* fixing tests

* adding JWT to Cluster test

* fixing path

* fixing path problems

* fix architecture logic for DatanodeContainerizedBackend

* fixing path problems

* fixing JWT settings in tests

* fixing JWT settings in tests

* fixing cluster test

* fixing cluster test

* fixing cluster test

* adding missing jwt token

* small refactoring to force thread-safety on creation

* the datanode uses mongodb - so the closing sequence needs to be adjusted

* moving config changes into config file, keep only change that has to be done by code

* adding breaking change info for JWT and clock synchronization.

* renaming config settings

* renaming config settings

* removed debug settings that are no longer in use

* renamed provider/annotation to be more precise

* lowering log level

* smaller refactorings/renamings

* keep config change in code until PR is merged, remove code in a follow-up PR

* moved changelog file to correct folder

* clock synchronsation

Co-authored-by: Dennis Oelkers <dennis@graylog.com>

* added jwt auth into changes after merge

* upped the timeout

* log curl connection information in DatanodeOpensearchWait

* replacing with jwt auth

* changing wait strategy

* fixing imports

* remove uname/pwd from opensearch rest base url

* propagate jwt token provider to http rest client callback, obtain fresh token every time

* inject IndexerJwtAuthTokenProvider in DatanodeConfigurationProvider

* remove rest uname/pwd from datanode configuration

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
Co-authored-by: Dennis Oelkers <dennis@graylog.com>
2023-09-12 11:48:44 +02:00
Tomas Dvorak
aa1d69505f Update opensearch to 2.9.0 in matrix integration tests (#16294)
* Update opensearch to 2.9.0 in matrix integration tests

* Update datanode to 2.9.0 opensearch

* workaround for opensearch number_of_replicas in single-node mode

* trigger the fix of replica numbers in opensearch only for 2.9.0 and higher releases

* better hostname handling for DatanodeClusterIT

* log all request/responses for DatanodeClusterIT

* add response logging to DatanodeClusterIT

* print also logs from node B in DatanodeClusterIT in case of error

* fixed DatanodeClusterIT, cached datanode images, synchronized maven packaging

* better handling of DatanodeClusterIT waiting for cluster status

* code cleanup

* log last recorded exception in case of failed waiting for datanode opensearch

* log state machine transitions

* increase waiting timeout for DatanodeClusterIT

* print shard info in case of datanode cluster failure

* safer shard info debug in DatanodeOpensearchWait

* disable scluster.routing.allocation.disk.threshold for datanode integration tests (causes problems in github actions)

---------

Co-authored-by: Dennis Oelkers <dennis@graylog.com>
2023-09-08 14:12:58 +02:00
Jan Heise
af73ea391b DataNode: adding a default config location to avoid NPEs (#16381)
* adding a default

* fixing default paths

* fixing default paths
2023-09-06 11:07:02 +02:00
Tomas Dvorak
d16c68f1a2 close networks and containers in tests (#16375) 2023-09-05 16:25:59 +02:00
Tomas Dvorak
4c74e9639a add datanode IT to verify cluster add/remove (#16285)
* add datanode IT to verify cluster add/remove

* fixed import
2023-08-30 15:07:25 +02:00
Tomas Dvorak
1a8f5f7df8 typesafe handling of prompts in command line console usages (#16254)
* typesafe handling of prompts in command line console usages

* fixed test
2023-08-25 09:43:31 +02:00
Tomas Dvorak
716f71cf46 Adapt DatanodeClusterIT for full cert setup of all nodes (#16245)
* Adapt DatanodeClusterIT for full cert setup of all nodes

* generated passwords for DatanodeSecuritySetupIT, better truststore

* datanode integration tests code cleanup

* code cleanup
2023-08-24 12:44:03 +02:00
Tomas Dvorak
3b74e30193 rest username and passwords extracted to constants #16009 (#16156) 2023-08-18 13:23:30 +02:00
Tomas Dvorak
18e326b8a1 make cluster initial nodes in datanode configurable (#16146)
* make cluster initial nodes in datanode configurable

* added changelog

* removed forgotten debug logging

* returned opensearch_network_host config for containerized datanode tests
2023-08-10 14:29:48 +02:00
luk-kaminski
e7025a9da8 Insecure startup of OS in datanode only if explicitly configured (#16108)
* Insecure startup of OS in datanode only if explicitly configured

* Data node can be started without starting OS, just to be discovered by pre-flight mode
2023-08-07 17:21:08 +02:00
Tomas Dvorak
e39a53ed2d Refactoring/opensearch security setup (#16087)
* Start datanode jersey only after ssl configuration resolved, listen to change events

* Adapted DatanodeSecuritySetupIT to work with https version of the datanode interface

* simplify hostnames in DatanodeSecuritySetupIT

* code cleanup

* added changelog

* code cleanup

* disable security plugin and perf analyzer in matrix tests opensearch

* Fixed datanode jersey service

* Fixed opensearch instance env

* Opensearch security setup refactored

* code cleanup

* removed commented out code from datanodes JerseyService

* add fqdn to the http cert in the DatanodeSecuritySetupIT

* configure truststore only if the security is enabled

* code cleanup

* reintroduced root certificate finder

* adjusted class and methods visibility of RootCertificateFinder
2023-08-02 14:33:50 +02:00
Tomas Dvorak
b4c2f1f90c Start datanode jersey only after ssl configuration resolved, listen to change events (#16058)
* Start datanode jersey only after ssl configuration resolved, listen to change events

* Adapted DatanodeSecuritySetupIT to work with https version of the datanode interface

* simplify hostnames in DatanodeSecuritySetupIT

* code cleanup

* added changelog

* code cleanup

* disable security plugin and perf analyzer in matrix tests opensearch

* Fixed datanode jersey service

* Fixed opensearch instance env

* add fqdn to the http cert in the DatanodeSecuritySetupIT
2023-08-02 10:46:08 +02:00
Tomas Dvorak
32b59c3a87 Add suffix to docker datanode container name, for parallel runs (#16017) 2023-07-21 17:26:43 +02:00
Jan Heise
34d5b47d2a Include Graylog CA into places where we connect to the DataNode (#15925)
* first version adding gl CA

* adding custom trutstore

* fixed SSLContext

* fixed SSLContext for connectivity check

* fix comments

* fixed imports

* reverting altnames tmp change

* reverting altnames tmp change

* fixed preflightconfig, fixed hostname-verifier

* added credentials to target string, set hostname

* added credentials from target string

* only add TrustManager if https is requested

* fixing tests

* add another alt name

* change creation of restBaseUrl

* DatanodeSecuritySetupIT adaptation for stable hostname of the datanode

* trying to fix naming/binding for docker

* adding another alt name

* added s to http

* changing exception

* more debug output

* change test

* change test

* adding debug

* switch back to http

* more debugging

* more debugging

* added exception to retryer

* fixed boolean eval

* going to the next step on FAILED, too

* fixing if clause

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* removed wrong credentials provider

* added name verifying

* fix alt name handling

* removed unneccessary hostname verifier

* reverted DefaultX509TrustManager

* removed link to DefaultX509TrustManager because it's used in different contexts, singleton for SSL related stuff so we don't instantiate it all the time

* full rollback DefaultX509TrustManager

* reverted change on logging

* revert VersionProbe, unnecessary changes

* DatanodeSecuritySetupIT fixed, separated bind address and hostname

* changed to lambda

* changed to lambda

* small refactorings in csrsigner

* added test for CustomCAX509TrustManager

* added binding for CaService into Preflight

* fixing bindings

* fixing bindings

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
2023-07-21 12:59:55 +02:00
Tomas Dvorak
9105655645 Code cleanup around opensearch process info (#15709)
* Code cleanup around opensearch process info

* Code cleanup

* fixed naming and test

* fixed test

* fixed test

* code cleanup

* code cleanup
2023-06-19 06:36:32 +02:00
luk-kaminski
f9dc221627 Change ConfigProvider, so that it stops using PEM files, and starts u… (#15460)
* Change ConfigProvider, so that it stops using PEM files, and starts using PKCS12 files.
Refactoring, splitting the functionality to different classes.
Some config changes that make things work in IDEA.
Reusable truststore.
Truststore stores only root certificates.

* Simpler root certificate finding

* Dir Sync does not remove cert files

* Removed unnecessary default config changes. Cleared confusing certificate copying and unnecessary certificate duplication in 2 folders

* Truststore path created outside of TruststoreCreator. Root certificate found in a different way, without considering its place in the certificate chain

* Fixed log message

* Integration test fixed

* Certs are not an exception in FullDirSync. Introduced second config location as a step towards final configuration. Certificates are moved between locations, as it was done previously

* Fixed a test. Minor refactoring.

* Config location has no default value. It is checked if it is provided, as it is required
2023-05-16 08:38:03 +02:00
luk-kaminski
b48335a7dd Move certutil code to graylog-server (#15193) 2023-04-13 08:03:01 +02:00
Jan Heise
94d8dc7802 Additional Logging to track down eventual errors in IT tests (#14863)
* reverting preemptive auth using restassured

* add possibility to set a minimum error code (if you don't expect a 4xx for example)

* upped log level

* adding preemptive back in

* Update GraylogBackend.java

* remove preemptive()
2023-03-09 12:14:05 +01:00
Jan Heise
0b5d6b0307 Add Preemptive Auth to IT Tests (#14833)
* preemptive auth during IT tests everywhere

* removed unneccessary log
2023-03-02 17:03:03 +01:00
Tomas Dvorak
21e55cbcb6 Initial Data Node version PR (#14417)
Co-authored-by: Jan Heise <jan.heise@graylog.com>
2023-02-27 13:11:24 +01:00