Skip to content
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 new workflow for Trellix HX #273

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9ba2005
Add Parameters file
M-Shabrawy Feb 9, 2022
3f09db3
Move into "FireEye HX" folder
M-Shabrawy Feb 9, 2022
9e54153
Files uploaded
M-Shabrawy Feb 9, 2022
5f27e67
Rename FireEye-HX-Alert_Groups-Workflow copy.xml to FireEye-HX-Alert_…
M-Shabrawy Feb 9, 2022
f4cfdaa
Update README.md
M-Shabrawy Feb 9, 2022
7df22e8
Update README.md
M-Shabrawy Feb 9, 2022
fa6eb99
Rename FireEye-HX-Workflow-Parameter-Value.xml to FireEye-HX-Alerts-W…
M-Shabrawy Feb 10, 2022
e219484
Add files via upload
M-Shabrawy Feb 10, 2022
5a42d88
Increase intial pull to 30 day and replace Merge with Set
M-Shabrawy Feb 10, 2022
a2ea0ff
Update FireEye-HX-Alerts-Workflow.xml
M-Shabrawy Feb 10, 2022
22b0b92
Update FireEye-HX-Alerts-Workflow.xml
M-Shabrawy Feb 13, 2022
9303cd7
change variable naming style
M-Shabrawy Feb 13, 2022
a4a65d5
Update FireEye-HX-Alerts-Workflow.xml
M-Shabrawy Feb 24, 2022
cbbd6f1
Update README.md
M-Shabrawy Feb 24, 2022
4105458
Merge branch 'IBM:master' into master
M-Shabrawy Jun 20, 2022
9ab5e47
Update FireEye HX/FireEye-HX-Alert_Groups-Workflow.xml
M-Shabrawy Aug 23, 2022
0b63501
Rename FireEye HX/README.md to Community Developed/FireEye HX/README.md
M-Shabrawy Aug 23, 2022
55bce66
Rename FireEye HX/LICENSE to Community Developed/FireEye HX/LICENSE
M-Shabrawy Aug 23, 2022
1ea7d00
Rename FireEye HX/FireEye-HX-Alert_Groups-Workflow-Parameter-Value.xm…
M-Shabrawy Aug 23, 2022
61fb663
Rename FireEye HX/FireEye-HX-Alert_Groups-Workflow.xml to Community D…
M-Shabrawy Aug 23, 2022
8213986
Rename FireEye HX/FireEye-HX-Alerts-Workflow-Parameter-Value.xml to C…
M-Shabrawy Aug 23, 2022
d26059b
Rename FireEye HX/FireEye-HX-Alerts-Workflow.xml to Community Develop…
M-Shabrawy Aug 23, 2022
5254d56
Update FireEye-HX-Alerts-Workflow.xml
M-Shabrawy Aug 23, 2022
05c7f22
Update FireEye-HX-Alerts-Workflow-Parameter-Value.xml
M-Shabrawy Aug 23, 2022
fcf1860
Update README.md
M-Shabrawy Aug 23, 2022
39cee4d
Update README.md
M-Shabrawy Aug 23, 2022
d57c70b
Update FireEye-HX-Alerts-Workflow.xml
M-Shabrawy Aug 23, 2022
13de18b
Merge branch 'IBM:master' into master
M-Shabrawy Aug 23, 2022
b294e3d
Update FireEye-HX-Alert_Groups-Workflow.xml
M-Shabrawy Aug 23, 2022
27f067e
Update FireEye-HX-Alert_Groups-Workflow-Parameter-Value.xml
M-Shabrawy Aug 23, 2022
8b55980
Merge branch 'IBM:master' into master
M-Shabrawy Feb 3, 2023
761a3d3
Merge branch 'IBM:master' into master
M-Shabrawy Dec 19, 2024
49ad1b4
Update README.md
M-Shabrawy Dec 19, 2024
c52b709
Update and rename FireEye-HX-Alerts-Workflow.xml to Trellix-HX-Alerts…
M-Shabrawy Dec 19, 2024
4109bf4
Rename README.md to README.md
M-Shabrawy Dec 19, 2024
a4091a0
Rename FireEye-HX-Alerts-Workflow-Parameter-Value.xml to Trellix-HX-A…
M-Shabrawy Dec 19, 2024
2318b87
Update Trellix-HX-Alerts-Workflow-Parameter-Value.xml
M-Shabrawy Dec 19, 2024
100f335
Update and rename FireEye-HX-Alert_Groups-Workflow-Parameter-Value.xm…
M-Shabrawy Dec 22, 2024
6471a0f
Rename FireEye-HX-Alert_Groups-Workflow.xml to Trellix-HX-Alert_Group…
M-Shabrawy Dec 22, 2024
6727172
Update Trellix-HX-Alert_Groups-Workflow.xml
M-Shabrawy Dec 22, 2024
557bc6b
Update and rename LICENSE to LICENSE
M-Shabrawy Dec 22, 2024
f4eba81
Update Trellix-HX-Alerts-Workflow.xml
M-Shabrawy Dec 22, 2024
db82bf2
Update Trellix-HX-Alerts-Workflow.xml
M-Shabrawy Dec 22, 2024
8a48d19
Create Trellix-HX-ProcessTracker-Workflow-Parameter-Value.xml
M-Shabrawy Dec 22, 2024
b426fa3
Create Trellix-HX-ProcessTracker-Workflow.xml
M-Shabrawy Dec 22, 2024
8f66a78
Update Trellix-HX-Alerts-Workflow.xml
M-Shabrawy Dec 23, 2024
d8d1900
Update Trellix-HX-ProcessTracker-Workflow-Parameter-Value.xml
M-Shabrawy Dec 23, 2024
547b873
Update Trellix-HX-ProcessTracker-Workflow.xml
M-Shabrawy Dec 23, 2024
f3e23bb
Update README.md
M-Shabrawy Dec 23, 2024
5b71d64
Update README.md
M-Shabrawy Dec 23, 2024
6658de3
Update Trellix-HX-ProcessTracker-Workflow.xml
M-Shabrawy Dec 25, 2024
3c95ec8
Rename Community Developed/Trellix HX/Trellix-HX-ProcessTracker-Workf…
M-Shabrawy Dec 25, 2024
72cff02
Rename Community Developed/Trellix HX/Trellix-HX-ProcessTracker-Workf…
M-Shabrawy Dec 25, 2024
cda8eae
Rename Community Developed/Trellix HX/Trellix-HX-Alerts-Workflow.xml …
M-Shabrawy Dec 25, 2024
18ed4ca
Rename Community Developed/Trellix HX/Trellix-HX-Alerts-Workflow-Para…
M-Shabrawy Dec 25, 2024
35d3f56
Rename Community Developed/Trellix HX/Trellix-HX-Alert_Groups-Workflo…
M-Shabrawy Dec 25, 2024
746b04b
Rename Community Developed/Trellix HX/FireEye-Trellix-HX-Alert_Groups…
M-Shabrawy Dec 25, 2024
0bec767
Update README.md
M-Shabrawy Dec 25, 2024
5900a19
- Updated missing first event ID logic
M-Shabrawy Dec 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<WorkflowParameterValues xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/WorkflowParameterValues/V1">
<Value name="host" value="hexXXXXXX-hx-webui-1.hex03.helix.apps.fireeye.com" />
<Value name="hx_port" value="443" /> <!-- 443 for CLoud and 3000 for On-Prem -->
<Value name="username" value="api_analyst" />
<Value name="password" value="api_analyst" />
<!-- Number of alert records to fetch per request -->
<Value name="limit" value="100" />
</WorkflowParameterValues>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Workflow name="FireEye HX" version="1.0" xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/Workflow/V1">
<Parameters>
<Parameter name="host" label="Host" required="true" />
<Parameter name="hx_port" label="Port" value="443" required="true" />
<Parameter name="username" label="Username" required="true" />
<Parameter name="password" label="Password" required="true" secret="true" />
</Parameters>
<Actions>
<!-- Initialize the Bookmark -->
<Initialize path="/bookmark" value="${time() - 86400000}" />

