Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

openctemio/sdk

Repository files navigation

OpenCTEM SDK

Go SDK for building integrations with the OpenCTEM security platform.

License Go Go Reference

Overview

OpenCTEM SDK provides Go packages for:

  • API client for interacting with OpenCTEM API
  • Scanner integrations (Semgrep, Trivy, Nuclei, etc.)
  • Output formatters (SARIF, JSON)
  • Common utilities and helpers

Installation

go get github.com/openctemio/sdk

Quick Start

API Client

package main

import (
    "context"
    "github.com/openctemio/sdk/pkg/client"
)

func main() {
    // Create client
    c := client.New(
        client.WithBaseURL("http://localhost:8080"),
        client.WithAPIKey("your-api-key"),
    )

    // List assets
    assets, err := c.Assets().List(context.Background())
    if err != nil {
        panic(err)
    }

    // Create finding
    finding := &client.Finding{
        Title:    "SQL Injection",
        Severity: "HIGH",
        // ...
    }
    err = c.Findings().Create(context.Background(), finding)
}

Scanner Integration

package main

import (
    "github.com/openctemio/sdk/pkg/scanners/semgrep"
    "github.com/openctemio/sdk/pkg/handler"
)

func main() {
    // Create scanner
    scanner := semgrep.New(
        semgrep.WithConfig("p/security-audit"),
    )

    // Run scan
    results, err := scanner.Scan(context.Background(), "./src")
    if err != nil {
        panic(err)
    }

    // Handle results
    h := handler.New(
        handler.WithAPIClient(client),
        handler.WithOutputFile("results.sarif"),
    )
    h.Handle(results)
}

Packages

Package Description
pkg/client API client for OpenCTEM API
pkg/scanners Scanner integrations (Semgrep, Trivy, Nuclei, Gitleaks)
pkg/handler Result handlers and output formatters
pkg/core Core types and interfaces
pkg/errors Error types and handling
pkg/retry Retry utilities
pkg/metrics Prometheus metrics
pkg/health Health check utilities
pkg/transport HTTP/gRPC transport
pkg/credentials Credential management
pkg/connectors SCM connectors (GitHub, GitLab)
pkg/enrichers Data enrichment (CVE, NVD)

Examples

See examples/ for complete examples:

  • Basic API client usage
  • Scanner integration
  • CI/CD pipeline integration
  • Custom scanner development

Building

# Run tests
go test ./...

# Generate proto files
make proto

# Lint
make lint

Contributing

We welcome contributions! Please see CONTRIBUTING.md.

Related Projects

Enterprise Edition

For advanced features and enterprise support, see OpenCTEM Enterprise.

License

Apache License 2.0 - see LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages