-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/agile operations #75
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
base: main
Are you sure you want to change the base?
Changes from all commits
cca9f43
e658789
48929ae
f36ce65
b51250d
f7425c0
854aad1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,30 @@ CREATE OR REPLACE QUERY find_events_by_time_range_and_event_type ( | |||||||||||||||||||||||||
| DATETIME end_time, | ||||||||||||||||||||||||||
| STRING input_event_type_filter = "" | ||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||
| Query Name: | ||||||||||||||||||||||||||
| find_events_by_time_range_and_event_type | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Purpose: | ||||||||||||||||||||||||||
| Retrieves events occurring within a specific time range and optionally filters by event type. | ||||||||||||||||||||||||||
| Additionally, collects related metadata such as impacted devices, alert types, | ||||||||||||||||||||||||||
| and incident types for comprehensive event analysis. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Inputs: | ||||||||||||||||||||||||||
| start_time — Minimum datetime filter for event retrieval. | ||||||||||||||||||||||||||
| end_time — Maximum datetime filter for event retrieval. | ||||||||||||||||||||||||||
| input_event_type_filter — (Optional) Filters by event type. If empty, all types are included. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Outputs: | ||||||||||||||||||||||||||
| - selected_events_with_info: | ||||||||||||||||||||||||||
| • event_id — Event identifier | ||||||||||||||||||||||||||
| • event_time — Timestamp of the event | ||||||||||||||||||||||||||
| • event_type — Type classification (Security, System, Network, etc.) | ||||||||||||||||||||||||||
| • event_alert_type — Enriched alert type data (if any) | ||||||||||||||||||||||||||
| • event_incident_type — Enriched incident type data (if any) | ||||||||||||||||||||||||||
| • impacted_devices_list — Devices affected by this event | ||||||||||||||||||||||||||
|
Comment on lines
+22
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can see the comments around using the "keyboard characters" around those - hence the suggestion below
Suggested change
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||
| MaxAccum<STRING> @event_type; | ||||||||||||||||||||||||||
| MaxAccum<STRING> @incident_type; | ||||||||||||||||||||||||||
| MaxAccum<STRING> @alert_type; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,35 @@ CREATE OR REPLACE QUERY find_potential_related_events_from_incident_by_time ( | |||||||||
| INT max_radius = 3, | ||||||||||
| INT num_seconds_from_incident_start = 3600 | ||||||||||
| ) { | ||||||||||
| /* | ||||||||||
| Query Name: | ||||||||||
| find_potential_related_events_from_incident_by_time | ||||||||||
|
|
||||||||||
| Purpose: | ||||||||||
| Identifies events that could be potentially related to a given input incident. | ||||||||||
| It does so by: | ||||||||||
| • Discovering all devices impacted by the incident | ||||||||||
| • Expanding outward through connected devices within max_radius hops | ||||||||||
| • Searching for events (Alerts, Incidents) that occurred within a time window | ||||||||||
| starting from the incident occurrence time | ||||||||||
|
Comment on lines
+15
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not all the events are linked to Alerts and Incidents (e.g. Event with type So, for the current solution kit schema:
I guessed you can mention it like this:
Suggested change
|
||||||||||
| • Classifying and linking detected related alerts and incidents with types | ||||||||||
|
|
||||||||||
| Inputs: | ||||||||||
| input_incident — Starting Incident vertex for event correlation analysis | ||||||||||
| max_radius — Max number of hops to discover connected impacted devices (default: 3) | ||||||||||
| num_seconds_from_incident_start — Time window (in seconds) after incident start to look for related events (default: 3600) | ||||||||||
|
|
||||||||||
| Outputs: | ||||||||||
| • input_incident_set — Original input incident | ||||||||||
| • linked_event — Event directly linked to input incident | ||||||||||
| • impacted_devices_within_radius — All devices reached via radius traversal | ||||||||||
| • alerts_from_impacted_devices — Related Alerts discovered in time range | ||||||||||
| • incidents_from_impacted_devices — Related Incidents discovered | ||||||||||
| • alert_types_of_impacted_devices — Enriched alert category details | ||||||||||
| • incident_types_of_impacted_devices — Enriched incident category details | ||||||||||
| • @@edges_to_display — All collected edges for UI / Graph visualization | ||||||||||
|
|
||||||||||
| */ | ||||||||||
| SetAccum<VERTEX> @@impacted_devices_set; | ||||||||||
| SetAccum<EDGE> @@edges_to_display; | ||||||||||
| MinAccum<DATETIME> @@start_time_accum; | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,27 @@ | ||||||||||||||||||||||||||||||||||
| CREATE OR REPLACE QUERY find_unsecured_servers_visualization (UINT k_hop_switch_limit = 3) { | ||||||||||||||||||||||||||||||||||
| CREATE OR REPLACE QUERY find_unsecured_servers_visualization (UINT k_hop_switch_limit = 3) { | ||||||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||||||
| Query: find_unsecured_servers_visualization | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Purpose: | ||||||||||||||||||||||||||||||||||
| Visualizes unsecured network paths from Routers to Servers through Switches. | ||||||||||||||||||||||||||||||||||
| It identifies Servers that are reachable via Switches without passing through security devices (like Firewalls). | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| What It Does: | ||||||||||||||||||||||||||||||||||
| • Finds all Routers, Switches, and Servers. | ||||||||||||||||||||||||||||||||||
| • Traverses paths from Routers → Switches → Servers using Connect_To edges. | ||||||||||||||||||||||||||||||||||
| • Expands through Switch-to-Switch connections up to 'k_hop_switch_limit' hops. | ||||||||||||||||||||||||||||||||||
| • Collects all involved vertices and edges for visualization. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Key Outputs: | ||||||||||||||||||||||||||||||||||
| - routers_to_display → Starting routers | ||||||||||||||||||||||||||||||||||
| - switches_to_display → Switches on the unsecured path | ||||||||||||||||||||||||||||||||||
| - servers_to_display → Potentially unsecured servers | ||||||||||||||||||||||||||||||||||
| - edges_to_display → All traversal edges for graph visualization | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Parameter: | ||||||||||||||||||||||||||||||||||
| k_hop_switch_limit → Maximum number of Switch-to-Switch traversal hops (default: 3) | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+15
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest: To make it more consistent with the other works in the other queries here, I would recommend:
This also applies to other query descriptions with the parameter happening
Suggested change
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| SetAccum<VERTEX> @@routers_to_display; | ||||||||||||||||||||||||||||||||||
| SetAccum<VERTEX> @@switches_to_display; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
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.
comment: I generally would try using standard non-extended ASCII characters (e.g. stuff you can write out using keyboards) for things in query comments.
So, I'd change the above to be like this so that standard characters are used
This is pretty small stuff though and probably depends on personal preference.