@seckav/security-sdk
Version:
SecKav Security SDK - Enterprise-grade security platform with AI-powered threat detection, LLM-powered misconfiguration scanning (Gemini/GPT-4/Claude), end-to-end encryption, behavioral analysis, enhanced file scanning, adaptive rate limiting, GDPR/DPDP/C
194 lines • 5.38 kB
TypeScript
export interface GitIntegrationModuleConfig {
apiUrl: string;
timeout?: number;
onError?: (error: any) => void;
}
export interface GitProvider {
type: 'github' | 'gitlab';
token: string;
baseUrl?: string;
}
export interface Repository {
id: string;
name: string;
fullName: string;
private: boolean;
defaultBranch: string;
cloneUrl: string;
webUrl: string;
description?: string;
language?: string;
stars?: number;
forks?: number;
lastUpdated?: Date;
}
export interface SecurityScanResult {
id: string;
repository: Repository;
scanDate: Date;
status: 'pending' | 'completed' | 'failed';
scanResults: Array<{
file: string;
type: 'openapi' | 'swagger' | 'config';
findings: Array<{
severity: 'low' | 'medium' | 'high' | 'critical';
type: string;
message: string;
line?: number;
column?: number;
recommendation?: string;
}>;
}>;
summary: {
totalFiles: number;
vulnerableFiles: number;
criticalFindings: number;
highFindings: number;
mediumFindings: number;
lowFindings: number;
overallRisk: 'low' | 'medium' | 'high' | 'critical';
};
recommendations: Array<{
priority: 'high' | 'medium' | 'low';
category: string;
title: string;
description: string;
impact: string;
}>;
}
export interface WebhookConfig {
webhookId: string;
webhookUrl: string;
events: string[];
active: boolean;
createdAt: Date;
}
/**
* Git Integration Module - GitHub and GitLab repository integration
* Provides repository management and security scanning capabilities
*/
export declare class GitIntegrationModule {
private config;
constructor(config: GitIntegrationModuleConfig);
/**
* Test connection to Git provider
*/
testConnection(token: string, provider: GitProvider): Promise<{
success: boolean;
userInfo?: {
username: string;
email: string;
name: string;
};
error?: string;
}>;
/**
* Get repositories from Git provider
*/
getRepositories(token: string, provider: GitProvider, options?: {
page?: number;
perPage?: number;
search?: string;
language?: string;
visibility?: 'public' | 'private' | 'all';
}): Promise<{
repositories: Repository[];
pagination: {
page: number;
perPage: number;
total?: number;
hasMore: boolean;
};
}>;
/**
* Get repository details
*/
getRepositoryDetails(token: string, provider: GitProvider, repositoryId: string): Promise<Repository>;
/**
* Scan repository for security issues
*/
scanRepository(token: string, provider: GitProvider, repositoryId: string, options?: {
branch?: string;
includeApiSpecs?: boolean;
includeConfigFiles?: boolean;
scanDepth?: 'shallow' | 'deep';
}): Promise<SecurityScanResult>;
/**
* Get scan history for repositories
*/
getScanHistory(token: string, options?: {
repositoryId?: string;
provider?: 'github' | 'gitlab';
status?: 'pending' | 'completed' | 'failed';
page?: number;
limit?: number;
fromDate?: Date;
toDate?: Date;
}): Promise<{
scans: SecurityScanResult[];
pagination: {
page: number;
limit: number;
total: number;
pages: number;
};
}>;
/**
* Setup webhook for repository
*/
setupWebhook(token: string, provider: GitProvider, repositoryId: string, options?: {
events?: string[];
autoScan?: boolean;
webhookUrl?: string;
}): Promise<WebhookConfig>;
/**
* Get webhook configurations
*/
getWebhooks(token: string, repositoryId?: string): Promise<WebhookConfig[]>;
/**
* Delete webhook
*/
deleteWebhook(token: string, webhookId: string): Promise<{
success: boolean;
}>;
/**
* Get repository branches
*/
getRepositoryBranches(token: string, provider: GitProvider, repositoryId: string): Promise<Array<{
name: string;
sha: string;
protected: boolean;
isDefault: boolean;
}>>;
/**
* Get scan report for a specific scan
*/
getScanReport(token: string, scanId: string, format?: 'json' | 'pdf' | 'csv'): Promise<{
downloadUrl?: string;
data?: SecurityScanResult;
fileName?: string;
expiresAt?: Date;
}>;
/**
* Get organization's Git integration summary
*/
getIntegrationSummary(token: string): Promise<{
totalRepositories: number;
scannedRepositories: number;
totalScans: number;
recentScans: SecurityScanResult[];
riskSummary: {
critical: number;
high: number;
medium: number;
low: number;
};
integrations: Array<{
provider: 'github' | 'gitlab';
connected: boolean;
repositoryCount: number;
lastSyncAt?: Date;
}>;
}>;
}
//# sourceMappingURL=GitIntegration.d.ts.map