Skip to content

Commit c1aee72

Browse files
committed
docs: update all docs with latest changes
1 parent ebc4964 commit c1aee72

File tree

4 files changed

+69
-110
lines changed

4 files changed

+69
-110
lines changed

README.md

Lines changed: 32 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ make build-server
3939
# run (or use systemd, Docker, Kubernetes, etc.)
4040
./dist/server
4141

42-
# server listens on PORT (default: 8080)
42+
# server listens on APP_PORT (default: 8080)
4343
# endpoints:
4444
# POST /webhooks - GitHub webhook receiver
4545
# POST /scheduled/okta-sync - Trigger Okta sync (call via cron)
46+
# POST /scheduled/slack-test - Send test notification to Slack
4647
# GET /server/status - Health check
4748
# GET /server/config - Config (secrets redacted)
4849
```
@@ -64,6 +65,8 @@ instructions including API Gateway and EventBridge configuration.
6465

6566
## Configuration
6667

68+
See [`.env.example`](.env.example) for a complete configuration reference.
69+
6770
All configuration values support direct values or AWS SSM parameter references.
6871
For sensitive values like secrets and private keys, use SSM parameters with
6972
automatic decryption:
@@ -115,15 +118,19 @@ APP_GITHUB_WEBHOOK_SECRET=arn:aws:ssm:us-east-1:123456789012:parameter/github-bo
115118

116119
### Optional: Slack
117120

118-
| Variable | Description |
119-
|--------------------------|---------------------------------|
120-
| `APP_SLACK_TOKEN` | Bot token (`xoxb-...`) |
121-
| `APP_SLACK_CHANNEL` | Default channel ID |
121+
| Variable | Description |
122+
|-----------------------------------|------------------------------------------|
123+
| `APP_SLACK_TOKEN` | Bot token (`xoxb-...`) |
124+
| `APP_SLACK_CHANNEL` | Default channel ID |
125+
| `APP_SLACK_CHANNEL_PR_BYPASS` | Channel for PR bypass alerts (optional) |
126+
| `APP_SLACK_CHANNEL_OKTA_SYNC` | Channel for sync reports (optional) |
127+
| `APP_SLACK_CHANNEL_ORPHANED_USERS`| Channel for orphan alerts (optional) |
122128

123129
### Other
124130

125131
| Variable | Description |
126132
|--------------------------|------------------------------------------------|
133+
| `APP_PORT` | Server port (default: `8080`) |
127134
| `APP_DEBUG_ENABLED` | Verbose logging (default: `false`) |
128135
| `APP_BASE_PATH` | URL prefix to strip (e.g., `/api/v1`) |
129136

@@ -153,29 +160,13 @@ Map Okta groups to GitHub teams using JSON rules:
153160
]
154161
```
155162

