-
Notifications
You must be signed in to change notification settings - Fork 1.8k
network_verifier: plugin New Network Verifier plugin type #11155
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
Open
Craig-Robb-GGL
wants to merge
33
commits into
fluent:master
Choose a base branch
from
Craig-Robb-GGL:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
f9e15e8
network_verifier: add new Network Verifier plugin type
Craig-Robb-GGL dbd740f
cmakelists: added network verifier plugin register macro to cmakelists
Craig-Robb-GGL b0ff1c7
config: added network_verifier context initialization from config
Craig-Robb-GGL 97821f5
tls: allow assignment of a network_verifier instance to a tls context
Craig-Robb-GGL d28e22a
input: add network_verifier property and pass to TLS context
Craig-Robb-GGL bfcb6ce
output: add network_verifier property and pass to TLS context
Craig-Robb-GGL 8220be9
upstream: add network_verifier property and pass to TLS context
Craig-Robb-GGL 1705309
s3: updated for network_verifier argument in tls_context_create function
Craig-Robb-GGL 976a7eb
config_format: added yaml parsing for the network_verifier plugins
Craig-Robb-GGL 634388d
tests: updated tests for network_verifier argument in tls_context_cre…
Craig-Robb-GGL 226e9cd
kubernetes: updated for network_verifier argument in tls_context_crea…
Craig-Robb-GGL 1d3efdd
nightfall: updated for network_verifier argument in tls_context_creat…
Craig-Robb-GGL 644f965
azure: updated for network_verifier argument in tls_context_create fu…
Craig-Robb-GGL 60da772
kinesis: updated for network_verifier argument in tls_context_create …
Craig-Robb-GGL 4f63896
bigquery: updated for network_verifier argument in tls_context_create…
Craig-Robb-GGL 0945db4
cloudwatch: updated for network_verifier argument in tls_context_crea…
Craig-Robb-GGL afcc339
es_conf: updated for network_verifier argument in tls_context_create …
Craig-Robb-GGL ffe68f5
os_conf: updated for network_verifier argument in tls_context_create …
Craig-Robb-GGL 6fc7c55
aws_credential: updated for network_verifier argument in tls_context_…
Craig-Robb-GGL 763a7ca
oauth2: updated for network_verifier argument in tls_context_create f…
Craig-Robb-GGL 21e8e52
engine: call init / exit for network_verifier plugin instances on engine
Craig-Robb-GGL 353e55a
reload: check network_verifier properties on hot reload
Craig-Robb-GGL 33ca71d
plugin: added network_verifier type for loading of plugin
Craig-Robb-GGL 53e52e8
connection: added Network Verifier to the connection interface.
Craig-Robb-GGL 3f16e79
stream: Added a pointer to Network Verifier instance to be able to no…
Craig-Robb-GGL 9ae7491
io: notify Network Verifier on network issues
Craig-Robb-GGL 6d4741e
Merge pull request #2 from Craig-Robb-GGL/craigr/network_verifier_plu…
Craig-Robb-GGL 61fac85
output: added flb_network_verifier header file to have network_verifi…
Craig-Robb-GGL b30d592
engine: cleanup network_verifiers after all input plugins are exited
Craig-Robb-GGL d9a4b44
network_verifier: add null alias check when searching for instance
Craig-Robb-GGL 0a4e630
network: report a -1 error code when failing to connect to endpoint
Craig-Robb-GGL 2c60d5a
reload: updated comment to use consistent terminology
Craig-Robb-GGL 0f90346
Merge pull request #3 from Craig-Robb-GGL/craigr/flb-network-verifier…
Craig-Robb-GGL 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
|
|
||
| /* Fluent Bit | ||
| * ========== | ||
| * Copyright (C) 2015-2024 The Fluent Bit Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef FLB_NETWORK_VERIFIER_H | ||
| #define FLB_NETWORK_VERIFIER_H | ||
|
|
||
| #include <fluent-bit/flb_info.h> | ||
| #include <fluent-bit/flb_config.h> | ||
| #include <fluent-bit/flb_config_map.h> | ||
|
|
||
| #include <openssl/types.h> | ||
|
|
||
| #define FLB_X509_STORE_EX_INDEX 0 | ||
|
|
||
| struct flb_network_verifier_instance; | ||
|
|
||
| struct flb_network_verifier_plugin { | ||
| char *name; /* Name */ | ||
| char *description; /* Description */ | ||
|
|
||
| /* Config map */ | ||
| struct flb_config_map *config_map; | ||
|
|
||
| /* Callbacks */ | ||
| int (*cb_init) (struct flb_network_verifier_instance *, struct flb_config *); | ||
| int (*cb_verify_tls) (int, X509_STORE_CTX *); | ||
| int (*cb_connection_failure) (struct flb_network_verifier_instance*, const char*, int, int, const char*); | ||
| int (*cb_exit) (void *, struct flb_config *); | ||
|
|
||
| struct mk_list _head; /* Link to parent list (config->network_verifier_plugins) */ | ||
| }; | ||
|
|
||
| /* | ||
| * Each initialized plugin must have an instance, the same plugin may be | ||
| * loaded more than one time. | ||
| * | ||
| * An instance will contain basic fixed plugin data while also | ||
| * allowing for plugin context data, generated when the plugin is invoked. | ||
| */ | ||
| struct flb_network_verifier_instance { | ||
| int id; /* instance id */ | ||
| int log_level; /* instance log level */ | ||
| char name[32]; /* numbered name */ | ||
| char *alias; /* alias name */ | ||
| void *context; /* Instance local context */ | ||
| struct flb_network_verifier_plugin *plugin; /* original plugin */ | ||
|
|
||
| struct mk_list properties; /* config properties */ | ||
| struct mk_list *config_map; /* configuration map */ | ||
|
|
||
| /* Keep a reference to the original context this instance belongs to */ | ||
| const struct flb_config *config; | ||
|
|
||
| struct mk_list _head; /* config->network_verifiers */ | ||
| }; | ||
|
|
||
| struct flb_network_verifier_instance *flb_network_verifier_new( | ||
| struct flb_config *config, const char *name); | ||
|
|
||
| const char *flb_network_verifier_get_alias( | ||
| struct flb_network_verifier_instance *ins); | ||
|
|
||
| int flb_network_verifier_set_property( | ||
| struct flb_network_verifier_instance *ins, const char *k, const char *v); | ||
| int flb_network_verifier_plugin_property_check( | ||
| struct flb_network_verifier_instance *ins, | ||
| struct flb_config *config); | ||
| int flb_network_verifier_init_all(struct flb_config *config); | ||
| void flb_network_verifier_exit(struct flb_config *config); | ||
|
|
||
| void flb_network_verifier_instance_destroy( | ||
| struct flb_network_verifier_instance *ins); | ||
|
|
||
| const struct flb_network_verifier_instance *find_network_verifier_instance( | ||
| struct flb_config *config, | ||
| const char* alias); | ||
|
|
||
|
|
||
| #endif |
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,47 @@ | ||
| /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
|
|
||
| /* Fluent Bit | ||
| * ========== | ||
| * Copyright (C) 2015-2024 The Fluent Bit Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef FLB_NETWORK_VERIFIER_PLUGIN_H | ||
| #define FLB_NETWORK_VERIFIER_PLUGIN_H | ||
|
|
||
| #include <fluent-bit/flb_info.h> | ||
| #include <fluent-bit/flb_network_verifier.h> | ||
| #include <fluent-bit/flb_log.h> | ||
|
|
||
| #define flb_plg_log(ctx, level, fmt, ...) \ | ||
| if (flb_log_check_level(ctx->log_level, level)) \ | ||
| flb_log_print(level, NULL, 0, "[network_verifier:%s:%s] " fmt, \ | ||
| ctx->plugin->name, \ | ||
| flb_network_verifier_get_alias(ctx), ##__VA_ARGS__) | ||
|
|
||
| #define flb_plg_error(ctx, fmt, ...) \ | ||
| flb_plg_log(ctx, FLB_LOG_ERROR, fmt, ##__VA_ARGS__) | ||
|
|
||
| #define flb_plg_warn(ctx, fmt, ...) \ | ||
| flb_plg_log(ctx, FLB_LOG_WARN, fmt, ##__VA_ARGS__) | ||
|
|
||
| #define flb_plg_info(ctx, fmt, ...) \ | ||
| flb_plg_log(ctx, FLB_LOG_INFO, fmt, ##__VA_ARGS__) | ||
|
|
||
| #define flb_plg_debug(ctx, fmt, ...) \ | ||
| flb_plg_log(ctx, FLB_LOG_DEBUG, fmt, ##__VA_ARGS__) | ||
|
|
||
| #define flb_plg_trace(ctx, fmt, ...) \ | ||
| flb_plg_log(ctx, FLB_LOG_TRACE, fmt, ##__VA_ARGS__) | ||
| #endif |
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
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.