<!-- Use bookmark -10 mins as start time -->
<FormatDate pattern="yyyy-MM-dd'T'HH:mm:ss'Z'" timeZone="UTC" time="${/bookmark}" savePath="/startTime" />

<!-- Authenticate and request API Token -->
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/token" method="GET" savePath="/getApiToken" >
<BasicAuthentication username="${/username}" password="${/password}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>

<!-- Handle Errors -->
<If condition="/getApiToken/status_code != 204">
<Log type="Error" message="FE HX API: Error Authenticating to API: ${/getApiToken/body}" />
<Abort reason="Error login: ${/getApiToken/body}" />
</If>
<Else>
<!-- Extract the API Token -->
<Set path="/x_feapi_token" value="${/getApiToken/headers/X-FeApi-Token}" />
<!-- Build filterQuery -->
<Set path="/filterQuery" value='{"operator":"gt","arg": ["${/startTime}"],"field":"last_event_at"}' />

<!-- Get Alerts -->
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/alert_groups/?" method="GET" savePath="/getAlerts">
<QueryParameter name="offset" value="0" />
<QueryParameter name="limit" value="100" />
<QueryParameter name="sort" value="last_event_at" />
<!-- URL Encoded Filter for last_event_at greater than Start Time -->
<QueryParameter name="filterQuery" value="${/filterQuery}" />
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>

