This rule ensures that CodeBuild projects use OAuth for GitHub or Bitbucket source repository URLs.
Rule | CodeBuild GitHub or Bitbucket source repository URLs should use OAuth |
Framework | SOC 2 |
Severity | ✔ Critical |
Rule Description:
The rule states that CodeBuild source repository URLs for GitHub or Bitbucket should use OAuth for SOC 2 compliance. This means that instead of using personal access tokens or other credentials for authentication, OAuth should be utilized to securely authenticate and authorize access to the source code repositories.
Troubleshooting Steps:
If you encounter any issues or errors related to CodeBuild source repository URLs not using OAuth, you can follow these troubleshooting steps:
Verify OAuth Integration: Double-check if the OAuth integration with the chosen source repository (GitHub or Bitbucket) has been properly set up. Ensure that the required permissions are granted to CodeBuild for accessing the repository.
Review OAuth Configuration: Review the OAuth configuration settings for CodeBuild and make sure they align with the best practices and guidelines provided by the source repository provider. Confirm that the necessary redirect URIs and client IDs have been configured correctly.
Check OAuth Token Expiration: Examine the OAuth tokens being used by CodeBuild and validate their expiration dates. If the tokens have expired, refresh them by following the appropriate steps provided by the source repository provider.
Review OAuth Scopes: Verify that the OAuth scopes granted to CodeBuild are appropriate and limit access only to the required resources. Avoid excess permissions that could compromise the security of the source repository.
Confirm OAuth Two-Factor Authentication: Ensure that two-factor authentication (2FA) is enabled for the OAuth integration with the source repository. This adds an additional layer of security and helps prevent unauthorized access.
Review CodeBuild IAM Roles: Confirm that the IAM roles assigned to CodeBuild have the necessary permissions to interact with the source repository using OAuth. Rectify any missing or incorrect permissions.
Necessary Codes:
There are no specific codes associated with this rule. The implementation of OAuth in CodeBuild for GitHub or Bitbucket source repositories is primarily configuration-based rather than code-based.
Step-by-Step Guide for Remediation:
Follow these step-by-step instructions to remediate CodeBuild source repository URLs not using OAuth for SOC 2 compliance:
Step 1: Verify OAuth Integration
Step 2: Review OAuth Configuration
Step 3: Check OAuth Token Expiration
Step 4: Review OAuth Scopes
Step 5: Confirm OAuth Two-Factor Authentication
Step 6: Review CodeBuild IAM Roles
By following these steps, you can ensure that CodeBuild source repository URLs for GitHub or Bitbucket use OAuth, aligning with SOC 2 compliance requirements.