You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stream logs to SIEM tools (Splunk, Datadog) or storage (AWS S3, Azure Event Hubs) for real-time monitoring and long-term retention.
188
-
189
-
### Git and API Activity Logs
190
-
Monitoring Git and API activity logs is crucial for maintaining the security and integrity of your repositories. These logs provide visibility into user actions, enabling you to detect unauthorized access, investigate incidents, and ensure compliance with organizational policies.
191
-
192
-
-**Git activity:**`git.push`, `pull_request`, etc.
193
-
-**API activity:**`api.request`, include source IP for threat detection.
194
-
195
-
### Additional Events (EMUs)
196
-
Enterprise Managed Users add events like `user.login`, `repository.permissions_updated`, `repository.forked`.
197
-
198
-
### Filtering by Token
199
-
Query `?phrase=token` to find token-related actions and detect misuse.
200
-
201
-
## Key Security Features of a GitHub Repository
202
-
-**SECURITY.md:** Define reporting and supported versions.
203
-
-**Branch Protection:** Enforce reviews, status checks, and commit signing.
204
-
-**Dependabot Alerts:** Automatic vulnerability detection and updates.
205
-
-**Code Scanning:** Continuous analysis via CodeQL.
206
-
-**Secret Scanning & Push Protection:** Real-time prevention and alerts.
207
-
-**Security Advisories:** Draft, collaborate, and publish advisories.
208
-
-**Dependency Graph:** Visualize and audit dependencies.
209
-
-**2FA & RBAC:** Enforce strong authentication and least privilege.
210
-
-**Audit Logs:** Monitor, filter, and export logs for compliance.
|**Apps**| Varies by installation, depending on the app's configuration.|
226
-
227
-
**Check via API:**
228
-
```sh
229
-
curl -H "Authorization: token YOUR_TOKEN" \
230
-
-H "Accept: application/vnd.github.v3+json" \
231
-
https://api.github.com/rate_limit
232
-
```
233
-
234
-
GitHub Apps offer fine-grained permissions and are ideal for organizational integrations, while Personal Access Tokens (PATs) are simpler and tied to user accounts, making them suitable for basic scripts but with less control. OAuth Apps should be granted the least privilege scopes, with event subscriptions managed and reviewed regularly. Organizations can restrict untrusted apps through settings to enhance security.
235
-
236
-
Enterprise Managed Users (EMUs) provide managed accounts with limited scope, ensuring compliance and control. Data residency policies help organizations store logs and data in specified regions, aligning with regulatory requirements. API usage should adhere to organizational policies and residency guidelines to maintain compliance.
To ensure administrators to programmatically retrieve audit log data for analysis, compliance, or monitoring purposes, GitHub provides an API endpoint for exporting audit logs. Below is the REST endpoint used for fetching audit logs:
159
+
GitHub Apps offer fine-grained permissions ideal for organizational integrations, while PATs suit basic scripts. OAuth Apps should be granted least privilege, with event subscriptions managed and reviewed regularly. Organizations can restrict untrusted apps through settings to enhance security. Enterprise Managed Users provide managed accounts with limited scope, ensuring compliance. Data residency policies help organizations store logs in specified regions, aligning with regulatory requirements.
0 commit comments