<!-- Handle Errors -->
<If condition="/getAlerts/status_code != 200">
<Log type="Error" message="FE HX API: Error fetching alerts ${/getAlerts/body}" />
</If>
<Else>
<Log type="INFO" message="FE HX API: Got ${/getAlerts/body/data/total} events" />

<!-- Alert are returned in JSON format-->
<!-- Extract Alerts-->
<If condition="${/getAlerts/body/data/total} > 0">
<Set path="/alerts" value="${/get_alerts/body/data/entries}" />
<Set path="/bookmark" value="${max(/alerts/reported_at)}" />
</If>
<!-- Post Alerts -->
<PostEvents path="/alerts" source="${/host}" />
</Else>

<!-- Dispose generated token to clear active session -->
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/token" method="DELETE" savePath="/delApiToken" >
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>

<!-- Handle Errors -->
<If condition="/del_feapi_token/status_code != 204">
<Log type="Error" message="FE HX API: Error Deleting Session: ${/del_feapi_token/body/message}" />
<Abort reason="${/get_feapi_token/body/message}" />
</If>
</Else>
</Actions>
<Tests>
<DNSResolutionTest host="${/host}" />
<TCPConnectionTest host="${/host}" port="${/hx_port}" />
<SSLHandshakeTest host="${/host}" port="${/hx_port}"/>
<HTTPConnectionThroughProxyTest url="https://${/host}:${/hx_port}" />
</Tests>
</Workflow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<WorkflowParameterValues xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/WorkflowParameterValues/V1">
<Value name="host" value="hexXXXXXX-hx-webui-1.hex03.helix.apps.fireeye.com" />
<Value name="hx_port" value="443" /> <!-- 443 for CLoud and 3000 for On-Prem -->
<Value name="username" value="api_analyst" />
<Value name="password" value="api_analyst" />
<!-- Number of alert records to fetch per request -->
<Value name="limit" value="100" />
</WorkflowParameterValues>
150 changes: 150 additions & 0 deletions Community Developed/Trellix HX/Alerts/Trellix-HX-Alerts-Workflow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Workflow name="Trellix HX" version="1.0.4" xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/Workflow/V1">
<Parameters>
<Parameter name="host" label="Host" required="true" />
<Parameter name="hx_port" label="Port" required="true" />
<Parameter name="username" label="Username" required="true" />
<Parameter name="password" label="Password" required="true" secret="true" />
<Parameter name="limit" label="Limit" required="true" />
</Parameters>
<Actions>
<!-- Initialize the Bookmark -->
<Initialize path="/bookmark" value="0" />
<!-- Authenticate and request API Token -->
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/token" method="GET" savePath="/getFeApiToken" >
<BasicAuthentication username="${/username}" password="${/password}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>
<!-- Handle Errors -->
<If condition="/getFeApiToken/status_code != 204">
<Log type="Error" message="Trellix HX API: API Authentication Error: ${/getFeApiToken/body}" />
<Abort reason="Trellix HX API: API Authentication Error: ${/getFeApiToken/body}" />
</If>
<Else>
<!-- Extract the API Token -->
<Set path="/x_feapi_token" value="${/getFeApiToken/headers/X-FeApi-Token}" />
</Else>
<!-- Get First Alert -->
<Set path="/offset" value="0" />
<Set path="limit" value="1" />

<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/alerts/?" method="GET" savePath="/getFirstAlert">
<QueryParameter name="offset" value="${/offset}" />
<QueryParameter name="limit" value="${/limit}" />
<QueryParameter name="sort" value="_id" />
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>
<!-- Handle Errors -->
<If condition="/getFirstAlert/status_code != 200">
<Log type="Error" message="Trellix HX API: Error fetching first alert ${/getFirstAlert/body}" />
<Abort reason="Trellix HX API: API Authentication Error: ${/getFirstAlert/body}">
</If>
<Else>
<Set path="/firstAlertId" value="${/getFirstAlert/body/data/entries[0]/_id}" />
<Log type="INFO" message="Trellix HX API: Got ${/getFirstAlert/body/data/total} alerts" />
<If condition="${/getFirstAlert/body/data/total} > 0">
<set path="/entries" value="${/getAlerts/body/data/total}">
</If>
<Else>
<Log type="Notice" message="Trellix HX API: No Alerts to fetch" />
<Abort reason="Trellix HX API: No Alerts to fetch">
</Else>
</Else>

<!-- Get Last Alert -->
<Set path="/offset" value="${/entries -1}" />
<Set path="limit" value="1" />

