-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
Auditing SSL certificates for nginx configurations requires a complex pipeline:
# Current workflow (painful):
grep -h server_name /etc/nginx/conf.d/*.conf | \
grep -v '#' | \
awk '{print $2}' | \
sed 's/;$//' | \
grep -v 'localhost\|_' | \
sort -u | \
sed 's/^/ssl:\/\//' | \
reveal --stdin --check --format=json | \
jq 'select(.days_until_expiry < 7)'This is:
- Error-prone (easy to miss edge cases in nginx config parsing)
- Hard to remember
- Difficult to teach to team members
Proposed Solution
Option A: Extract flag for ssl:// adapter
reveal ssl://nginx:///etc/nginx/conf.d/*.conf --check
# Automatically:
# 1. Parse nginx configs
# 2. Extract server_name directives
# 3. Dedupe and filter (skip localhost, _, etc.)
# 4. Run SSL checks on each
# 5. Report resultsOption B: Nginx adapter with domain extraction
# Extract domains from nginx config
reveal nginx:///etc/nginx/conf.d/*.conf --extract=domains
# Output:
# domain1.com
# domain2.com
# ...
# Then pipe to ssl://
reveal nginx:///etc/nginx/conf.d/*.conf --extract=domains | \
sed 's/^/ssl:\/\//' | reveal --stdin --checkOption C: Composable adapter syntax
reveal ssl://$(reveal nginx:///etc/nginx/*.conf --domains) --checkUse Case
SaaS platforms with hundreds of white-label domains configured in nginx. Need to:
- Audit all SSL certs periodically
- Find expired/expiring certs quickly
- Identify domains with DNS issues (no longer pointing to us)
Implementation Notes
Nginx config parsing could use:
- Simple regex for
server_namedirectives (covers 90% of cases) - Or existing nginx config parser libraries
Key edge cases:
- Multiple
server_namevalues per line server_namewith wildcards (*.example.com)- Commented-out server blocks
- Include directives
Metadata
Metadata
Assignees
Labels
No labels