rsvcmodel

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 0 Imported by: 0

README

rsvcmodel

rsvcmodel provides a standardized, normalized data contract for cross-cloud security, observability, and finops findings. It serves as one of the core schema library for the rtifact ecosystem.

Usage

This package provides standard Segment and Severity enums alongside the Finding struct. It is designed to be easily serialized to JSON across multiple microservices or CLI tools.

package main

import (
	"encoding/json"
	"fmt"
	
	"github.com/cipherops-io/rsvcmodel"
)

func main() {
	// Create a new normalized finding
	finding := rsvcmodel.NewFinding(
		rsvcmodel.SegmentSecurity,
		"S3 Bucket Public Access",
		"security",
		[]string{"my-public-bucket"},
	)
	
	finding.Severity = rsvcmodel.SeverityCritical
	finding.Provider = "aws"
	
	// Convert to JSON
	bytes, _ := json.MarshalIndent(finding, "", "  ")
	fmt.Println(string(bytes))
}

Data Types

Segments
  • SegmentSecurity
  • SegmentFinOps
  • SegmentObservability
Severities
  • SeverityInfo
  • SeverityLow
  • SeverityMedium
  • SeverityHigh
  • SeverityCritical

Documentation

Overview

Package rsvcmodel provides a normalized data contract for cloud findings. It defines the core structures used across various cloud providers to represent security, finops, and observability issues in a unified way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	// ID is a unique identifier for this specific finding output.
	ID string `json:"id,omitempty"`
	// Title is the human-readable name of the check or rule that triggered this finding.
	Title string `json:"title"`
	// Category is the provider-specific sub-category of the finding.
	Category string `json:"category"`
	// Segment maps the finding to a high-level domain (e.g., finops, security).
	Segment Segment `json:"segment"`
	// Severity is the standardized threat or urgency level of the finding.
	Severity Severity `json:"severity,omitempty"`
	// Provider indicates the source of the finding (e.g., aws, gcp, azure).
	Provider string `json:"provider,omitempty"`
	// Summary provides a brief description or context of what the finding means.
	Summary string `json:"summary,omitempty"`
	// Count represents the total number of resources flagged in this finding.
	Count int `json:"count,omitempty"`
	// Items contains human-readable names or pretty identifiers for the flagged resources.
	Items []string `json:"items,omitempty"`
	// ResourceIDs contains the exact native cloud IDs (e.g., ARNs, UUIDs) for the flagged resources.
	ResourceIDs []string `json:"resourceIds,omitempty"`
	// Metadata holds arbitrary key-value pairs for additional context, such as deep links or native properties.
	Metadata map[string]any `json:"metadata,omitempty"`
}

Finding is the normalized output unit across all clouds and segments. It aggregates flagged resources and their metadata for a specific check or rule.

func NewFinding

func NewFinding(segment Segment, title, category string, items []string) *Finding

NewFinding creates a new Finding with the basic required fields initialized. It automatically sets the Count field based on the length of the provided items slice.

type Segment

type Segment string
const (
	// SegmentObservability indicates findings related to performance, reliability, and tracing.
	SegmentObservability Segment = "observability"
	// SegmentSecurity indicates findings related to vulnerabilities, access control, and compliance.
	SegmentSecurity Segment = "security"
	// SegmentFinOps indicates findings related to cost optimization and resource waste.
	SegmentFinOps Segment = "finops"
)

type Severity

type Severity string

Severity indicates the urgency and critical nature of a finding.

const (
	// SeverityInfo indicates informational items that require no immediate action.
	SeverityInfo Severity = "info"
	// SeverityLow indicates low-priority issues that can be addressed when time permits.
	SeverityLow Severity = "low"
	// SeverityMedium indicates moderate issues that should be addressed in standard planning cycles.
	SeverityMedium Severity = "medium"
	// SeverityHigh indicates significant issues that require prompt attention.
	SeverityHigh Severity = "high"
	// SeverityCritical indicates severe issues that pose immediate risks and require emergency remediation.
	SeverityCritical Severity = "critical"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL