Overview
Thesfn admin command provides administrative functionality for managing SafeNetworking data stored in ElasticSearch. It allows you to export and inspect data from various indices.
Command Syntax
Description
The admin command enables data curation and export operations. Currently, it supports dumping all documents from a specified ElasticSearch index to a file, with configurable sorting.Options
Export all documents from the specified index. Must be used with
--index and --sortfield options.Type: Flag (no value required)Example: --datadumpSpecify the ElasticSearch index to work with.Default:
.kibanaExample: --index sfn-dns-eventsField name to sort documents by when retrieving from the index.Default:
@timestampExample: --sortfield time.keywordOutput filename where exported data will be saved.Default:
admin_out.txtExample: --outfile dns_export.txtUsage Examples
Export DNS Events
Dump all DNS events from the SafeNetworking DNS index:Export IoT Intelligence Data
Export IoT honeypot threat intelligence sorted by time:Export Kibana Configuration
Export Kibana dashboards and visualizations (default index):Custom Index Export
Export data from a custom index with specific sorting:Expected Output
When running with--datadump, the command will:
- Connect to ElasticSearch
- Retrieve all documents from the specified index
- Sort by the specified field
- Write each document to the output file
Output File Format
The output file contains raw Python dictionary representations of ElasticSearch documents:Common Use Cases
Data Backup
Regularly export critical indices for backup purposes:Debugging
Inspect the structure and content of documents in an index:Data Migration
Export data from one SafeNetworking instance to import into another:Notes
The
--datadump flag requires both --index and --sortfield to be specified for proper operation.The default index
.kibana is typically used for Kibana configuration data, not SafeNetworking operational data.