26 lines
1.3 KiB
TypeScript
26 lines
1.3 KiB
TypeScript
/**
|
|
* File integrity monitoring (FIM) for user-upload directories.
|
|
* Detects on-disk tampering outside the normal upload flow.
|
|
*/
|
|
export type FileIntegrityIssue = {
|
|
rootKey: string;
|
|
relativePath: string;
|
|
issue: 'modified' | 'added' | 'deleted';
|
|
expectedHash?: string;
|
|
actualHash?: string;
|
|
};
|
|
export declare const FILE_INTEGRITY_ROOTS: {
|
|
readonly faq: "faq-uploads";
|
|
readonly support: "support-uploads";
|
|
readonly apkPublished: "apk-releases-published";
|
|
};
|
|
export type FileIntegrityRootKey = (typeof FILE_INTEGRITY_ROOTS)[keyof typeof FILE_INTEGRITY_ROOTS];
|
|
/** Records or refreshes the integrity baseline for one uploaded file. */
|
|
export declare function recordUploadedFile(rootKey: FileIntegrityRootKey, filename: string): Promise<void>;
|
|
/** Scans one upload root and returns integrity issues vs stored baselines. */
|
|
export declare function scanRoot(rootKey: FileIntegrityRootKey): Promise<FileIntegrityIssue[]>;
|
|
/** Scans all upload roots, raises alerts and audits on unexpected changes. */
|
|
export declare function runFileIntegrityCheck(): Promise<FileIntegrityIssue[]>;
|
|
/** Rebuilds baselines for all files in a root (admin maintenance). */
|
|
export declare function rebuildBaseline(rootKey: FileIntegrityRootKey): Promise<number>;
|
|
//# sourceMappingURL=fileIntegrityService.d.ts.map
|