-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from FalconForceTeam/dev
Added new data source and endpoint
- Loading branch information
Showing
19 changed files
with
450 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -11,4 +11,5 @@ actionsTEST/* | |
falconhound | ||
dist/* | ||
.goreleaser.yaml | ||
cache.db | ||
cache.db | ||
.idea/* |
This file contains 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 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 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,28 @@ | ||
Name: Get new logon sessions | ||
ID: FLS_New_Sessions | ||
Description: Gets all logon events from Falcon LogScale and sends them to Neo4j | ||
Author: FalconForce | ||
Version: '1.0' | ||
Info: | | ||
Gets all logon events from LogScale, filters out non-user logons, and creates a relationship between the computer and the user in Neo4j, | ||
with the timestamp of the first logon event. | ||
Active: true # Enable to run this action | ||
Debug: false # Enable to see query results in the console | ||
SourcePlatform: LogScale # Sentinel, Watchlist, Neo4j, CSV, MDE, Graph, Splunk | ||
Query: | # Splunk index can be hardcoded or a variable set in the config.yml file | ||
"@collect.source_name" = "windows_events" | ||
| windows.EventID = 4624 | ||
| windows.EventData.TargetUserSid = "S-1-5-21-*" | ||
| windows.EventData.LogonType!=3 | ||
| table([@timestamp,windows.EventData.TargetUserSid,windows.Computer]) | ||
| rename(field=[[windows.EventData.TargetUserSid, TargetUserSid], [windows.Computer, Computer], [@timestamp, Timestamp]]) | ||
Targets: # Targets are the platforms that this action will push to (CSV, Neo4j, Sentinel, Wachlist, Slack, Teams, Splunk, Markdown) | ||
- Name: Neo4j | ||
Enabled: true | ||
Query: | | ||
WITH toUpper($Computer) as Computer, toUpper($TargetUserSid) as TargetUserSid, $Timestamp as Timestamp | ||
MATCH (x:Computer {name:Computer}) MATCH (y:User {objectid:TargetUserSid}) MERGE (x)-[r:HasSession]->(y) SET r.since=Timestamp SET r.source='falconhound' | ||
Parameters: | ||
Computer: Computer | ||
TargetUserSid: TargetUserSid | ||
Timestamp: Timestamp |
This file contains 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 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 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 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 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 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 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,35 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"falconhound/internal" | ||
"github.com/Azure/azure-kusto-go/kusto" | ||
"log" | ||
) | ||
|
||
func AdxInitTable(creds internal.Credentials) error { | ||
|
||
kustoConnectionStringBuilder := kusto.NewConnectionStringBuilder(creds.AdxClusterURL) | ||
kustoConnectionString := kustoConnectionStringBuilder.WithAadAppKey(creds.AdxAppID, creds.AdxAppSecret, creds.AdxTenantID) | ||
|
||
client, err := kusto.New(kustoConnectionString) | ||
if err != nil { | ||
log.Fatalf("failed to create Kusto client: %s", err) | ||
return err | ||
} | ||
|
||
// Create a context | ||
ctx := context.Background() | ||
const command = (".create table FalconHound (Name: string, Description: string, EventID: string, BHQuery: string, EventData: dynamic, Timestamp: datetime)") | ||
|
||
// Execute the control command | ||
_, err = client.Mgmt(ctx, creds.AdxDatabase, kusto.NewStmt(command)) | ||
//_, err = client.Mgmt(ctx, creds.AdxDatabase, command) | ||
if err != nil { | ||
log.Fatalf("Failed to execute the control command: %s", err) | ||
return err | ||
} | ||
|
||
LogInfo("[+] Table FalconHound created successfully, ready for ingestion.") | ||
return nil | ||
} |
This file contains 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.