Follow this convention: Conventional Commits
The Add-on uses the Splunk UCC Generator.
Prerequisite: You MUST use Python 3.9 to run the UCC generator to ensure compatibility with Splunk's internal libraries.
To build the application:
# Recommended build command
ucc-gen build --source TA-thehive-cortex/package --config TA-thehive-cortex/globalConfig.json --output output --ta-version 4.0.0 --overwrite -v --python-binary-name pythonNote: You may need to specify --python-binary-name (e.g., python3.9 or the full path) if your default Python is not compatible.
For the agent's environment, the following cleanup is applied to the output/ folder before packaging:
# Cleanup Windows binaries (keep Mako templates as they are required for UI)
Get-ChildItem "output/TA-thehive-cortex/lib" -Recurse -Include *.exe, *.pyd | Remove-Item -Force -ErrorAction SilentlyContinue;
# Create the .spl file
tar -cvzf TA-thehive-cortex.spl -C output TA-thehive-cortexNEVER delete the local/ folder in the Splunk directory during a deployment.
Deployment must be performed directly via shell commands (PowerShell) by strictly following these steps:
- Stop Splunk to release file locks.
- Temporarily move the existing
local/folder to a backup directory outside the app's tree. - Remove the old version of the application.
- Deploy the new build from
output/. - Restore the backed-up
local/folder. - Restart Splunk.
Direct command example:
& "C:\Program Files\Splunk\bin\splunk.exe" stop; if (Test-Path "C:\Program Files\Splunk\etc\apps\TA-thehive-cortex\local") { Move-Item "C:\Program Files\Splunk\etc\apps\TA-thehive-cortex\local" "$env:TEMP\TA_local_backup" -Force }; Remove-Item "C:\Program Files\Splunk\etc\apps\TA-thehive-cortex" -Recurse -Force -ErrorAction SilentlyContinue; Copy-Item -Path "output\TA-thehive-cortex" -Destination "C:\Program Files\Splunk\etc\apps\" -Recurse -Force; if (Test-Path "$env:TEMP\TA_local_backup") { if (-not (Test-Path "C:\Program Files\Splunk\etc\apps\TA-thehive-cortex\local")) { New-Item -Path "C:\Program Files\Splunk\etc\apps\TA-thehive-cortex\local" -ItemType Directory }; Copy-Item -Path "$env:TEMP\TA_local_backup\*" -Destination "C:\Program Files\Splunk\etc\apps\TA-thehive-cortex\local" -Recurse -Force; Remove-Item "$env:TEMP\TA_local_backup" -Recurse -Force }; & "C:\Program Files\Splunk\bin\splunk.exe" startThis section is for sharing generic technical lessons learned during development. Do not include setup-specific or sensitive information.
- Python Compatibility: Always use Splunk's internal Python version (3.9+) for builds and local testing to ensure library compatibility.
- UCC Framework: All UI changes MUST be made in
globalConfig.json. Manual changes todefault/data/uiwill be overwritten during the next build. - Library Isolation: Third-party libraries must be placed in
package/bin/ta_thehive_cortex/libsto avoid conflicts with other Splunk apps.