@pulumi/aws-compliance-policies
Version:
This repository contains a growing set of Compliance Policies to validate your infrastructure using Pulumi's Crossguard Policy-as-Code framework.
304 lines (303 loc) • 13.8 kB
JavaScript
"use strict";
// Copyright 2016-2024, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ------------------------------- WARNING -------------------------------------
// This file was programmatically generated. Do not edit unless you know what
// you're doing.
// ------------------------------- WARNING -------------------------------------
Object.defineProperty(exports, "__esModule", { value: true });
exports.Workgroup = exports.NamedQuery = exports.Database = exports.DataCatalog = void 0;
const athena_1 = require("@pulumi/aws/athena");
const policy_1 = require("@pulumi/policy");
const compliance_policy_manager_1 = require("@pulumi/compliance-policy-manager");
const athena_2 = require("@pulumi/aws/athena");
const athena_3 = require("@pulumi/aws/athena");
const athena_4 = require("@pulumi/aws/athena");
var DataCatalog;
(function (DataCatalog) {
/**
* Checks that Athena DataCatalogs have a description.
*
* @severity low
* @frameworks none
* @topics documentation
* @link https://docs.aws.amazon.com/athena/latest/ug/understanding-tables-databases-and-the-data-catalog.html
*/
DataCatalog.missingDescription = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-datacatalog-missing-description",
description: "Checks that Athena DataCatalogs have a description.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_1.DataCatalog, (dataCatalog, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (!dataCatalog.description) {
reportViolation("Athena DataCatalogs should have a description.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "low",
topics: ["documentation"],
});
})(DataCatalog || (DataCatalog = {}));
exports.DataCatalog = DataCatalog;
var Database;
(function (Database) {
/**
* Checks that Athena Databases storage uses a customer-managed-key.
*
* @severity low
* @frameworks hitrust, iso27001, pcidss
* @topics encryption, storage
* @link https://docs.aws.amazon.com/athena/latest/ug/encryption.html
*/
Database.configureCustomerManagedKey = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-database-configure-customer-managed-key",
description: "Checks that Athena Databases storage uses a customer-managed-key.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_2.Database, (database, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (database.encryptionConfiguration && database.encryptionConfiguration.encryptionOption !== "SSE_KMS") {
reportViolation("Athena Databases should be encrypted using a customer-managed key.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "low",
topics: ["encryption", "storage"],
frameworks: ["pcidss", "hitrust", "iso27001"],
});
/**
* Checks that Athena Databases storage is encrypted.
*
* @severity high
* @frameworks hitrust, iso27001, pcidss
* @topics encryption, storage
* @link https://docs.aws.amazon.com/athena/latest/ug/encryption.html
*/
Database.disallowUnencryptedDatabase = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-database-disallow-unencrypted-database",
description: "Checks that Athena Databases storage is encrypted.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_2.Database, (database, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (!database.encryptionConfiguration) {
reportViolation("Athena Databases should be encrypted.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "high",
topics: ["encryption", "storage"],
frameworks: ["pcidss", "hitrust", "iso27001"],
});
/**
* Checks that Athena Databases have a description.
*
* @severity low
* @frameworks none
* @topics documentation
* @link https://docs.aws.amazon.com/athena/latest/ug/creating-databases.html
*/
Database.missingDescription = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-database-missing-description",
description: "Checks that Athena Databases have a description.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_2.Database, (database, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (!database.comment) {
reportViolation("Athena Databases should have a description.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "low",
topics: ["documentation"],
});
})(Database || (Database = {}));
exports.Database = Database;
var NamedQuery;
(function (NamedQuery) {
/**
* Checks that Athena NamedQueries have a description.
*
* @severity low
* @frameworks none
* @topics documentation
* @link https://docs.aws.amazon.com/athena/latest/ug/saved-queries.html
*/
NamedQuery.missingDescription = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-namedquery-missing-description",
description: "Checks that Athena NamedQueries have a description.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_3.NamedQuery, (namedQuery, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (!namedQuery.description) {
reportViolation("Athena NamedQueries should have a description.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "low",
topics: ["documentation"],
});
})(NamedQuery || (NamedQuery = {}));
exports.NamedQuery = NamedQuery;
var Workgroup;
(function (Workgroup) {
/**
* Checks that Athena Workgroups use a customer-managed-key.
*
* @severity low
* @frameworks hitrust, iso27001, pcidss
* @topics encryption, storage
* @link https://docs.aws.amazon.com/athena/latest/ug/workgroups-procedure.html
*/
Workgroup.configureCustomerManagedKey = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-workgroup-configure-customer-managed-key",
description: "Checks that Athena Workgroups use a customer-managed-key.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_4.Workgroup, (workgroup, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (workgroup.configuration &&
workgroup.configuration.resultConfiguration &&
workgroup.configuration.resultConfiguration.encryptionConfiguration &&
workgroup.configuration.resultConfiguration.encryptionConfiguration.encryptionOption !== "SSE_KMS") {
reportViolation("Athena Workgroups should be encrypted using a customer-managed key.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "low",
topics: ["encryption", "storage"],
frameworks: ["pcidss", "hitrust", "iso27001"],
});
/**
* Checks that Athena Workgroups are encrypted.
*
* @severity high
* @frameworks hitrust, iso27001, pcidss
* @topics encryption, storage
* @link https://docs.aws.amazon.com/athena/latest/ug/workgroups-procedure.html
*/
Workgroup.disallowUnencryptedWorkgroup = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-workgroup-disallow-unencrypted-workgroup",
description: "Checks that Athena Workgroups are encrypted.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_4.Workgroup, (workgroup, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (!workgroup.configuration || !workgroup.configuration.resultConfiguration || !workgroup.configuration.resultConfiguration.encryptionConfiguration) {
reportViolation("Athena Workgroups should be encrypted.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "high",
topics: ["encryption", "storage"],
frameworks: ["pcidss", "hitrust", "iso27001"],
});
/**
* Checks that Athena Workgroups enforce their configuration to their clients.
*
* @severity high
* @frameworks hitrust, iso27001, pcidss
* @topics encryption, storage
* @link https://docs.aws.amazon.com/athena/latest/ug/workgroups-procedure.html
*/
Workgroup.enforceConfiguration = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-workgroup-enforce-configuration",
description: "Checks that Athena Workgroups enforce their configuration to their clients.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_4.Workgroup, (workgroup, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (workgroup.configuration && !workgroup.configuration.enforceWorkgroupConfiguration) {
reportViolation("Athena Workgroups should enforce their configuration to their clients.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "high",
topics: ["encryption", "storage"],
frameworks: ["pcidss", "hitrust", "iso27001"],
});
/**
* Checks that Athena Workgroups have a description.
*
* @severity low
* @frameworks none
* @topics documentation
* @link https://docs.aws.amazon.com/athena/latest/ug/workgroups-procedure.html
*/
Workgroup.missingDescription = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "aws-athena-workgroup-missing-description",
description: "Checks that Athena Workgroups have a description.",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(athena_4.Workgroup, (workgroup, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
if (!workgroup.description) {
reportViolation("Athena Workgroups should have a description.");
}
}),
},
vendors: ["aws"],
services: ["athena"],
severity: "low",
topics: ["documentation"],
});
})(Workgroup || (Workgroup = {}));
exports.Workgroup = Workgroup;