-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request from GHSA-g96c-x7rh-99r3
* Add support for randomizing DNS Lookup source port * Clarify purpose of lease * Skip initial refresh Previously, the pool was being refreshed immediately upon initialization. Now, the refresh waits until the `poolRefreshSeconds` duration has elapsed. * Ensure thread safety, skip unused poller refreshes * Add change log
- Loading branch information
Dan Torrey
committed
Jul 5, 2023
1 parent
2b03697
commit 466af81
Showing
8 changed files
with
460 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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,2 @@ | ||
| type = "security" | ||
| message = "Fix insecure source port usage for DNS Lookup adapter queries. [GHSA-g96c-x7rh-99r3](https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-g96c-x7rh-99r3)" |
This file contains 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 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 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
46 changes: 46 additions & 0 deletions
46
...r/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsLookupAdapterConfiguration.java
This file contains 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,46 @@ | ||
| /* | ||
| * Copyright (C) 2020 Graylog, Inc. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the Server Side Public License, version 1, | ||
| * as published by MongoDB, Inc. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * Server Side Public License for more details. | ||
| * | ||
| * You should have received a copy of the Server Side Public License | ||
| * along with this program. If not, see | ||
| * <http://www.mongodb.com/licensing/server-side-public-license>. | ||
| */ | ||
| package org.graylog2.lookup.adapters.dnslookup; | ||
|
|
||
| import com.github.joschi.jadconfig.Parameter; | ||
| import com.github.joschi.jadconfig.util.Duration; | ||
| import com.github.joschi.jadconfig.validators.PositiveDurationValidator; | ||
| import com.github.joschi.jadconfig.validators.PositiveIntegerValidator; | ||
| import org.graylog2.plugin.PluginConfigBean; | ||
|
|
||
| public class DnsLookupAdapterConfiguration implements PluginConfigBean { | ||
| private static final String PREFIX = "dns_lookup_adapter_"; | ||
| protected static final String RESOLVER_POOL_SIZE = PREFIX + "resolver_pool_size"; | ||
| protected static final String RESOLVER_POOL_REFRESH_INTERVAL = PREFIX + "resolver_pool_refresh_interval"; | ||
|
|
||
| protected static final int DEFAULT_POOL_SIZE = 10; | ||
| protected static final int DEFAULT_REFRESH_INTERVAL_SECONDS = 300; | ||
|
|
||
| @Parameter(value = RESOLVER_POOL_SIZE, validators = PositiveIntegerValidator.class) | ||
| private int poolSize = DEFAULT_POOL_SIZE; | ||
|
|
||
| @Parameter(value = RESOLVER_POOL_REFRESH_INTERVAL, validators = PositiveDurationValidator.class) | ||
| private Duration poolRefreshInterval = Duration.seconds(DEFAULT_REFRESH_INTERVAL_SECONDS); | ||
|
|
||
| public int getPoolSize() { | ||
| return poolSize; | ||
| } | ||
|
|
||
| public Duration getPoolRefreshInterval() { | ||
| return poolRefreshInterval; | ||
| } | ||
| } |
Oops, something went wrong.