Commit graph

10117 commits

Author SHA1 Message Date
Ry Biesemeyer
0603651ba7
Secure API (Backport to 7.x) (#13342)
* settings: add "deprecated alias" support

A deprecated alias provides a path for renaming a setting.

 - When a deprecated alias is set on its own, a deprecation notice is emitted
   but fetching the canonical setting value will reflect the value set with the
   deprecated alias.
 - When both the canonical setting (new name) and the deprecated alias (old
   name) are specified, it is an error condition.
 - When the value of the deprecated alias is queried, a warning is emitted to
   the logger and only the value explicitly set to the deprecated alias is
   returned.

Additionally, some relevant cleanup is also included:

 - Starting Logstash with invalid settings no longer results in the obtuse "An
   unexpected error occurred" with backtrace and exception data obscuring the
   issue. Instead, a simple message is emitted indicating that the settings are
   invalid along with the originating exception's message.
 - The various settings implementations share a common logger, instead of each
   implementation class providing its own. This is aimed to reduce noise from
   the logs and to ensure specs validating logging do not need to tie so
   closely to implementation details.

* settings: add password-wrapped setting

* settings: make any setting type capable of being nullable

* settings: add `Settings#names` to power programatic iteration

* cli: route CLI-flag deprecations in to deprecation logger

* settings: group API-related settings under `api.*`

retains deprecated aliases, and is fully backward-compatible.

* webserver: cleanup orphaned attr accessors for never-set ivars

* api: pull settings extraction down from agent

This net-no-change refactor introduces a new method `WebServer#from_settings`
that bridges the gap between Logstash settings and Puma-related options, so
that future additions to the API settings don't add complexity to the Agent.

It also has the benefit of initializing the API Rack App and just ONCE, instead
of once per attempted HTTP port.

* api: add optional TLS/SSL

* docs: reference API security settings

* api: when configured securely, bind to all available interfaces by default

* cleanup: remove unused cert artifacts

* tests: generate fresh webserver certificates

* certs: actually add the binary keystores 🤦
2021-10-19 14:13:37 -07:00
Rob Bavey
0f8296870b
Backport PR #13339 to 7.x: Temporarily pin racc to 1.5.2 to fix build (#13340)
Backport PR #13339 to 7.x branch. Original message:

Pin `racc` to `1.5.2` as racc-1.6.0 doesn't have JAVA counterpart (yet)
SEE: https://github.com/ruby/racc/issues/172
2021-10-19 12:15:09 -04:00
Andrea Selva
7202c5860e
Updates the clauses used to filter out from stderr captured messages (#13336)
Fixes an integration test that expects some output on the stderr.
With PR #13207 was added a deprecation notice to inform the user about the removal of support for JAVA_HOME. This notice is present only on 7.x and that console output needs to be removed in a test that verify installation of plugins.
2021-10-19 10:41:12 +02:00
Andrea Selva
2e6ed1d7e4
Fixes to build and run Logstah on JDK 17 (#13306) (#13331)
Backport #13306 to branch 7.x

(cherry picked from commit 7395641a43)

----

This commit applies all the changes needed to run Logstash on JDK 17:
- opens access to module java.base for packages sun.nio.ch and java.io to run the application and to execute the tests
- removes SecurityManager classes used during Logstash startup
- fix exception type catched in JavaKeyStore tampering test

Related to meta issue #13306
2021-10-18 16:38:38 +02:00
Andrea Selva
1c80c86cdd
Update JDK matrix to include JDK17: OpenJDK, AdoptiumJDK and Zulu (#13307) (#13330)
Clean backport of #13307 to branch 7.x
(cherry picked from commit 949b4a0cef)
2021-10-18 16:37:46 +02:00
Rob Bavey
a2d45ccee6
Backport PR #13316 to 7.x: Fix Elasticsearch integration test to use specified JDK (#13323)
Backport PR #13316 to 7.x branch. Original message:

Sets `LS_JAVA_HOME` of the spawned logstash to use the same `java.home`
that the test is running under, rather than default to the system JDK, which
would result in the spawned logstash running under a different JDK to that
intended in the test
2021-10-15 15:22:50 -04:00
Karen Metts
e1b3445ad1
Doc: Add link to pq info from troubleshooting topic (#13327)
Backports #13320 to 7.x
Fixes: #13158
Related: #13173
2021-10-15 15:13:40 -04:00
Karen Metts
26e01b8b50
Doc: Fix templating error in integration plugin header (#13325)
Backports #13324 to 7.x
2021-10-15 14:05:39 -04:00
Karen Metts
6f781e6ab4
Doc: Expand content for memqueue (#13317) (#13321)
Co-authored-by: Ry Biesemeyer <ry.biesemeyer@elastic.co>
2021-10-14 20:03:49 -04:00
João Duarte
a46efe4df8
[DOC] Clarify the scope of environment variable expansion (#13299) (#13311)
Environment variable expansion only works in plugin parameters, not in conditionals.
For more on this limitation see https://github.com/elastic/logstash/issues/5115

(cherry picked from commit 096eb7ac48)
2021-10-13 14:23:27 +01:00
João Duarte
6983129f47
don't require mutate filter on remove_spec (#13292) (#13309)
(cherry picked from commit f70350ba12)
2021-10-13 14:22:49 +01:00
Andres Rodriguez
fcbfdc87eb
Add pipeline.ordered setting for docker image (#13304)
Adds the pipeline.ordered setting to env2yml.go for the docker image.

Closes: #13293
(cherry picked from commit 9f45087d80)
2021-10-07 16:54:55 -04:00
kaisecheng
f59bd179dc
fix plugin installation script (#13289) (#13290)
This commit requires `set`, as bundler #expand_logstash_mixin_dependencies call `to_set`
Fixed: #13281
2021-10-07 17:13:29 +02:00
Karen Metts
d7b5e17841
Doc: Fix list formatting (#13296)
Backports #13294 to 7.x
2021-10-07 10:15:55 -04:00
Karen Metts
360e8fca12
Doc: Rework PQ content (#13284)
Backports #13173 to 7.x

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2021-10-06 19:59:45 -04:00
Karen Metts
7495df6ae8
Doc: Remove outdated info and folder (#13282)
Backports #13259 to 7.x
2021-10-06 12:37:45 -04:00
kaisecheng
6af35b5b9c
Replace Faraday to Manticore to get rid of jruby-openssl verification error of Let's Encrypt cross-signed DST Root CA X3 (#13273) (#13279)
Fixed: #13278
2021-10-06 12:16:41 +02:00
Karen Metts
c3fcf2d5f6
Doc: Add topic and expand info for in-memory queue (#13276)
Backports #13246 to 7.x

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2021-10-05 18:41:31 -04:00
kaisecheng
e3eede52e1
Fix plugin manager test that fail to fetch dependency (#13270) (#13271)
remove broken endpoint
Fixed: #13218
2021-10-05 14:09:58 +02:00
kaisecheng
f675a39841
unlock ecs_compatibility_support version in plugin update (#13218) (#13268)
This commit fixes the `logstash-plugin update` command which fail to update plugin
that depends on a new version of logstash-mixin-ecs_compatibility_support.
It resolves logstash-* dependencies and puts them in bundler update command.
Fixed: #13181
2021-10-04 15:33:56 +02:00
Karen Metts
7481112610
Doc: Add shared attribute for messaging ecs default info (#13265)
Backports #13083 to 7.x
Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2021-10-01 16:30:01 -04:00
kaisecheng
1f61038456
update golang image to 1.17.1(#13260) (#13262)
update golang image to 1.17.1 to get rid of expired DST Root CA X3
disable download manager test cases to silent Faraday::SSLError

Fixed: #13261

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2021-10-01 19:29:33 +02:00
kaisecheng
2be6cb326b
avoid duplication of heading and index entry in release notes (#13192) (#13254)
Fixed: #13192
2021-09-29 14:37:46 +02:00
kaisecheng
77a6af1ba1
geoip integrate air-gapped bootstrap script (#13104) (#13251)
This PR integrates Elasticsearch bootstrap script to help users keep Logstah geoip plugin run without online update check.
Add `xpack.geoip.download.endpoint` option to config geoip database service endpoint.
Users can point to `http://localhost:8080/overview.json` when using the script to bootstrap nginx docker
2021-09-28 16:23:51 +02:00
Rob Bavey
aeb3dc2cf3
Backport PR#13248 to 7.x: Fix kafka download link for integration tests (#13250)
Backport PR #13248 to 7.x branch. Original Message:

Fix kafka download link for integration tests

(cherry picked from commit aa1aa8e)
2021-09-27 12:17:11 -04:00
kaisecheng
ae80fd27a3
Forward port of 7.15.0 release notes to 7.x (#13239)
Co-authored-by: Logstash Machine <43502315+logstashmachine@users.noreply.github.com>
2021-09-22 15:37:09 +01:00
Karen Metts
d3b92d58cd
Doc: Add note and example for date math in conditionals (#13242)
Backports #13199 to 7.x
Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2021-09-21 15:40:39 -04:00
Andrea Selva
eb776ca411
Forward port of 7.14.2 release notes to 7.x (#13235) 2021-09-21 10:33:45 +02:00
kaisecheng
050eb98f0b
fix geoip external DB shutdown nil exception (#13224) (#13225)
Fixed: #13208
2021-09-15 15:30:52 +01:00
Andrea Selva
82993fa6f1
[backport 7.x] Use LS_JAVA_HOME in favor of JAVA_HOME #12725 (#13213)
Backport of #13204 #13207 to 7.x branch, introduces the LS_JAVA_HOME as preferred environment variable over JAVA_HOME which is deprecated.
2021-09-08 15:20:34 +02:00
Andrea Selva
959248ac4d
[backport 7.x] Gradle 7 updates, issue #13177 (#13212)
This commit is a backport of three PRs #13182 #13183 #13184
Mainly it switched the Gradle to version 7 and applies fixes to make it run.
2021-09-08 15:16:52 +02:00
Andrea Selva
a27e109bd4
[backport 7.x] Added rexml notice to license list (#13209) (#13210)
(cherry picked from commit 6ed2eea890)
2021-09-07 17:30:21 +02:00
Andrea Selva
6b6b3f37b0
Forward port of 7.14.1 release notes, from PR #13174 (#13189) 2021-09-01 12:46:34 +02:00
Andrea Selva
c49d5f0152
[backport 7.x] Update bundled JDK to 11.0.12+7 (#13185) (#13186)
Clean backport of #13185 to branch 7.x
(cherry picked from commit ebb9e04d14)
2021-08-31 17:39:19 +02:00
kaisecheng
3e9cc40142
add the missing logstash config supported by env2yaml for docker (#13178) (#13180)
Fixed: #13138
2021-08-30 18:09:03 +01:00
Karol Bucek
6a56b96f9b
Backport #13164: Test: improve monitoring api logging asserts (#13169) 2021-08-25 18:51:00 +02:00
Karol Bucek
8763e51f86
Backport #13036 to 7.x: Refactor: avoid global mutex on ecs_compatibility (#13163) 2021-08-24 12:57:57 +02:00
Rob Bavey
adb149c66d
Remove dependency:bundler task (#13146)
Already done on master in #12017, this is unnecessary as it is already being done
by installBundler.
2021-08-18 11:17:36 -04:00
Rob Bavey
c36e475abf
Bump version to 7.16.0 (#13147) 2021-08-18 10:56:46 -04:00
Rob Bavey
2ac869a9c4
Backport PR #13015 to 7.x: Bundler: freeze lockfile on run, and "norm… (#13140)
* Backport PR #13015 to 7.x: Bundler: freeze lockfile on run, and "normalize" platform on plugin changes

Backport PR #13015 to 7.x branch. Original Message:

This PR enables the upgrade of bundler to the latest version.

Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`.

This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM.

This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg

```
gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka'
```

to facilitate quick and simple plugin testing.

This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages.

This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests.

* Updated Bundler to latest version
* Ensured that `Gemfile.lock` are appropriately frozen
* Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment

(cherry picked from commit 4707cb)

* Remove code pinning bundler to ~> 1.17
2021-08-17 20:31:26 -04:00
Rob Bavey
cc06c5d8f5
Backport PR #13005 to 7.x: update fpm to allow pkg creation on jdk11+jruby 9.2 (#13005) (#13144)
Backport PR #13005 to 7.x branch. Original Message:

* fpm to 1.13.0 which allows building packages with java 11 + jruby 9.2
* childprocess to 4.x + remove monkey patches
* clamp to 1.x to unlock fpm 1.13.0

(cherry picked from commit 7390b64)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2021-08-17 18:21:42 -04:00
Karen Metts
811020b83b
Doc: Forwardport aarch64 support note (#13132) to 7.x release notes (#13137) 2021-08-16 18:06:43 -04:00
Andrea Selva
24314350ab
[bacport 7.x] Update Snakeyaml version to 1.29 (#13129) (#13134)
Snakeyaml is used only in the build chain, and it's not packaged with Logstash

(cherry picked from commit a7f6c01a3a)
2021-08-16 14:29:07 +02:00
Karen Metts
b59e97c99c
Release notes for 7.14.0 (#13133)
Forwardports 7.14.0 release notes (#13089) to 7.x branch
2021-08-13 19:56:29 -04:00
Andrea Selva
84dbf3e310
[backport 7.x] Added faraday-* and ruby2_keywords notices to licences list (#13126) (#13128)
(cherry picked from commit 542dce81a7)
2021-08-13 14:13:58 +02:00
Karol Bucek
af82b3c87d
Backport Docs: fix java filter unit test link (#13123)
Fixes #11519

Co-authored-by: Fabien Baligand <fbaligand@gmail.com>
2021-08-10 20:25:56 +02:00
Karen Metts
725799d201
Doc: Enhance and expand DLQ docs 7.x (#13099)
Backports: #12959
Fixes: #12923
Related: #10493
2021-07-22 16:44:17 -04:00
Karen Metts
e0908f55a9
Doc: Fix typo and adjust keystore text 7.x #13095 2021-07-21 10:54:54 -04:00
Ry Biesemeyer
e779535ae7
doc: add pipeline.ecs_compatibility docs (#12421) (#13091)
(cherry picked from commit 4056cb1b9a)
2021-07-20 15:17:17 -07:00
Andrea Selva
05a826a58b
Forward port of 7.13.4 release notes to 7.x (#13086)
Forward port of 7.13.4 release notes to 7.x

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2021-07-20 18:29:16 +02:00