-
Notifications
You must be signed in to change notification settings - Fork 126
Add support for ML models in elastic-package dump #1550
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
Conversation
"estimated_operations": 0, | ||
"license_level": "platinum", | ||
"description": "Model used to detect domain generation algorithm (DGA) activity in your network data.", | ||
"compressed_definition": "//REDACTED//", |
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.
Manually removed to avoid having several megabytes of binaries here.
recordURL.Path = r.URL.Path | ||
recordURL.RawQuery = r.URL.RawQuery | ||
|
||
req, err := http.NewRequest(r.Method, recordURL.String(), nil) |
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.
Fix to correctly record responses of urls with query parameters. I can move this small change to a different PR if needed.
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.
LGTM to add it here, and this file should be used just in testing.
Just one doubt, why not using directly r.URL.String()
as parameter ? Was it for removing headers or other fields ?
req, err := http.NewRequest(r.Method, r.URL.String(), nil)
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.
Yes, IIRC the idea is to remove anything that is not needed from the original request. Hosts, authentication and so on are provided by the elasticsearch client.
This has limitations, as we have found here. If we had things based on headers it would fail too. Also if we would like to capture requests with payload.
We may continue improving it as we need it.
💚 Build Succeeded
History
cc @jsoriano |
recordURL.Path = r.URL.Path | ||
recordURL.RawQuery = r.URL.RawQuery | ||
|
||
req, err := http.NewRequest(r.Method, recordURL.String(), nil) |
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.
LGTM to add it here, and this file should be used just in testing.
Just one doubt, why not using directly r.URL.String()
as parameter ? Was it for removing headers or other fields ?
req, err := http.NewRequest(r.Method, r.URL.String(), nil)
// Wildcard may be too wide, but no other thing is available at the moment. | ||
api.ML.GetTrainedModels.WithModelID(fmt.Sprintf("%s_*", packageName)), |
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.
👍
Some packages can include ML models, include them in dumps when available.