@pulumi/azure-compliance-policies
Version:
This repository contains a growing set of Compliance Policies to validate your infrastructure using Pulumi's Crossguard Policy-as-Code framework.
148 lines (147 loc) • 7.51 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.WorkloadInstance = exports.WorkloadDeployment = exports.ModernizeProject = exports.MigrateAgent = void 0;
const policy_1 = require("@pulumi/policy");
const compliance_policy_manager_1 = require("@pulumi/compliance-policy-manager");
const v20220501preview_1 = require("@pulumi/azure-native/migrate/v20220501preview");
const v20220501preview_2 = require("@pulumi/azure-native/migrate/v20220501preview");
const v20220501preview_3 = require("@pulumi/azure-native/migrate/v20220501preview");
const v20220501preview_4 = require("@pulumi/azure-native/migrate/v20220501preview");
var MigrateAgent;
(function (MigrateAgent) {
/**
* Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.MigrateAgent).
*
* @severity medium
* @frameworks none
* @topics api, preview, unstable
* @link https://learn.microsoft.com/en-us/rest/api/azure/
*/
MigrateAgent.disallowPreviewResource = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "azurenative-migrate-v20220501preview-migrateagent-disallow-preview-resource",
description: "Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.MigrateAgent).",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(v20220501preview_1.MigrateAgent, (_, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
reportViolation("Azure MigrateAgent shouldn't use an unstable API (migrate.v20220501preview.MigrateAgent).");
}),
},
vendors: ["azure"],
services: ["migrate"],
severity: "medium",
topics: ["api", "unstable", "preview"],
});
})(MigrateAgent || (MigrateAgent = {}));
exports.MigrateAgent = MigrateAgent;
var ModernizeProject;
(function (ModernizeProject) {
/**
* Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.ModernizeProject).
*
* @severity medium
* @frameworks none
* @topics api, preview, unstable
* @link https://learn.microsoft.com/en-us/rest/api/azure/
*/
ModernizeProject.disallowPreviewResource = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "azurenative-migrate-v20220501preview-modernizeproject-disallow-preview-resource",
description: "Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.ModernizeProject).",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(v20220501preview_2.ModernizeProject, (_, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
reportViolation("Azure ModernizeProject shouldn't use an unstable API (migrate.v20220501preview.ModernizeProject).");
}),
},
vendors: ["azure"],
services: ["migrate"],
severity: "medium",
topics: ["api", "unstable", "preview"],
});
})(ModernizeProject || (ModernizeProject = {}));
exports.ModernizeProject = ModernizeProject;
var WorkloadDeployment;
(function (WorkloadDeployment) {
/**
* Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.WorkloadDeployment).
*
* @severity medium
* @frameworks none
* @topics api, preview, unstable
* @link https://learn.microsoft.com/en-us/rest/api/azure/
*/
WorkloadDeployment.disallowPreviewResource = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "azurenative-migrate-v20220501preview-workloaddeployment-disallow-preview-resource",
description: "Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.WorkloadDeployment).",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(v20220501preview_3.WorkloadDeployment, (_, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
reportViolation("Azure WorkloadDeployment shouldn't use an unstable API (migrate.v20220501preview.WorkloadDeployment).");
}),
},
vendors: ["azure"],
services: ["migrate"],
severity: "medium",
topics: ["api", "unstable", "preview"],
});
})(WorkloadDeployment || (WorkloadDeployment = {}));
exports.WorkloadDeployment = WorkloadDeployment;
var WorkloadInstance;
(function (WorkloadInstance) {
/**
* Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.WorkloadInstance).
*
* @severity medium
* @frameworks none
* @topics api, preview, unstable
* @link https://learn.microsoft.com/en-us/rest/api/azure/
*/
WorkloadInstance.disallowPreviewResource = compliance_policy_manager_1.policyManager.registerPolicy({
resourceValidationPolicy: {
name: "azurenative-migrate-v20220501preview-workloadinstance-disallow-preview-resource",
description: "Disallow the use of non-stable (Preview) Azure resouces (migrate.v20220501preview.WorkloadInstance).",
configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema,
enforcementLevel: "advisory",
validateResource: (0, policy_1.validateResourceOfType)(v20220501preview_4.WorkloadInstance, (_, args, reportViolation) => {
if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) {
return;
}
reportViolation("Azure WorkloadInstance shouldn't use an unstable API (migrate.v20220501preview.WorkloadInstance).");
}),
},
vendors: ["azure"],
services: ["migrate"],
severity: "medium",
topics: ["api", "unstable", "preview"],
});
})(WorkloadInstance || (WorkloadInstance = {}));
exports.WorkloadInstance = WorkloadInstance;