<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/alerts/?" method="GET" savePath="/getLastAlert">
<QueryParameter name="offset" value="${/offset}" />
<QueryParameter name="limit" value="${/limit}" />
<QueryParameter name="sort" value="_id" />
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>
<!-- Handle Errors -->
<If condition="/getLastAlert/status_code != 200">
<Log type="Error" message="Trellix HX API: Error fetching last alert ${/getLastAlert/body}" />
<Abort reason="Trellix HX API: Error fetching last alert ${/getLastAlert/body}">
</If>
<Else>
<Set path="/firstAlertId" value="${/getLastAlert/body/data/entries[0]/_id}" />
<Log type="INFO" message="Trellix HX API: Last Alert ID: ${/getLastAlert/body/data/total}" />
<If condition="${/getFirstAlert/body/data/total} > 0">
<set path="/entries" value="${/getAlerts/body/data/total}">
</If>
</Else>

<If condition="/bookmark > 0">

</If>
<Else>

</Else>

<!-- Extract Alerts-->
<DoWhile condition="(/entries) > 0">
<Set path="/alerts" value="${/getAlerts/body/data/entries}" />
<!-- Enrich Alerts -->
<ForEach item="/alert" items="/alerts">
<Set path="/alertID" value="${/alert/_id}">
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/hosts/${/alert/agent/_id}" method="GET" savePath="/getAagent">
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>
<If condition="/getAagent/status_code != 200">
<Log type="Error" message="Trellix HX API: Error fetching Agnet information: ${/getAagent/body}" />
<Abort reason="Error login: ${/getAagent/body}" />
</If>
<Log type="Info" message="Trellix HX API: Host found for ID: ${/alert/agent/_id}" />
<!-- Add host information to alert-->
<Set path="/alert/agent/hostname" value="${/getAagent/body/data/hostname}" />
<Set path="/alert/agent/domain" value="${/getAagent/body/data/domain}" />
<Set path="/alert/agent/primary_ip_address" value="${/getAagent/body/data/primary_ip_address}" />
<Set path="/alert/agent/last_poll_ip" value="${/getAagent/body/data/last_poll_ip}" />
<PostEvent path="/alert" source="${/host}" />
</ForEach>
<!-- Update bookmark -->
<ParseDate pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" timeZone="UTC" date="${max(/alerts/reported_at)}" savePath="/bookmark" />
<Log type="Info" message="Trellix HX API: Last Alert Time set to: ${/bookmark}" />

<!-- Next Page -->
<Set path="/offset" value="${/offset + /limit - 1}" />
<!-- Get next page of alerts -->
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/alerts/?" method="GET" savePath="/getAlerts">
<QueryParameter name="offset" value="${/offset}" />
<QueryParameter name="limit" value="${/limit}" />
<QueryParameter name="sort" value="_id" />
<QueryParameter name="filterQuery" value="${/filterQuery}" />
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>
<If condition="/getAlerts/status_code != 200">
<Log type="Error" message="Trellix HX API: Error getting alerts: ${/getAlerts/body}" />
<Abort reason="Error login: ${/getAlerts/body}" />
</If>
</DoWhile>

<!-- Dispose generated token to clear active session -->
<CallEndpoint url="https://${/host}:${/hx_port}/hx/api/v3/token" method="DELETE" savePath="/delFeApiToken" >
<If condition="/ignore_selfsigned_certificate == 1">
<SSLConfiguration allowUntrustedServerCertificate="true" />
</If>
<RequestHeader name="X-FeApi-Token" value="${/x_feapi_token}" />
<RequestHeader name="Accept" value="application/json" />
</CallEndpoint>
<!-- Handle Errors -->
<If condition="/delFeApiToken/status_code != 204">
<Log type="Error" message="Trellix HX API: Error Deleteing Session: ${/delFeApiToken/body}" />
<Abort reason="${/delFeApiToken/body}" />
</If>
</Actions>

<Tests>
<DNSResolutionTest host="${/host}" />
<TCPConnectionTest host="${/host}" port="${/hx_port}" />
<SSLHandshakeTest host="${/host}" port="${/hx_port}"/>
<HTTPConnectionThroughProxyTest url="https://${/host}:${/hx_port}" />
</Tests>
</Workflow>
21 changes: 21 additions & 0 deletions Community Developed/Trellix HX/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Mohamed Al-Shabrawy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<WorkflowParameterValues xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/WorkflowParameterValues/V1">
<Value name="host" value="hexXXXXXX-hx-webui-1.hex03.helix.apps.fireeye.com" />
<Value name="hx_port" value="443" /> <!-- 443 for CLoud and 3000 for On-Prem -->
<Value name="username" value="api_analyst" />
<Value name="password" value="api_analyst" />
</WorkflowParameterValues>
Loading