cloud-report
Version:
Collects and analyzes cloud resources
44 lines (43 loc) • 2.85 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("../../../types");
const cloudfront_1 = require("../../../utils/aws/cloudfront");
const base_1 = require("../../base");
class FieldLevelEncrytionAnalyzer extends base_1.BaseAnalyzer {
analyze(params, fullReport) {
const allFieldLevelEncryptionConfigs = params.distribution_configs;
if (!allFieldLevelEncryptionConfigs) {
return undefined;
}
const field_level_encryption_enabled = { type: types_1.CheckAnalysisType.OperationalExcellence };
field_level_encryption_enabled.what = "Is field level encryption enabled in the CloudFront web distribution?";
field_level_encryption_enabled.why = `It is important, in order to help protect sensitive data like credit
card numbers or social security numbers, and to help protect your data across application services.`;
field_level_encryption_enabled.recommendation = "Recommended to enable field level encryption for all distributions.";
field_level_encryption_enabled.benchmark = ['all'];
const allFieldLevelEncryptionAnalysis = [];
for (const field_level_encryption_Id in allFieldLevelEncryptionConfigs) {
const field_level_encryption = allFieldLevelEncryptionConfigs[field_level_encryption_Id];
const field_level_encryption_Analysis = {};
field_level_encryption_Analysis.resource = { field_level_encryption_Id, logging: field_level_encryption.Logging };
const field_level_encryption_Alias = cloudfront_1.CloudFrontUtil.getAliasName(field_level_encryption);
field_level_encryption_Analysis.resourceSummary = {
name: "Distribution",
value: field_level_encryption_Alias ? `${field_level_encryption_Alias} | ${field_level_encryption_Id}` : field_level_encryption_Id,
};
if (field_level_encryption.Logging.Enabled) {
field_level_encryption_Analysis.severity = types_1.SeverityStatus.Good;
field_level_encryption_Analysis.message = "Field level encryption are enabled.";
}
else {
field_level_encryption_Analysis.severity = types_1.SeverityStatus.Warning;
field_level_encryption_Analysis.message = "Field level encryption are not enabled.";
field_level_encryption_Analysis.action = "Enable field level encryption.";
}
allFieldLevelEncryptionAnalysis.push(field_level_encryption_Analysis);
}
field_level_encryption_enabled.regions = { global: allFieldLevelEncryptionAnalysis };
return { field_level_encryption_enabled };
}
}
exports.FieldLevelEncrytionAnalyzer = FieldLevelEncrytionAnalyzer;