UNPKG

@syntropysoft/praetorian

Version:

Praetorian CLI – A universal multi-environment configuration validator for DevSecOps teams. Validate, compare, and secure YAML/ENV files with ease.

95 lines 3.52 kB
"use strict"; /** * @file src/shared/rules/simple-core-rules.ts * @description Core simple rules for Praetorian - only ID and name */ Object.defineProperty(exports, "__esModule", { value: true }); exports.EXAMPLE_SIMPLE_RULE_SETS = exports.CORE_SIMPLE_RULE_SETS = exports.ALL_CORE_SIMPLE_RULES = exports.CORE_SCHEMA_SIMPLE_RULES = exports.CORE_SECURITY_SIMPLE_RULES = exports.CORE_FORMAT_SIMPLE_RULES = exports.CORE_STRUCTURE_SIMPLE_RULES = void 0; /** * Core structure rules */ exports.CORE_STRUCTURE_SIMPLE_RULES = [ { id: 'required-config-version', name: 'Config Version Required' }, { id: 'required-config-name', name: 'Config Name Required' }, { id: 'max-nesting-depth', name: 'Maximum Nesting Depth' }, { id: 'no-circular-references', name: 'No Circular References' }, ]; /** * Core format rules */ exports.CORE_FORMAT_SIMPLE_RULES = [ { id: 'version-format', name: 'Version Format Validation' }, { id: 'email-format', name: 'Email Format Validation' }, { id: 'url-format', name: 'URL Format Validation' }, { id: 'semver-format', name: 'Semantic Version Format' }, ]; /** * Core security rules */ exports.CORE_SECURITY_SIMPLE_RULES = [ { id: 'no-secrets-in-config', name: 'No Secrets in Configuration' }, { id: 'secure-file-permissions', name: 'Secure File Permissions' }, { id: 'no-hardcoded-passwords', name: 'No Hardcoded Passwords' }, { id: 'encrypt-sensitive-data', name: 'Encrypt Sensitive Data' }, ]; /** * Core schema rules */ exports.CORE_SCHEMA_SIMPLE_RULES = [ { id: 'validate-json-schema', name: 'Validate JSON Schema' }, { id: 'required-fields-present', name: 'Required Fields Present' }, { id: 'no-extra-fields', name: 'No Extra Fields' }, { id: 'data-type-validation', name: 'Data Type Validation' }, ]; /** * All core simple rules combined */ exports.ALL_CORE_SIMPLE_RULES = [ ...exports.CORE_STRUCTURE_SIMPLE_RULES, ...exports.CORE_FORMAT_SIMPLE_RULES, ...exports.CORE_SECURITY_SIMPLE_RULES, ...exports.CORE_SCHEMA_SIMPLE_RULES, ]; /** * Organized simple rule sets for different use cases */ exports.CORE_SIMPLE_RULE_SETS = { structure: exports.CORE_STRUCTURE_SIMPLE_RULES, format: exports.CORE_FORMAT_SIMPLE_RULES, security: exports.CORE_SECURITY_SIMPLE_RULES, schema: exports.CORE_SCHEMA_SIMPLE_RULES, all: exports.ALL_CORE_SIMPLE_RULES, }; /** * Example simple rule sets for templates */ exports.EXAMPLE_SIMPLE_RULE_SETS = [ { name: 'Basic Structure Rules', description: 'Essential structure validation rules', rules: [ { id: 'app-name-required', name: 'Application Name Required' }, { id: 'version-required', name: 'Version Required' }, { id: 'description-required', name: 'Description Required' }, ], }, { name: 'Security Rules', description: 'Security validation rules', rules: [ { id: 'no-api-keys', name: 'No API Keys in Config' }, { id: 'no-database-urls', name: 'No Database URLs in Config' }, { id: 'secure-defaults', name: 'Secure Default Values' }, ], }, { name: 'Format Rules', description: 'Format validation rules', rules: [ { id: 'valid-email', name: 'Valid Email Format' }, { id: 'valid-url', name: 'Valid URL Format' }, { id: 'valid-version', name: 'Valid Version Format' }, ], }, ]; //# sourceMappingURL=simple-core-rules.js.map