Commit Graph

36 Commits

Author SHA1 Message Date
Jan Heise
d12a6dd478 DataNode: removing the dependency to the data_dir (#18483)
* removing the dependency to the data_dir

* removing the dependency to the data_dir

* adding native lib dir
2024-03-06 15:04:16 +01:00
Tomas Dvorak
e620eeb59d Support for searchable snapshots in datanode (#18357)
* Support for searchable snapshots in datanode

* Added changelog

* Code cleanup, extracted s3 repository configuration

* fixed installing of s3 repo plugin

* code cleanup

* Install opensearch plugins from predownloaded zip archives

* fixed configuration key

* output datanode logs in DatanodeSearchableSnapshotsIT if startup fails

* transfer predownloaded opensearch plugins to the datanode docker image

* Set default node.search.cache.size to 10gb

* javadoc, code cleanup

* code cleanup

* fix s3 configuration enabled check, added test

* Add md5 checksum to the s3 repository download
2024-02-27 10:18:58 +01:00
Tomas Dvorak
ebf84b988e Propagate path.repo in datanode for filesystem snapshots (#18369)
* Propagate path.repo in datanode for filesystem snapshots

* Added changelog
2024-02-26 12:42:21 +01:00
Jan Heise
26aab20455 DataNode: Add max_clause_count default (#18354)
* add max_clause_count default

* add changelog
2024-02-23 13:38:23 +01:00
Jan Heise
4044665c9b DataNode: rename cluster manager property (#18342)
* the original property has been renamed inside OpenSearch, these changes update

* fix changelog file

* fix naming
2024-02-21 16:57:56 +01:00
Othello Maurer
813203263b Restrict classes allowed for cluster config and event types (#18165)
Add a new safe_classes configuration option to restrict the classes allowed to be used
as cluster config and event types.
The configuration option allows to specify a comma-separated set of prefixes matched
against the fully qualified class name.

For now, the default value for the configuration is org.graylog.,org.graylog2., which will
allow all classes that Graylog maintains.

This should work out of the box for almost all setups. Changing the default value might
only be necessary if external plugins require cluster config or event types outside the
"org.graylog." or "org.graylog2." namespaces. If that is the case, the configuration setting
can be adjusted to cover this use case, e.b. by setting it to

    safe_classes = org.graylog.,org.graylog2.,custom.plugin.namespace.

if said classes are located within the custom.plugin.namespace package.

Refs: https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-p6gg-5hf4-4rgj
2024-02-06 15:34:55 +01:00
Matthias Oesterheld
3f1e6ba2b9 add search functionality for data streams (#17988)
* add fields

* refactor data stream functionality into DataStreamService

* add DataStreamService test

* Remove StreamService from IndexFieldTypesService (dependency simplification)

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
2024-01-24 09:35:58 +01:00
Matthias Oesterheld
415cd73080 Add functionality to create data streams (#17910)
* Create Data Stream template, prepare ism policy

* add ism

* create ism and collect jvm heap as first metric

* change lookup and term query to use data streams

* start moving data stream functionality to graylog

* move data stream management into graylog

* code cleanup, add tests

* better validation, clean up after tests

* additional clean up after IT

* don't remove `index-management` plugin from datanode

* inject ObjectMapper

* change number of replicas from default 1 to 0 for test

* set `number_of_replicas` to 0 for .opendistro-ism-config in test

* replace javax with jakarta classes

* fix integration test

* remove data streams on test cleanup

* set high priority for data stream template
2024-01-17 14:45:19 +01:00
Patrick Mann
a247edca65 Datanode: ensure password_secret meets length requirement (#17719)
* ensure password_secret meets length requirement

* update CL

* update test

* adjusted wording so it references the data node

---------

Co-authored-by: Jan Heise <jan.heise@graylog.com>
2023-12-15 20:53:32 +01:00
Tomas Dvorak
5a9fc45402 Allow configuring exact datanode directories without automatic nodeid subdirs (#17255)
* Allow configuring exact datanode directories without automatic nodeid subdirs

* added changelog

* use proper locking mechanism to create datanode.lock files

* code cleanup

* code cleanup

* removed unused imports

* fixed test

---------

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
2023-11-16 11:26:10 +01:00
Jan Heise
27f79d7913 DataNode: make the cluster name configurable (#17143)
* make the cluster name configurable

* added changelog

* precise, that it's the data node we talk about in the CL

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>

---------

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
2023-11-02 11:06:22 +01:00
Jan Heise
d709ae84da DataNode: using hostname as node name default (#17025)
* using the hostname as the default node-name, if none was specified explicitly

* using the hostname as the default node-name, if none was specified explicitly

* using the hostname as the default node-name, if none was specified explicitly

* nodeName is either set explicitly in the conf file or will be the result of the hostname setting otherwise

* small refactoring
2023-10-24 11:01:20 +02:00
Jan Heise
746ed51e69 node registration on startup (#17003) 2023-10-20 12:15:09 +02:00
Tomas Dvorak
5885cd2432 refactor datanode directories checks, use configuration validators (#16942)
* refactor datanode directories checks, use configuration validators

* comments, error messages

* fix datanode config dir in docker

* force image pull strategy for datanode dev container

* remove image pull strategy

* More detailed DirectoryWritableValidator for datanode

* remove commons dependency from UploadedCertFilesSecureConfiguration
2023-10-20 11:33:08 +02:00
Tomas Dvorak
bede9d3206 Refactored all usages of directories used by datanode and managed opensearch (#16905)
* Refactored all usages of directories used by datanode and managed opensearch

* add datanode directories preflight check

* code cleanup

* fixed OpensearchSecurityConfiguration

* Fixed DatanodeDirectories logging

* code cleanup
2023-10-13 08:16:58 +02:00
Tomas Dvorak
151c4c4b14 datanode distribution provider refactoring (#16867)
* datanode distribution provider refactoring

* postpone opensearch distribution check till preflight checks

* fixd OpensearchBinPreflightCheck
2023-10-12 08:20:31 +02:00
Jan Heise
15a513e01d DataNode: full datanode.conf example (#16808)
* extract (imho) all config vars that should get explained

* adding more explanations

* adding more explanations

* adding more explanations
2023-10-09 08:48:18 +02:00
Jan Heise
65f60bd606 adding a validation method (#16840) 2023-10-06 14:44:42 +02:00
Jan Heise
38b9e9066b DataNode: Simplifying hostname usage Part 2 (#16741)
* simplifying hostname usage part2

* added suppress message

* removed comment
2023-09-29 08:09:33 +02:00
Jan Heise
15d3924130 using the machine's hostname as nodename if none was provided in the config (#16607) 2023-09-22 15:20:59 +02:00
Jan Heise
0364446c1b removing obsolete single-node setting (#16542) 2023-09-19 13:41:54 +02:00
Tomas Dvorak
70d6edc8a2 basic auth for datanode rest api if security enabled (#16446)
* basic auth for datanode rest api if security enabled

* added changelog

* adapted to master changes

* configurable rest admin username in datanode

---------

Co-authored-by: Jan Heise <jan.heise@graylog.com>
2023-09-15 20:52:14 +02:00
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
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
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
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
luk-kaminski
a8f29b0431 New configuration handling. Incomplete manual config ends with error.… (#15784)
* New configuration handling. Incomplete manual config ends with error. Empty config allows to try different config options.

* Trying to reflect functionality responsibilities with better naming
2023-07-04 13:56:22 +02:00
Tomas Dvorak
bc56d397c3 Datanode config separation (#15701)
* Different variants of security configuration (from file, from mongo, insecure).
Encryption/decryption pattern used in practice.

* Reverting temporary changes

* More precise certificate presence check

* Added unit tests for testHasCert() method

* Datanode and opensearch configuration refactored

* code cleanup

* code cleanup

* code cleanup

* Node preflight config service refactored

* restbaseurl moved to OpensearchConfiguration

---------

Co-authored-by: Lukasz Kaminski <lukasz.kaminski@graylog.com>
2023-06-06 14:44:06 +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
Tomas Dvorak
c36a63495d Opensearch dist dir autodetection (#15216)
* Opensearch dist dir autodetection

* Add arm64 as supported architecture for datanode

* Added changelog
2023-04-14 09:53:33 +02:00
Tomas Dvorak
8501714ee8 Update opensearch in datanode to 2.5.0 (#15198)
* Update opensearch in datanode to 2.5.0

* Added changelog
2023-04-13 08:21:14 +02:00
Tomas Dvorak
a84cad55a0 Adapted default configuration, fixed logging, extended datanode.conf template (#15056)
Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>
2023-04-06 17:48:46 +02:00
Jan Heise
e4db603eb6 DataNode: config option to enforce single-node type (#15070)
* adds a config option to force single-node type so that (at least on macOS) the bootstrap checks won't run and fail

* add changelog

* reworded message
2023-03-28 14:30:10 +02:00
Bernd Ahlers
120fae5221 Refactor data-node download and assembly (#14963)
* Refactor data-node download and assembly

- Download OpenSearch aarch64 distribution in addition to x64
- Extract OpenSearch distribution into "target/opensearch/*" instead of
  "bin/download".
- Include OpenSearch distributions in "dist/" instead of "bin/" in
  assembly

* Fix data-node test container creation

* Adjust OpenSearch location for architecture dependent locations

* If the configured location exists, use it

Otherwise, check for architecture dependent distribution directories.

* Switch default config file to locations that work with the tarball

* Rename datanode.jar to graylog-datanode.jar

* Rename datanodectl to graylog-datanode.sh

* Include graylog-datanode.sh in assembly as bin/graylog-datanode

* Add a jvm.options config file

* Add a production log4j2.xml config file

* Use bundled JVM if it exists

* fixed docker image for datanode integration tests

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
2023-03-28 10:49:49 +02: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