UNPKG

cloud-report

Version:

Collects and analyzes cloud resources

45 lines (44 loc) 2.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const types_1 = require("../../../types"); const base_1 = require("../../base"); class RdsEncryptionEnabledAnalyzer extends base_1.BaseAnalyzer { analyze(params, fullReport) { const allInstances = params.instances; if (!allInstances) { return undefined; } const encryption_enabled = { type: types_1.CheckAnalysisType.Security }; encryption_enabled.what = "Is encryption enabled for RDS instances?"; encryption_enabled.why = "It is important to encrypt data at rest"; encryption_enabled.recommendation = `Recommended to enable encryption for RDS instance as it provides additional layer of security`; encryption_enabled.benchmark = ['all', 'hipaa']; const allRegionsAnalysis = {}; for (const region in allInstances) { const regionInstances = allInstances[region]; allRegionsAnalysis[region] = []; for (const instance of regionInstances) { const instance_analysis = {}; instance_analysis.resource = instance; instance_analysis.resourceSummary = { name: "DBInstance", value: instance.DBInstanceIdentifier, }; if (instance.StorageEncrypted) { instance_analysis.severity = types_1.SeverityStatus.Good; instance_analysis.message = "RDS instance is encrypted at rest"; } else { instance_analysis.severity = types_1.SeverityStatus.Failure; instance_analysis.message = "RDS instance is not encrypted at rest"; instance_analysis.action = "Enable storage encryption at rest for the instance"; } allRegionsAnalysis[region].push(instance_analysis); } } encryption_enabled.regions = allRegionsAnalysis; return { encryption_enabled }; } } exports.RdsEncryptionEnabledAnalyzer = RdsEncryptionEnabledAnalyzer;