|
|
@@ -113,6 +113,7 @@ Edit `/etc/emergency-access/config.json`:
|
|
|
"notifications": {
|
|
|
"key_backends": ["matrix_sec", "pushover_emergency"],
|
|
|
"health_backends": ["matrix_health"],
|
|
|
+ "config_path": "/etc/emergency-access/ntfy.yml",
|
|
|
"key_message": "🚨 EMERGENCY: Decryption key accessed from server",
|
|
|
"health_message": "✅ Emergency access server health check completed",
|
|
|
"log_level": "WARNING",
|
|
|
@@ -136,8 +137,9 @@ Edit `/etc/emergency-access/config.json`:
|
|
|
- `dummy_file`: Path to dummy content for health checks
|
|
|
|
|
|
#### Notification Settings
|
|
|
-- `key_backends`: List of backend names from your global ntfy config for key access alerts
|
|
|
-- `health_backends`: List of backend names from your global ntfy config for health check notifications and all application logs
|
|
|
+- `key_backends`: List of backend names from `/etc/emergency-access/ntfy.yml` for key access alerts
|
|
|
+- `health_backends`: List of backend names from `/etc/emergency-access/ntfy.yml` for health check notifications and all application logs
|
|
|
+- `config_path`: Path to the ntfy configuration file (default: `/etc/emergency-access/ntfy.yml`)
|
|
|
- `key_message`: Message sent when key is accessed
|
|
|
- `health_message`: Message sent for health checks
|
|
|
- `log_level`: Minimum log level to send to health backends ("INFO", "WARNING", "ERROR")
|
|
|
@@ -147,7 +149,7 @@ Edit `/etc/emergency-access/config.json`:
|
|
|
- `matrix_sec`: Matrix backend for security alerts
|
|
|
- `pushover_emergency`: Pushover backend for emergency notifications
|
|
|
- `slack_critical`: Slack backend for critical alerts
|
|
|
-- Any backend name configured in your global `~/.ntfy.yml`
|
|
|
+- Any backend name configured in `/etc/emergency-access/ntfy.yml`
|
|
|
|
|
|
### Key and Dummy Files
|
|
|
|
|
|
@@ -167,27 +169,37 @@ Edit `/etc/emergency-access/config.json`:
|
|
|
|
|
|
## dschep/ntfy Backend Setup
|
|
|
|
|
|
-The system uses your existing global ntfy configuration. Simply reference your configured backend names in the emergency access configuration.
|
|
|
+The system uses a dedicated ntfy configuration file at `/etc/emergency-access/ntfy.yml`. Configure your notification backends in this file and reference them by name in the main configuration.
|
|
|
|
|
|
-### Using Your Existing Backends
|
|
|
+### Configuring Notification Backends
|
|
|
|
|
|
-1. **Check your global ntfy config** (typically `~/.ntfy.yml`):
|
|
|
+1. **Edit the dedicated ntfy config** (`/etc/emergency-access/ntfy.yml`):
|
|
|
```yaml
|
|
|
backends:
|
|
|
- matrix_sec
|
|
|
+ - matrix_health
|
|
|
- pushover_emergency
|
|
|
|
|
|
matrix_sec:
|
|
|
backend: matrix
|
|
|
url: https://your-matrix-server.com
|
|
|
- roomId: "!emergency:your-matrix-server.com"
|
|
|
+ roomId: "!emergency-security:your-matrix-server.com"
|
|
|
userId: "@emergency-bot:your-matrix-server.com"
|
|
|
- password: "your-bot-password"
|
|
|
+ password: "your-matrix-bot-password"
|
|
|
+
|
|
|
+ matrix_health:
|
|
|
+ backend: matrix
|
|
|
+ url: https://your-matrix-server.com
|
|
|
+ roomId: "!emergency-health:your-matrix-server.com"
|
|
|
+ userId: "@emergency-bot:your-matrix-server.com"
|
|
|
+ password: "your-matrix-bot-password"
|
|
|
|
|
|
pushover_emergency:
|
|
|
backend: pushover
|
|
|
user_key: YOUR_PUSHOVER_USER_KEY
|
|
|
priority: 2
|
|
|
+ retry: 60
|
|
|
+ expire: 3600
|
|
|
sound: siren
|
|
|
```
|
|
|
|
|
|
@@ -195,28 +207,38 @@ The system uses your existing global ntfy configuration. Simply reference your c
|
|
|
```json
|
|
|
"notifications": {
|
|
|
"key_backends": ["matrix_sec", "pushover_emergency"],
|
|
|
- "health_backends": ["matrix_sec"]
|
|
|
+ "health_backends": ["matrix_health"],
|
|
|
+ "config_path": "/etc/emergency-access/ntfy.yml"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-### Adding New Backends
|
|
|
+### Adding Additional Backends
|
|
|
|
|
|
-If you need additional backends for emergency access, add them to your global ntfy config:
|
|
|
+Add more backends to `/etc/emergency-access/ntfy.yml` as needed:
|
|
|
|
|
|
```yaml
|
|
|
-# Add to your ~/.ntfy.yml
|
|
|
+# Additional backends in /etc/emergency-access/ntfy.yml
|
|
|
backends:
|
|
|
- matrix_sec
|
|
|
+ - matrix_health
|
|
|
- pushover_emergency
|
|
|
- slack_critical
|
|
|
+ - email_emergency
|
|
|
|
|
|
slack_critical:
|
|
|
backend: slack
|
|
|
token: YOUR_SLACK_BOT_TOKEN
|
|
|
recipient: "#emergency-alerts"
|
|
|
-```
|
|
|
|
|
|
-Then reference them in the emergency access configuration.
|
|
|
+email_emergency:
|
|
|
+ backend: email
|
|
|
+ smtp_server: smtp.gmail.com
|
|
|
+ smtp_port: 587
|
|
|
+ username: your-email@gmail.com
|
|
|
+ password: your-app-password
|
|
|
+ to: emergency-team@company.com
|
|
|
+ from: emergency-access@company.com
|
|
|
+```
|
|
|
|
|
|
## Service Management
|
|
|
|
|
|
@@ -369,13 +391,13 @@ The service binds only to localhost (127.0.0.1:1127) and is accessed through you
|
|
|
2. **Notification failures**:
|
|
|
```bash
|
|
|
# Test dschep/ntfy installation and configuration
|
|
|
- ntfy send "test message"
|
|
|
+ NTFY_CONFIG=/etc/emergency-access/ntfy.yml ntfy send "test message"
|
|
|
|
|
|
- # Check global ntfy configuration
|
|
|
- cat ~/.ntfy.yml
|
|
|
+ # Check ntfy configuration
|
|
|
+ cat /etc/emergency-access/ntfy.yml
|
|
|
|
|
|
# Test specific backend
|
|
|
- ntfy -b matrix_sec send "test message"
|
|
|
+ NTFY_CONFIG=/etc/emergency-access/ntfy.yml ntfy -b matrix_sec send "test message"
|
|
|
```
|
|
|
|
|
|
3. **File permission errors**:
|
|
|
@@ -395,8 +417,8 @@ Test your setup before deployment:
|
|
|
sudo -u emergency-access /opt/emergency-access/venv/bin/python /opt/emergency-access/main.py --validate
|
|
|
|
|
|
# Test notifications manually with your backend
|
|
|
-ntfy -b matrix_sec send "Test notification"
|
|
|
-ntfy -b pushover_emergency send "Test emergency notification"
|
|
|
+NTFY_CONFIG=/etc/emergency-access/ntfy.yml ntfy -b matrix_sec send "Test notification"
|
|
|
+NTFY_CONFIG=/etc/emergency-access/ntfy.yml ntfy -b pushover_emergency send "Test emergency notification"
|
|
|
```
|
|
|
|
|
|
## Development
|