156-
**Rule Fields**:
157-
- `name` - Rule identifier
158-
- `enabled` - Enable/disable rule
159-
- `okta_group_pattern` - Regex to match Okta groups
160-
- `okta_group_name` - Exact Okta group name (alternative to pattern)
161-
- `github_team_prefix` - Prefix for GitHub team names
162-
- `github_team_name` - Exact GitHub team name (overrides pattern)
163-
- `strip_prefix` - Remove this prefix from Okta group name
164-
- `sync_members` - Sync members between Okta and GitHub
165-
- `create_team_if_missing` - Auto-create GitHub teams
166-
- `team_privacy` - `secret` or `closed`
163+
See [Okta Setup - Sync Rules](docs/okta-setup.md#step-10-configure-sync-rules)
164+
for detailed rule field documentation.
167165

168166
**Sync Safety Features**:
169-
- **Active users only**: Only syncs users with `ACTIVE` status in Okta,
170-
automatically excluding suspended or deprovisioned accounts
171-
- **External collaborator protection**: Never removes outside collaborators
172-
(non-org members), preserving contractors and partner access
173-
- **Outage protection**: Safety threshold (default 50%) prevents mass removal
174-
if Okta/GitHub is experiencing issues. Sync aborts if removal ratio exceeds
175-
threshold
176-
- **Orphaned user detection**: Identifies organization members not in any
177-
Okta-synced teams and sends Slack notifications. Enabled by default when
178-
sync is enabled.
167+
- Only syncs `ACTIVE` Okta users; never removes outside collaborators
168+
- Safety threshold (default 50%) aborts sync if too many removals detected
169+
- Orphaned user detection alerts when org members aren't in any synced teams
179170

180171
## Integration Setup
181172

@@ -223,44 +214,21 @@ CMD ["/server"]
223214
## How It Works
224215

225216
```
226-
┌─────────────────────────────────────────────────┐
227-
│ github-ops-app │
228-
│ │
229-
┌──────────────┐ │ ┌───────────────────────────────────────────┐ │
230-
│ GitHub │ webhooks │ │ Webhook Handler │ │
231-
│ │───────────────▶ • PR merge events │ │
232-
│ • PR merge │ │ │ • Team membership changes │ │
233-
│ • Team edit │ │ │ • Signature verification │ │
234-
└──────────────┘ │ └─────────────┬─────────────────────────────┘ │
235-
│ │ │
236-
│ ▼ │
237-
│ ┌─────────────────────────────────────────┐ │
238-
│ │ PR Compliance Check │ │
239-
┌──────────────┐ │ │ • Branch protection verification │────────┐
240-
│ Okta │ │ │ • Required checks validation │ │ │
241-
│ │ │ │ • Bypass detection │ │ │
242-
│ • Groups │◀──────────────┴─────────────────────────────────────────┘ │ │
243-
│ • Users │ │ │ │
244-
└──────────────┘ │ ┌─────────────────────────────────────────┐ │ │
245-
│ │ │ Okta Sync Engine │ │ │
246-
│ │ │ • Match groups via rules │ │ │
247-
└─────────────────────────▶ • Create/update GitHub teams │ │ │
248-
│ │ • Sync team membership │ │ │
249-
│ │ • Orphaned user detection │────────┤
250-
│ │ • Safety threshold protection │ │ │
251-
┌──────────────┐ │ └─────────────────────────────────────────┘ │ │
252-
│ GitHub │ │ │ │ │
253-
│ Teams API │◀─────────────────────────────────────────────────────────────┘ │
254-
│ │ │ │ │
255-
│ • Teams │ └─────────────────────────────────────────────────┘ │
256-
│ • Members │ │
257-
└──────────────┘ │
258-
┌──────────────┐ │
259-
│ Slack │◀─────────────────────────────────────┘
260-
│ │ Notifications
261-
│ • Alerts │ • PR violations
262-
│ • Reports │ • Sync reports
263-
└──────────────┘ • Orphaned users
217+
┌────────────┐ ┌─────────────────────────────────────┐ ┌────────────┐
218+
│ GitHub │────▶│ github-ops-app │────▶│ Slack │
219+
│ webhooks │ │ │ │ alerts │
220+
└────────────┘ │ ┌───────────────────────────────┐ │ └────────────┘
221+
│ │ PR Compliance Check │ │
222+
┌────────────┐ │ │ • Verify branch protection │ │ ┌────────────┐
223+
│ Okta │────▶│ │ • Detect bypasses │ │────▶│ GitHub │
224+
│ groups │ │ └───────────────────────────────┘ │ │ Teams API │
225+
└────────────┘ │ │ └────────────┘
226+
│ ┌───────────────────────────────┐ │
227+
│ │ Okta Sync Engine │ │
228+
│ │ • Map groups to teams │ │
229+
│ │ • Sync membership │ │
230+
│ └───────────────────────────────┘ │
231+
└─────────────────────────────────────┘
264232
```
265233

266234
### Okta Sync Flow

cmd/lambda/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Upload `dist/bootstrap` to your Lambda function via:
4141

4242
### 3. Configure Environment Variables
4343

44-
Set all required environment variables (see [Configuration](#configuration)
45-
section in main README).
44+
Set all required environment variables (see
45+
[Configuration](../../README.md#configuration) in main README).
4646

4747
### 4. Setup Triggers
4848

@@ -101,11 +101,13 @@ request type and path.
101101
102102
When invoked via API Gateway:
103103
104-
| Method | Path | Description |
105-
|--------|-----------------------|-----------------------------------|
106-
| POST | `/webhooks` | GitHub webhook receiver |
107-
| GET | `/server/status` | Health check and feature flags |
108-
| GET | `/server/config` | Config inspection (secrets hidden)|
104+
| Method | Path | Description |
105+
|--------|------------------------|-----------------------------------|
106+
| POST | `/webhooks` | GitHub webhook receiver |
107+
| POST | `/scheduled/okta-sync` | Trigger Okta sync |
108+
| POST | `/scheduled/slack-test`| Send test notification to Slack |
109+
| GET | `/server/status` | Health check and feature flags |
110+
| GET | `/server/config` | Config inspection (secrets hidden)|
109111
110112
## Monitoring
111113

docs/okta-setup.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,22 @@ APP_OKTA_SYNC_RULES='[
167167
]'
168168
```
169169

170-
See the main README for complete sync rule documentation.
170+
### Rule Fields
171+
172+
| Field | Description |
173+
|-------------------------|------------------------------------------------------|
174+
| `name` | Rule identifier (for logging) |
175+
| `enabled` | Enable/disable rule (default: `true`) |
176+
| `okta_group_pattern` | Regex to match Okta groups |
177+
| `okta_group_name` | Exact Okta group name (alternative to pattern) |
178+
| `github_team_prefix` | Prefix for generated GitHub team names |
179+
| `github_team_name` | Exact GitHub team name (overrides pattern) |
180+
| `strip_prefix` | Remove this prefix from Okta group name |
181+
| `sync_members` | Sync members between Okta and GitHub (default: `true`)|
182+
| `create_team_if_missing`| Auto-create GitHub teams if they don't exist |
183+
| `team_privacy` | GitHub team visibility: `secret` or `closed` |
184+
185+
See the [main README](../README.md#okta-sync-rules) for additional examples.
171186

172187
## Verification
173188

docs/slack-setup.md

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,15 @@ This guide walks through creating a Slack app for github-ops-app notifications.
1515
2. Click **Create New App**
1616
3. Select **From an app manifest**
1717
4. Select your workspace
18-
5. Paste the manifest from `assets/slack/manifest.json`:
19-
20-
```json
21-
{
22-
"display_information": {
23-
"name": "GitHub Bot",
24-
"description": "GitHub automation bot with Okta sync and PR compliance monitoring",
25-
"background_color": "#24292e"
26-
},
27-
"features": {
28-
"bot_user": {
29-
"display_name": "GitHub Bot",
30-
"always_online": false
31-
}
32-
},
33-
"oauth_config": {
34-
"scopes": {
35-
"bot": [
36-
"channels:join",
37-
"channels:read",
38-
"chat:write.public",
39-
"chat:write"
40-
]
41-
}
42-
},
43-
"settings": {
44-
"org_deploy_enabled": false,
45-
"socket_mode_enabled": false,
46-
"token_rotation_enabled": false
47-
}
48-
}
49-
```
50-
18+
5. Copy the contents of [`assets/slack/manifest.json`](../assets/slack/manifest.json)
19+
and paste into the manifest editor
5120
6. Click **Create**
5221

5322
### Option B: Manual Setup
5423

5524
1. Go to [api.slack.com/apps](https://api.slack.com/apps)
5625
2. Click **Create New App****From scratch**
57-
3. Enter app name: `GitHub Bot`
26+
3. Enter app name: `GitHub Ops Bot`
5827
4. Select your workspace
5928
5. Click **Create App**
6029

@@ -128,7 +97,7 @@ curl -H "Authorization: Bearer xoxb-your-token" \
12897
For private channels, you must invite the bot:
12998

13099
1. Open the private channel
131-
2. Type `/invite @GitHub Bot` (or your bot's display name)
100+
2. Type `/invite @GitHub Ops Bot` (or your bot's display name)
132101
3. Or click the channel name → **Integrations****Add apps**
133102

134103
Public channels work without invitation when using `chat:write.public`.
@@ -139,6 +108,11 @@ Public channels work without invitation when using `chat:write.public`.
139108
# Required Slack configuration
140109
APP_SLACK_TOKEN=xoxb-1234567890-...
141110
APP_SLACK_CHANNEL=C01ABC2DEFG
111+
112+
# Optional: per-notification-type channels (override APP_SLACK_CHANNEL)
113+
APP_SLACK_CHANNEL_PR_BYPASS=C01234ABCDE
114+
APP_SLACK_CHANNEL_OKTA_SYNC=C01234ABCDE
115+
APP_SLACK_CHANNEL_ORPHANED_USERS=C01234ABCDE
142116
```
143117

144118
For AWS deployments, use SSM parameters:
@@ -153,10 +127,10 @@ Make notifications more recognizable:
153127

154128
1. Go to **Basic Information**
155129
2. Under **Display Information**:
156-
- **App name**: `GitHub Bot` (or your preference)
130+
- **App name**: `GitHub Ops Bot` (or your preference)
157131
- **Short description**: Brief description of the bot
158-
- **App icon**: Upload a custom icon (recommended: GitHub logo variant)
159-
- **Background color**: `#24292e` (GitHub dark) or your brand color
132+
- **App icon**: Upload a custom icon (use `assets/slack/icon.png` or your own)
133+
- **Background color**: `#10203B` or your brand color
160134

161135
## Verification
162136

0 commit comments

Comments
 (0)