|
1 | | -# Splunk Whitelist Manager |
| 1 | +# Whitelist Manager for Splunk |
2 | 2 |
|
3 | | -## Overview |
| 3 | +Manage detection-rule CSV whitelists through a web UI with inline editing, approval workflows, version control, and a full diff-based audit trail. |
4 | 4 |
|
5 | | -The Splunk Whitelist Manager is a comprehensive, user-friendly Splunk application designed to streamline the management of detection rule whitelists across your security operations. This application enables security teams to efficiently review, approve, and manage whitelist entries for critical detection rules without requiring direct access to lookup files or advanced Splunk configuration knowledge. |
6 | | - |
7 | | -Built with an intuitive web interface, role-based access controls, and comprehensive audit logging, the Whitelist Manager reduces operational friction while maintaining security and compliance requirements. Teams can quickly respond to false positives, manage exceptions, and track all whitelist changes through a centralized dashboard. |
| 5 | +Built for SOC teams who need to manage detection rule exceptions without touching raw CSV files or Splunk configs. |
8 | 6 |
|
9 | 7 | ## Features |
10 | 8 |
|
11 | | -- **Multi-Rule Support**: Manage whitelists for 16+ detection rules including data exfiltration, brute force, privilege escalation, and more |
12 | | -- **Web-Based Interface**: Intuitive dashboard for viewing, filtering, and managing whitelist entries |
13 | | -- **Role-Based Access Control**: Assign permissions to managers, approvers, and viewers for controlled access |
14 | | -- **Audit Trail**: Complete logging of all whitelist modifications with user attribution and timestamps |
15 | | -- **Bulk Operations**: Add, remove, or modify multiple whitelist entries efficiently |
16 | | -- **CSV Lookup Integration**: Seamless integration with Splunk lookup files for real-time whitelist application |
17 | | -- **Search Integration**: View whitelist status directly in detection rule searches |
18 | | -- **Flexible Rule Mapping**: Customizable configuration to add new detection rules |
| 9 | +### Core Editing |
19 | 10 |
|
20 | | -## Prerequisites |
| 11 | +- Inline cell editing with change tracking (before/after diffs) |
| 12 | +- Add, remove, and bulk-edit rows with required comments |
| 13 | +- Add and remove columns |
| 14 | +- Row drag-and-drop reordering |
| 15 | +- CSV import/export |
| 16 | +- Search and filter rows |
| 17 | +- Dark and light theme support |
21 | 18 |
|
22 | | -- Splunk Enterprise 7.3 or higher (8.x and 9.x recommended) |
23 | | -- Admin access to Splunk instance for app installation |
24 | | -- Available disk space for lookup files and audit logs |
25 | | -- Network access to the Splunk web interface |
| 19 | +### Approval Workflows |
26 | 20 |
|
27 | | -## Installation |
| 21 | +- Configurable thresholds trigger admin approval for bulk operations |
| 22 | +- Daily usage limits per analyst (row removals, edits, additions, reverts) |
| 23 | +- Admins approve/reject/cancel requests from the Control Panel |
| 24 | +- Self-approval prevention — submitter cannot approve their own request |
28 | 25 |
|
29 | | -### Method 1: Via Splunk Web UI (Recommended) |
| 26 | +### Version Control |
30 | 27 |
|
31 | | -1. Download the latest package from the Releases page |
32 | | -2. Log in to Splunk as an admin |
33 | | -3. Navigate to Manage Apps and select Install app from file |
34 | | -4. Click Choose File and select the wl_manager-1.0.0.spl package |
35 | | -5. Click Upload app and wait for installation to complete |
36 | | -6. Restart Splunk when prompted |
| 28 | +- Every save creates a timestamped snapshot (last 6 versions retained) |
| 29 | +- Revert to any previous version with full audit trail |
| 30 | +- Optimistic locking — concurrent edits detected via file mtime |
37 | 31 |
|
38 | | -### Method 2: Via Splunk CLI |
| 32 | +### Audit Trail |
39 | 33 |
|
40 | | -bash |
41 | | -/opt/splunk/bin/splunk install app wl_manager-1.0.0.spl -auth admin:password |
42 | | -bash |
| 34 | +- Every change logged to a dedicated `wl_audit` Splunk index |
| 35 | +- Diff-based events: added, removed, edited, revert, auto-removed |
| 36 | +- Per-field before/after values for edits |
| 37 | +- Dashboard with summary stats, filters by analyst/rule/action/time |
| 38 | +- Expiring-soon panel for proactive review |
43 | 39 |
|
44 | | -Replace 'admin:password' with your actual credentials. |
| 40 | +### Security |
45 | 41 |
|
46 | | -### Method 3: Manual Installation |
| 42 | +- Role-based access control: `wl_admin`, `wl_analyst_editor`, `wl_analyst_viewer` |
| 43 | +- Server-side RBAC enforcement on every request |
| 44 | +- Path traversal protection, input sanitization, rate limiting |
| 45 | +- Control Panel restricted to admin roles |
47 | 46 |
|
48 | | -1. Extract the app package: tar -xzf wl_manager-1.0.0.spl |
49 | | -2. Copy to Splunk apps directory: cp -r wl_manager SPLUNK_HOME/etc/apps/ |
50 | | -3. Set proper permissions: chown -R splunk:splunk SPLUNK_HOME/etc/apps/wl_manager |
51 | | -4. Restart Splunk: SPLUNK_HOME/bin/splunk restart |
| 47 | +### Row Expiration |
52 | 48 |
|
53 | | -## Configuration |
| 49 | +- Set expiration dates with presets (7d, 30d, 6mo, 1yr) or custom date/time |
| 50 | +- Expired rows auto-removed on CSV load and via hourly scheduled cleanup |
| 51 | +- Expiring-soon alerts in the Audit Trail dashboard |
54 | 52 |
|
55 | | -### 1. Map Detection Rules |
| 53 | +## Quick Start |
56 | 54 |
|
57 | | -Edit the rule_csv_map.csv file to define which detection rules use which lookup files: |
| 55 | +### Docker Demo (Try Before Installing) |
58 | 56 |
|
59 | | -- Location: lookups/rule_csv_map.csv |
60 | | -- Format: rule_name,csv_lookup_file,description |
61 | | -- Example: DR20_whitelist,DR20_whitelist.csv,DNS Tunneling Detection |
| 57 | +```bash |
| 58 | +# Clone and start |
| 59 | +git clone https://github.com/RelativisticJet/wl_manager.git |
| 60 | +cd wl_manager |
| 61 | +docker compose up -d |
62 | 62 |
|
63 | | -### 2. Assign User Roles and Capabilities |
| 63 | +# Wait ~90 seconds for Splunk to start, then open: |
| 64 | +# http://localhost:8000 (admin / Chang3d!) |
| 65 | +``` |
64 | 66 |
|
65 | | -The app includes custom roles for access control: |
| 67 | +Navigate to **Apps > Whitelist Manager** to start using the app. |
66 | 68 |
|
67 | | -- wl_manager_admin: Full access to manage all whitelists and settings |
68 | | -- wl_manager_approver: Can approve whitelist changes |
69 | | -- wl_manager_user: Can view and submit whitelist change requests |
| 69 | +### Install on Existing Splunk |
70 | 70 |
|
71 | | -Assign roles in Settings menu or through your identity provider. |
| 71 | +Download the latest `.spl` from the [Releases](https://github.com/RelativisticJet/wl_manager/releases) page. |
72 | 72 |
|
73 | | -### 3. Verify Index Configuration |
| 73 | +**Option A — Splunk Web UI:** |
74 | 74 |
|
75 | | -Ensure that your Splunk instance has an index for audit logs: |
| 75 | +1. Go to **Apps > Manage Apps > Install app from file** |
| 76 | +2. Upload `wl_manager-2.0.0.spl` |
| 77 | +3. Restart Splunk when prompted |
76 | 78 |
|
77 | | -1. Go to Settings and select Indexes |
78 | | -2. Verify audit index exists (default Splunk index) |
79 | | -3. The Whitelist Manager logs changes to the audit index automatically |
| 79 | +**Option B — CLI:** |
80 | 80 |
|
81 | | -## Usage |
| 81 | +```bash |
| 82 | +$SPLUNK_HOME/bin/splunk install app wl_manager-2.0.0.spl |
| 83 | +$SPLUNK_HOME/bin/splunk restart |
| 84 | +``` |
82 | 85 |
|
83 | | -### Accessing the Application |
| 86 | +**Option C — Manual:** |
84 | 87 |
|
85 | | -1. Log in to your Splunk instance |
86 | | -2. In the app picker, select Whitelist Manager |
87 | | -3. You will see the main dashboard with available detection rules |
| 88 | +```bash |
| 89 | +tar -xzf wl_manager-2.0.0.spl -C $SPLUNK_HOME/etc/apps/ |
| 90 | +chown -R splunk:splunk $SPLUNK_HOME/etc/apps/wl_manager |
| 91 | +$SPLUNK_HOME/bin/splunk restart |
| 92 | +``` |
88 | 93 |
|
89 | | -### Managing Whitelists |
| 94 | +## Post-Installation Setup |
90 | 95 |
|
91 | | -View Whitelist Entries: |
92 | | -- Select a detection rule from the dropdown |
93 | | -- Current whitelist entries display in a table |
94 | | -- Use filters to search for specific entries |
| 96 | +### 1. Create User Roles |
95 | 97 |
|
96 | | -Add Whitelist Entry: |
97 | | -- Click Add Entry button |
98 | | -- Fill in required fields (varies by rule type) |
99 | | -- Click Save to add the entry |
| 98 | +The app ships with three roles in `authorize.conf`. Assign them to your users via **Settings > Access Controls > Roles**: |
100 | 99 |
|
101 | | -Remove Whitelist Entry: |
102 | | -- Click the delete icon next to an entry |
103 | | -- Confirm deletion when prompted |
104 | | -- Change is logged and applied immediately |
| 100 | +| Role | Can View | Can Edit | Control Panel | Inherits | |
| 101 | +|------|----------|----------|---------------|----------| |
| 102 | +| `wl_admin` | Yes | Yes | Yes | `power` | |
| 103 | +| `wl_analyst_editor` | Yes | Yes | No | `power` | |
| 104 | +| `wl_analyst_viewer` | Yes | No | No | `user` | |
105 | 105 |
|
106 | | -### Checking Audit Trail |
| 106 | +Legacy roles `wl_editor` and `wl_viewer` are supported for backward compatibility. |
107 | 107 |
|
108 | | -Navigate to the Audit Trail tab to: |
109 | | -- View all whitelist changes with timestamps |
110 | | -- See which user made each change |
111 | | -- Review the action taken (add, remove, modify) |
112 | | -- Track entry details that were modified |
113 | | -- Export audit logs for compliance reporting |
| 108 | +### 2. Map Your Detection Rules |
114 | 109 |
|
115 | | -## Architecture |
| 110 | +Edit `lookups/rule_csv_map.csv` to map your detection rules to CSV lookup files: |
116 | 111 |
|
117 | | -The Whitelist Manager consists of several key components: |
| 112 | +```csv |
| 113 | +rule_name,csv_file,app_context |
| 114 | +DR20_malicious_command,DR20_whitelist.csv,wl_manager |
| 115 | +DR55_brute_force_login,DR55_brute_force_users.csv,wl_manager |
| 116 | +``` |
118 | 117 |
|
119 | | -### CSV Lookup Files |
120 | | -- Rule-specific CSV files in the lookups/ directory |
121 | | -- Format: CSV with whitelist entries |
122 | | -- Updated in real-time by the backend handler |
| 118 | +- `rule_name` — display name in the Detection Rule dropdown |
| 119 | +- `csv_file` — the CSV lookup file in the app's `lookups/` directory |
| 120 | +- `app_context` — the Splunk app containing the CSV (usually `wl_manager`) |
123 | 121 |
|
124 | | -### Web Interface |
125 | | -- React-based front-end for intuitive user experience |
126 | | -- Located in appserver/static/ |
127 | | -- Dashboard, control panel, and audit trail views |
| 122 | +The app ships with 18 sample detection rules. Replace or extend these with your own. |
128 | 123 |
|
129 | | -### Backend Handler |
130 | | -- Python script (bin/wl_handler.py) processes whitelist changes |
131 | | -- Updates CSV lookup files |
132 | | -- Logs all operations to audit index |
133 | | -- Enforces role-based permissions |
| 124 | +### 3. Verify the Audit Index |
134 | 125 |
|
135 | | -### Configuration Files |
136 | | -- app.conf: App metadata and version info |
137 | | -- restmap.conf: REST API endpoint definitions |
138 | | -- authorize.conf: Role-based access control rules |
139 | | -- props.conf: Lookup file properties |
140 | | -- rule_csv_map.csv: Detection rule to lookup file mappings |
| 126 | +The app creates a `wl_audit` index automatically via `indexes.conf`. Verify it exists: |
141 | 127 |
|
142 | | -## Development |
| 128 | +```spl |
| 129 | +| eventcount index=wl_audit |
| 130 | +``` |
143 | 131 |
|
144 | | -### Building the App |
| 132 | +### 4. Configure Daily Limits (Optional) |
145 | 133 |
|
146 | | -To build a deployable package from source: |
| 134 | +Admins can configure per-analyst daily limits from the **Control Panel > Limits & Permissions** tab: |
147 | 135 |
|
148 | | -bash |
149 | | -./scripts/package.sh |
150 | | -bash |
| 136 | +- Row additions, removals, edits (default: 10/day each) |
| 137 | +- Column additions and removals (default: 2/day each) |
| 138 | +- Reverts (default: 3/day) |
| 139 | +- Approval thresholds for bulk operations (default: 3+ rows) |
151 | 140 |
|
152 | | -Output: dist/wl_manager-VERSION.spl |
| 141 | +## Architecture |
153 | 142 |
|
154 | | -### Testing |
| 143 | +```text |
| 144 | +wl_manager/ |
| 145 | + bin/wl_handler.py # REST handler (all server logic) |
| 146 | + appserver/static/ |
| 147 | + whitelist_manager.js # Main dashboard controller |
| 148 | + whitelist_manager.css # Styles (dark/light theme) |
| 149 | + control_panel.js # Admin Control Panel |
| 150 | + notifications.js # Approval notification system |
| 151 | + default/ |
| 152 | + app.conf # App metadata |
| 153 | + restmap.conf # REST endpoint config |
| 154 | + authorize.conf # RBAC role definitions |
| 155 | + indexes.conf # wl_audit index |
| 156 | + savedsearches.conf # Expiration alert |
| 157 | + data/ui/views/ |
| 158 | + whitelist_manager.xml # Main dashboard |
| 159 | + audit.xml # Audit trail dashboard |
| 160 | + control_panel.xml # Admin panel |
| 161 | + lookups/ |
| 162 | + rule_csv_map.csv # Detection rule -> CSV mapping |
| 163 | +``` |
| 164 | + |
| 165 | +### How It Works |
| 166 | + |
| 167 | +1. **Frontend** (JavaScript + jQuery) builds the entire UI dynamically inside Splunk SimpleXML panels |
| 168 | +2. **Backend** (`wl_handler.py`) is a `PersistentServerConnectionApplication` handling GET/POST at `/custom/wl_manager` |
| 169 | +3. **Diff engine** uses similarity-based matching to correctly detect edits even when rows are simultaneously removed |
| 170 | +4. **Audit events** are written directly to the `wl_audit` index via Splunk's REST API |
| 171 | +5. **Version snapshots** are stored in `lookups/_versions/` with a JSON manifest |
155 | 172 |
|
156 | | -Validate the app package: |
| 173 | +## Development |
157 | 174 |
|
158 | | -bash |
159 | | -./scripts/validate.sh |
160 | | -bash |
| 175 | +### Prerequisites |
161 | 176 |
|
162 | | -Run integration tests: |
| 177 | +- Docker and Docker Compose |
| 178 | +- Git Bash (Windows) or any Unix shell |
| 179 | +- Python 3.9+ (for validation) |
163 | 180 |
|
164 | | -bash |
165 | | -pytest tests/ -v |
166 | | -bash |
| 181 | +### Development Workflow |
167 | 182 |
|
168 | | -### Modifying Detection Rules |
| 183 | +```bash |
| 184 | +# Start dev environment |
| 185 | +make docker-up |
| 186 | +make docker-wait |
169 | 187 |
|
170 | | -To add a new detection rule to the Whitelist Manager: |
| 188 | +# After code changes |
| 189 | +make validate # Run AppInspect-style checks |
| 190 | +make test # Run integration tests |
171 | 191 |
|
172 | | -1. Create a new CSV lookup file in lookups/ directory |
173 | | -2. Define column structure matching your rule requirements |
174 | | -3. Add entry to lookups/rule_csv_map.csv |
175 | | -4. Update bin/wl_handler.py if new field types needed |
176 | | -5. Rebuild and test the app package |
| 192 | +# Build release package |
| 193 | +make package # Outputs dist/wl_manager-VERSION.spl |
| 194 | +``` |
177 | 195 |
|
178 | | -## Troubleshooting |
| 196 | +### Adding a New Detection Rule |
179 | 197 |
|
180 | | -### App Not Appearing in App Picker |
181 | | -- Check app is installed in Manage Apps |
182 | | -- Verify app.conf is properly formatted |
183 | | -- Restart Splunk and clear browser cache |
| 198 | +1. Create a CSV file in `lookups/` with your column headers |
| 199 | +2. Add a row to `lookups/rule_csv_map.csv` |
| 200 | +3. The new rule appears in the dashboard dropdown immediately (no code changes needed) |
184 | 201 |
|
185 | | -### Whitelist Changes Not Applying |
186 | | -- Verify the backend handler has proper permissions |
187 | | -- Check Splunk logs for Python errors in bin/wl_handler.py |
188 | | -- Ensure lookup file path in rule_csv_map.csv is correct |
189 | | -- Verify detection rule references the correct lookup file |
| 202 | +## Requirements |
190 | 203 |
|
191 | | -### Permission Denied Errors |
192 | | -- Ensure user has appropriate wl_manager role assigned |
193 | | -- Check authorize.conf for correct role definitions |
194 | | -- Verify REST API endpoint permissions in restmap.conf |
| 204 | +- Splunk Enterprise 8.x or 9.x (tested on 9.3.1) |
| 205 | +- Python 3 (bundled with Splunk 8+) |
| 206 | +- ~10 MB disk space for the app + audit data |
195 | 207 |
|
196 | | -### Contact Support |
| 208 | +## License |
197 | 209 |
|
198 | | -For additional issues, check the documentation or open an issue on GitHub repository. |
| 210 | +MIT License. See [LICENSE](LICENSE) for details. |
199 | 211 |
|
200 | | -## License and Support |
| 212 | +## Contributing |
201 | 213 |
|
202 | | -This application is provided as-is for use within your organization. |
203 | | -For support, questions, or contributions, please contact your team lead. |
| 214 | +Issues and pull requests welcome at [github.com/RelativisticJet/wl_manager](https://github.com/RelativisticJet/wl_manager). |
0 commit comments