Elasticsearch¶
We got a script!!!! 🎉
FortiDragon provides an automated script to set up all necessary Elasticsearch components.
Prerequisites¶
- Elasticsearch running. Either cluster, cloud or serverless
- Access to Elasticsearch with appropriate permissions
- Curl
Installation Steps¶
- Clone the repository:
- Make the script executable:
-
Modify variables according to your environment: Either on
- Script itself
- Via environment variables
-
Run the installation script:
Configuring Variables¶
Set Elasticsearch¶
Define Elasticsearch endpoint
For local deployments, with autogenerated certificates, set INSECURE flag to true
# SSL certificate validation: "true" to bypass SSL validation, "false" to validate
INSECURE="${INSECURE:-false}"
Define user/pass
# User/Password authentication (used when AUTH_METHOD="user")
ES_USERNAME="${ES_USERNAME:-elastic}"
ES_PASSWORD="${ES_PASSWORD:-changeme}"
Or API key
Set LOAD¶
Via LOAD_* variables, we control what modules are loaded to Elasticsearch. By default, only index related configuration is loaded.
LOAD_ECS="${LOAD_ECS:-true}"
LOAD_COMPONENT="${LOAD_COMPONENT:-true}"
LOAD_ILM="${LOAD_ILM:-true}"
LOAD_INDEX_TEMPLATES="${LOAD_INDEX_TEMPLATES:-true}"
LOAD_INGEST_PIPELINES="${LOAD_INGEST_PIPELINES:-false}"
LOAD_TRANSFORMS="${LOAD_TRANSFORMS:-false}"
Ingest Pipelines
❌ Ingest Pipelines had been deprecated in favor of Vector
✅ Deploy Vector instead
Transforms
❌ Transforms are not stable
😬 We are probably not using them as they are intended to be
What gets installed¶
The script automatically creates:
Index Templates¶
logs-fortinet.fortigate.trafficlogs-fortinet.fortigate.utmlogs-fortinet.fortigate.eventlogs-fortinet.forticlientlogs-fortinet.fortiedrlogs-fortinet.fortimail
Index Templates
You can manually add/remove component templates to the new created index templates
Component Templates¶
- ECS field mappings
- Fortinet specific mappings
- ILM policies
- Index settings (refresh intervals, field limits, etc.)
ILM Policies¶
Automated lifecycle management for each datastream type:
logs-fortinet.fortigate.trafficlogs-fortinet.fortigate.utmlogs-fortinet.fortigate.eventlogs-fortinet.forticlientlogs-fortinet.fortiedrlogs-fortinet.fortimail
Ingest Pipelines¶
logs-fortinet.fortigatelogs-fortinet.forticlientlogs-fortinet.fortiedrlogs-fortinet.fortimaillogs-fortinet.fortiweb
Ingest Pipelines
Will only load if LOAD_INGEST_PIPELINES is set to true
Data Retention¶
Elasticsearch can manage data lifecycle either via:
Data stream lifecycle vs ILM Policies
Both options are set on created index templates
ILM has precedence over Data stream lifecycle, so be sure to remove them from your index template if you don't intended to use them.
Data stream lifecycle
Use them when you do not have a data tiered architecture
ILM Policy
Use them when you do have a data tiered architecture
Next Steps¶
Once Elasticsearch is configured:
-
Import dashboards in Kibana
-
Start dancing with your logs!