Removing a GitHub Organization

In this guide, you will safely remove a GitHub organization from your Turbot Guardrails workspace. This process deletes all associated CMDB records and policy settings from Guardrails but does not affect any resources in your actual GitHub organization.

The removal process has three phases: disabling event handlers (which removes webhooks from GitHub), cleaning up credential policies, and deleting the connection.

[!WARNING] Removing a GitHub organization from Guardrails permanently deletes all its CMDB records, policy settings, and control history. This action cannot be undone.

Prerequisites

Step 1: Disable Event Handlers

Before removing the organization, disable the Event Handlers to cleanly remove any Guardrails-configured webhooks from your GitHub organization.

Navigate to the Guardrails > Policies page. Search for GitHub > Organization > Event Handlers and select the existing policy setting for your organization.

Policies page showing the GitHub Organization Event Handlers policy currently set to Enforce Enabled

Select the Edit button in the top-right corner. Change the setting to Enforce: Disabled and select Update.

Policy setting editor with Enforce Disabled selected

This triggers Guardrails to remove the webhook from your GitHub organization.

Step 2: Verify Webhook Removal

Confirm that the GitHub > Organization > Event Handlers control reaches OK status. Then navigate to your GitHub organization's Settings > Webhooks and verify that no Guardrails-configured webhooks remain.

GitHub organization webhooks page showing no Guardrails webhooks

Step 3: Remove Credential Policy

Delete the GitHub > Config > Personal Access Token policy configured for the target GitHub organization. This ensures that Guardrails no longer has stored credentials for the organization.

Navigate to the Guardrails > Policies page, search for GitHub > Config > Personal Access Token, and delete the policy setting.

Policy page showing the delete action for the GitHub Config Personal Access Token policy

Step 4: Delete the Connection

Navigate to the organization's page and select Delete Connection in the top right corner.

Organization page showing the Delete Connection button

A confirmation dialog appears. Type the organization name to confirm, then select Delete to permanently remove the connection.

Delete confirmation dialog requiring the organization name to be typed

Step 5: Review

Guardrails begins the deletion process. The time required depends on the number of policies and resources associated with the organization. Larger organizations take longer.

Troubleshooting

IssueSolution
Deletion errorsErrors may occur due to database locks or incomplete cleanup. Ensure all event handlers and policies have been removed before retrying. See Troubleshooting.
Webhooks still present in GitHubIf Guardrails webhooks weren't removed during step 1, manually delete them from your GitHub organization's Settings > Webhooks page.
Further assistanceOpen a support ticket with screenshots and error details, or join the #guardrails channel in the Turbot Community Slack.