-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add Filebeat input httpjson #13546
Add Filebeat input httpjson #13546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made some suggestions. Let me know if you have any questions or want to discuss more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor changes requested. And I left a question for @urso.
jenkins, test this |
Removed the external dependency on httpbin.org. It uses local httptest server now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Just a question and a minor issue.
@andrewkroh Thanks for the approval. I am going to add a headers field to allow extra settings about HTTP headers. |
jenkins, test this |
jenkins, test this |
3 similar comments
jenkins, test this |
jenkins, test this |
jenkins, test this |
I think we should mark this input as experimental for now. Question: Where is state tracked for the services this input is supposed to read from. For example Logging/Audit endpoints would require you to track some kind of ID or timestamp between queries (and restarts), so to correctly collect all data without duplicates. To some extent Pagination looks like it can be used for this use-cases, but it always seems to start from the beginning between filebeat restarts. I'm also missing authentication settings like username/password. Have you considered to add some support for cookies as well? |
Thanks for your comments. Please see my answers inline below.
On Wed, Oct 2, 2019 at 8:15 AM Steffen Siering ***@***.***> wrote:
I think we should mark this input as experimental for now.
Question: Where is state tracked for the services this input is supposed
to read from. For example Logging/Audit endpoints would require you to
track some kind of ID or timestamp between queries (and restarts), so to
correctly collect all data without duplicates. To some extent Pagination
looks like it can be used for this use-cases, but it always seems to start
from the beginning between filebeat restarts.
The httpjson input is not stateful across restarts, meaning that the
pagination can track the IDs across continuous requests and perform proper
pagination, but when filebeat is restarted, the input will start from the
beginning. However, I am not sure that such a state should be stored across
restarts, since many pagination scrolls only exist for a short period of
time.
I'm also missing authentication settings like username/password.
User and password are not directly supported, but you can use the Header
config option to add them, provided that the base64 hash needs to be
computed separately before you can input it to the config.
Have you considered to add some support for cookies as well?
The user case that the input was designed for does not require cookies, so
support for cookie is not planned at this point.
|
Adding this as input to filebeat I'd expect this input to follow logs through APIs. This is an infinite stream of events, potentially backed by some persistent storage. Without keeping state one would start from the beginning over and over again. For example Okta logs list API.
True, yet we have username and password settings for other modules/inputs and outputs. Also for consistency reasons we should not force users to create correct authentication headers.
I see. I'm fine with that decision. |
I agree that this okta API will be a problem for this input as is, but I don't think keeping state will solve the problem. When the filebeat restarts, the scroll/state on the okta side can expire, and keeping state on the filebeat side will not help. Here the state needs to be kept and updated is the "since" parameter, hence requires understanding of the okta API. In this case, a dedicated input might be the way to go.
Sure. The target application for this input initially is the MISP module, which uses API key. I think we can add user/password support quite easily.
|
New filebeat input httpjson provides the following functions:
New filebeat module misp will use the httpjson input to take threat intel information out of MISP via provided REST API, and generate threat intel attack patterns.
Other new modules can use the httpjson input as well for their REST inputs.