gitlabGitLab CI Offboarding

Automated offboarding workflow for GitLab CI environments that identifies and reports all applications requiring manual access revocation.


Overview

This GitLab CI pipeline helps automate the offboarding process by identifying all applications where a departing employee has access. It generates a comprehensive report and can optionally send notifications to the security team.

Features

  • Complete access audit: Identifies all WorkApps where the user has access

  • Detailed reporting: Generates comprehensive offboarding reports

  • Slack notifications: Optional notifications to security teams

  • Manual action tracking: Lists apps requiring manual revocation

  • Error handling: Robust error handling with detailed error messages

Prerequisites

GitLab CI Requirements

  • GitLab 13.0+ with CI/CD enabled

  • Access to create CI/CD variables

  • Appropriate permissions to run pipelines

CI/CD Variables

Configure these variables in your GitLab project:

  • CAKEWALK_API_KEY: Your Cakewalk API key

  • CAKEWALK_API_SECRET: Your Cakewalk API secret

  • SLACK_WEBHOOK_URL: (Optional) Slack webhook URL for notifications

API Limitations

Important: The current Cakewalk API does not have a DELETE endpoint for removing individual user access. This pipeline will:

  • ✅ Identify all apps the user has access to

  • ✅ Generate a detailed report

  • ⚠️ Require manual revocation in the Cakewalk UI

Setup Instructions

1. Create the Pipeline File

Create .gitlab-ci.yml in your repository:

2. Configure CI/CD Variables

In your GitLab project, go to SettingsCI/CDVariables and add:

  • CAKEWALK_API_KEY: Your Cakewalk API key

  • CAKEWALK_API_SECRET: Your Cakewalk API secret

  • SLACK_WEBHOOK_URL: (Optional) Slack webhook URL

3. Test the Pipeline

  1. Go to your project's CI/CDPipelines

  2. Click Run pipeline

  3. Set the EMPLOYEE_EMAIL variable

  4. Click Run pipeline

Usage Examples

Manual Trigger

Scheduled Execution

Add to your .gitlab-ci.yml for scheduled execution:

Integration with HR Systems

Trigger from external systems:

Customization

Adding Email Notifications

Add email notification functionality:

Adding Approval Step

For sensitive offboarding, add an approval step:

Adding Multiple Environments

Support different environments:

Monitoring & Troubleshooting

Pipeline Logs

  • Check the CI/CDPipelines tab for detailed execution logs

  • Look for error messages in the job outputs

  • Review the summary report for access details

Common Issues

"User not found" Error:

  • Verify the user exists in Cakewalk

  • Check email spelling and case sensitivity

  • Ensure the user hasn't already been deleted

"401 Unauthorized" Error:

  • Verify API key and secret are correct

  • Check that credentials haven't expired

  • Ensure proper header formatting

"Empty response" Error:

  • Verify the API endpoint URL

  • Check network connectivity

  • Review API rate limits

Debugging

Enable debug mode for more detailed logging:

Security Considerations

  • CI/CD Variables: Store as encrypted variables, never in code

  • Access Control: Limit who can trigger sensitive pipelines

  • Audit Logging: Enable detailed logging for all pipeline runs

  • Manual Verification: Always verify access revocation in the UI

Next Steps

  • Set up monitoring: Configure alerts for failed pipelines

  • Add notifications: Integrate with Slack, email, or other systems

  • Automate further: Consider triggering from HR systems

  • Request API improvements: Ask Cakewalk for DELETE endpoint support

Last updated

Was this helpful?