LogoLogo
BlogHomepage
  • Quick Start
    • Onboarding Guide Walkthrough
  • Introduction
    • What is Garnet?
  • The Garnet Ecosystem
    • Jibril & Garnet Platform
    • Key Differences
  • Key Concepts
    • Environments
    • Jibril: Runtime Security Engine
    • Integrations
    • Events & Detections
  • Getting Started with Garnet Platform
    • Prerequisites
    • Step 1: Generate API Key
    • Step 2: Agent Setup
      • GitHub Actions Integration
      • Kubernetes Integration
    • Step 3: Configure Notifications
  • Using the Garnet Platform
    • Dashboard Overview
    • The Issues Page
    • Viewing Events
    • Understanding Alerts
  • Jibril Sensor: The Engine
    • Architecture & Technology (eBPF)
    • Core Capabilities (Detection & Blocking)
    • Deployment & Configuration
  • Use Cases
    • Securing CI/CD Pipelines
    • Runtime Protection in Production
  • Troubleshooting & Support
    • Troubleshooting Guide
    • Support Channels
  • Resources
    • Security
    • Community
      • Discord
    • Roadmap
    • Conclusion
Powered by GitBook

© 2025 Garnet Labs Inc.

On this page
  1. Getting Started with Garnet Platform
  2. Step 2: Agent Setup

GitHub Actions Integration

Last updated 10 days ago

This method integrates the Jibril sensor directly into your GitHub Actions workflows. This allows Garnet to monitor activities during your CI/CD pipeline, such as build processes, dependency installations, and testing phases, to detect and potentially block threats like malicious network calls (e.g., to C2 servers, data exfiltration attempts) or the execution of crypto miners before code is deployed.

Follow these steps:

  1. Add API Key as a Repository Secret:

    • Navigate to your GitHub repository where you want to set up the Garnet scan.

    • Go to Settings > Secrets and variables > Actions.

    • Click New repository secret.

    • For the secret name, use GARNET_API_TOKEN. (Ensure this matches the expected name in the Garnet GitHub Action; refer to the Action's documentation if it differs).

    • Paste the API key you generated in into the Secret (or Value) field.

    • Click Add secret.

  2. Create or Update Your GitHub Actions Workflow File:

    • In your repository, locate or create a workflow YAML file within the .github/workflows/ directory (e.g., garnet-security-scan.yml).

    • Add a job that uses the Garnet GitHub Action. The exact structure should be as follows:

    name: Garnet Security Scan
    
    on:
      push:
        branches: [ main ]
      pull_request:
        branches: [ main ]
      # Optional: Trigger on schedule (e.g., daily)
      # schedule:
      #   - cron: '0 0 * * *'
    
    jobs:
      garnet-scan:
        name: Run Garnet Scan
        runs-on: ubuntu-latest
        steps:
          - name: Checkout code
            uses: actions/checkout@v4 # Use latest major version
    
          - name: Run Garnet Security Scanner
            uses: garnet-org/action@v1
            with:
              # Store the token as a GitHub secret
              api_token: ${{ secrets.GARNET_API_TOKEN }}
    • Key with parameters for the Garnet Action:

      • api_token: ${{ secrets.GARNET_API_TOKEN }}: This is essential and passes your secured API key to the action.

      • The garnet-org/action@v1 is the official action to use.

    • Commit this workflow file to your repository.

  3. Verify Integration:

    • After committing the workflow, trigger it by pushing a commit to a monitored branch or opening/updating a pull request (depending on your on: configuration).

    • Check the Actions tab in your GitHub repository to see the workflow run.

    • Successful execution should show the Garnet Scan step completing.

    • Log in to your Garnet Platform dashboard. You should start seeing data and any potential detections from this repository and workflow.

By integrating Garnet into your GitHub Actions, you gain early visibility into security issues within your CI/CD process, helping to ensure that only secure code moves towards production. Detections can provide immediate feedback within pull requests, allowing developers to address issues quickly.

Step 1: Generate API Key