@flamesshield/rules-engine
Version:
Independent rules engine for security analysis of Firebase
58 lines • 2.86 kB
TypeScript
/**
* Computed Properties Utility Functions
*
* This module provides utility functions for calculating computed properties
* from ProjectInformation objects, replacing the old fact-transformer approach.
*/
import type { ProjectInformation } from '../types/index.js';
import type { EnrichedProjectInformation } from '../types/index.js';
/**
* Calculates the enforcement ratio for App Check services
* @param projectInfo - The project information object
* @returns A number between 0 and 1 representing the ratio of enforced services
*/
export declare function calculateEnforcementRatio(projectInfo: ProjectInformation): number;
/**
* Counts the number of apps without attestation providers
* @param projectInfo - The project information object
* @returns The count of apps without attestation providers
*/
export declare function countAppsWithoutAttestationProviders(projectInfo: ProjectInformation): number;
/**
* Calculates a simple security score based on various factors
* @param projectInfo - The project information object
* @returns A number between 0 and 1 representing the security score
*/
export declare function calculateSecurityScore(projectInfo: ProjectInformation): number;
/**
* Determines if the project has secrets using the function_secrets scan results
* @param projectInfo - The project information object
* @returns True if secrets are detected, false otherwise
*/
export declare function hasSecrets(projectInfo: ProjectInformation): boolean;
/**
* Determines if the project has HTTP triggered functions
* @param projectInfo - The project information object
* @returns True if HTTP triggered functions are found, false otherwise
*/
export declare function hasHttpTriggeredFunctions(projectInfo: ProjectInformation): boolean;
/**
* Determines if this is a multi-region deployment
* @param projectInfo - The project information object
* @returns True if deployed across multiple regions, false otherwise
*/
export declare function isMultiRegionDeployment(projectInfo: ProjectInformation): boolean;
import { AnalysisFinding } from '../api/SecurityAnalysisClient.js';
/**
* Creates a vulnerability lookup object that can be used to check if specific vulnerability IDs exist
* @param vulnerabilities - The array of vulnerability findings
* @returns An object with vulnerability IDs as keys and boolean values
*/
export declare function createVulnerabilityLookup(vulnerabilities: AnalysisFinding[]): Record<string, boolean>;
/**
* Creates an enriched ProjectInformation object with all computed properties
* @param projectInfo - The base project information object
* @returns An enriched project information object with computed properties
*/
export declare function enrichProjectInformation(projectInfo: ProjectInformation): Promise<EnrichedProjectInformation>;
//# sourceMappingURL=computed-properties.d.ts.map