Skip to main content

Code Security Scanning

Overview

Code Security scans your connected repositories for security issues such as hardcoded secrets, API keys, and other vulnerabilities in your source code. Findings are presented with their file path, category, repository, and criticality.

Repository Integration

Supported Platforms

PlatformFeatures
GitHubFull integration
GitLabFull integration
BitbucketFull integration
Azure DevOpsFull integration

Connecting Repositories

  1. Navigate to CodeCode Security
  2. Click Connect Repository
  3. Select platform
  4. Authorize Bastion
  5. Select repositories to monitor

Repository Permissions

Bastion requires:

  • Read access to code
  • Read access to package manifests
  • Webhook permissions (optional)

Scanning

What We Detect

CategoryExamples
SecretsAPI keys, tokens, passwords, private keys
CredentialsDatabase connection strings, cloud credentials
ConfigurationInsecure settings, debug flags in production
VulnerabilitiesKnown vulnerability patterns in source code

Scan Process

  1. Repository code is analyzed
  2. Files are checked against detection rules
  3. Findings are categorized and rated by criticality
  4. Results are presented in the Code Security table

Scan Schedule

Scans run:

  • Monthly scheduled scan
  • Manual trigger via the Rescan button

Viewing Results

Code Security Table

Each finding includes:

ColumnDescription
PathFile path where the issue was found
CategoryType of security issue
RepoRepository name
Detection DateWhen the issue was discovered
CriticalitySeverity rating

Finding Details

Click on a finding to view:

  • Full file path and location
  • Issue description and category
  • Criticality level
  • Remediation guidance

Remediation

Workflow

ActionWhen to Use
FixRemove or rotate the exposed secret
RotateGenerate new credentials and revoke old ones
AcceptRisk accepted (documented)

Best Practices

Rotate Exposed Secrets Immediately

When a secret is found in code, rotate it immediately — even if the repository is private.

Use Environment Variables

Store secrets in environment variables or a secrets manager, never in source code.

Enable Pre-commit Hooks

Use pre-commit hooks to prevent secrets from being committed in the first place.

Monitor All Repositories

Include all repositories, even internal tools and scripts.

Compliance Evidence

Code security scanning supports:

FrameworkRequirement
SOC 2CC6.1
ISO 27001A.14.2.5

Next Steps