-
Notifications
You must be signed in to change notification settings - Fork 76
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
Threat Intel Feed Config Model #1028
Threat Intel Feed Config Model #1028
Conversation
import java.util.Locale; | ||
import java.util.Map; | ||
|
||
public class SATIFConfig implements TIFConfig, Writeable, ScheduledJobParameter { |
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.
Javadocs
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.
added javadocs
public Instant lastRefreshedTime; | ||
public String lastRefreshedUser; | ||
private Boolean isEnabled; | ||
private Map<String, Object> iocMapStore; |
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.
What is this?
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 is the map that shows where we are storing the IOCs per feed. For opensearch it would be something like Map: Ip: , DNS:
); | ||
} | ||
|
||
public static TIFJobState toState(String stateName) { |
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.
Use enum inbuilt function
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.
The states are an enum, changed the function to use switch case
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 is not scalable
use valueOf(String name)
which returns enum and wrap with try catch where catch returns null and logs error that couldnt parse enum
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.
Changed it to use valueOf
import java.util.Map; | ||
|
||
/** | ||
* Threat intel config interface |
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.
can we rename entity to TIFSource Config
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.
renamed to TIFSourceConfig
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
e4e78e0
to
3fd7f89
Compare
Signed-off-by: Joanne Wang <[email protected]>
private Long version; | ||
private String feedName; | ||
private String feedFormat; | ||
private Boolean prepackaged; |
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.
let's have feed type instead of this
LICENSED
OPEN-SOURCED
CUSTOM
INTERNAL
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.
added enum class for these fields
@@ -33,5 +33,10 @@ public enum TIFJobState { | |||
/** | |||
* tif job is being deleted | |||
*/ | |||
DELETING | |||
DELETING, |
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.
REFRESHING?
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.
Added REFRESHING
as a state
Signed-off-by: Joanne Wang <[email protected]>
Signed-off-by: Joanne Wang <[email protected]>
a99ca4d
into
opensearch-project:feature/threat_intel
Description
Files changed outside of refactoring:
threat_intel_job_mapping.json
TIFConfig
TIFConfigDto
SATIFConfig
SATIFConfigDto
TIFJobState
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.