organization

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRepositoryFilter

func ApplyRepositoryFilter(repo github.RepositoryInfo, filter RepositoryFilter) bool

ApplyRepositoryFilter checks if a repository matches the filter criteria

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

Analyzer handles organization-wide analysis

func NewAnalyzer

func NewAnalyzer(client *github.Client, cfg *config.Config, maxWorkers int, showProgress bool) *Analyzer

NewAnalyzer creates a new organization analyzer

func (*Analyzer) AnalyzeOrganization

func (a *Analyzer) AnalyzeOrganization(ctx context.Context, orgName string, filter RepositoryFilter) (*OrganizationResult, error)

AnalyzeOrganization performs security analysis on all repositories in an organization

type OrganizationResult

type OrganizationResult struct {
	Organization         string              `json:"organization"`
	ScanTime             time.Time           `json:"scan_time"`
	Duration             time.Duration       `json:"duration"`
	TotalRepositories    int                 `json:"total_repositories"`
	AnalyzedRepositories int                 `json:"analyzed_repositories"`
	SkippedRepositories  int                 `json:"skipped_repositories"`
	RepositoryResults    []RepositoryResult  `json:"repository_results"`
	Summary              OrganizationSummary `json:"summary"`
}

OrganizationResult represents the analysis result for an entire organization

type OrganizationSummary

type OrganizationSummary struct {
	TotalFindings      int                  `json:"total_findings"`
	FindingsBySeverity map[string]int       `json:"findings_by_severity"`
	FindingsByCategory map[string]int       `json:"findings_by_category"`
	RepositoriesByRisk map[string]int       `json:"repositories_by_risk"`
	TopFindings        []TopFinding         `json:"top_findings"`
	RiskDistribution   []RepositoryRiskInfo `json:"risk_distribution"`
}

OrganizationSummary provides aggregated statistics for an organization

type RepositoryFilter

type RepositoryFilter = github.RepositoryFilter

RepositoryFilter is now defined in the github package

type RepositoryResult

type RepositoryResult struct {
	Repository     github.RepositoryInfo `json:"repository"`
	Findings       []rules.Finding       `json:"findings"`
	WorkflowsCount int                   `json:"workflows_count"`
	RulesCount     int                   `json:"rules_count"`
	Duration       time.Duration         `json:"duration"`
	Error          error                 `json:"error,omitempty"`
}

RepositoryResult represents the analysis result for a single repository

type RepositoryRiskInfo

type RepositoryRiskInfo struct {
	Repository    github.RepositoryInfo `json:"repository"`
	RiskLevel     string                `json:"risk_level"` // LOW, MEDIUM, HIGH, CRITICAL
	FindingsCount int                   `json:"findings_count"`
	CriticalCount int                   `json:"critical_count"`
	HighCount     int                   `json:"high_count"`
	Score         float64               `json:"score"` // Risk score 0-100
}

RepositoryRiskInfo provides risk assessment for individual repositories

type TopFinding

type TopFinding struct {
	RuleID       string   `json:"rule_id"`
	RuleName     string   `json:"rule_name"`
	Severity     string   `json:"severity"`
	Count        int      `json:"count"`
	Repositories []string `json:"repositories"`
}

TopFinding represents frequently occurring security issues

Jump to

Keyboard shortcuts

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