UNPKG

@pulumi/kubernetes-compliance-policies

Version:

This repository contains a growing set of Compliance Policies to validate your infrastructure using Pulumi's Crossguard Policy-as-Code framework.

303 lines (302 loc) 15.3 kB
"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.ServiceCIDRPatch = exports.ServiceCIDRList = exports.ServiceCIDR = exports.IPAddressPatch = exports.IPAddressList = exports.IPAddress = exports.ClusterCIDRPatch = exports.ClusterCIDRList = exports.ClusterCIDR = void 0; const policy_1 = require("@pulumi/policy"); const compliance_policy_manager_1 = require("@pulumi/compliance-policy-manager"); const v1alpha1_1 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_2 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_3 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_4 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_5 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_6 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_7 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_8 = require("@pulumi/kubernetes/networking/v1alpha1"); const v1alpha1_9 = require("@pulumi/kubernetes/networking/v1alpha1"); var ClusterCIDR; (function (ClusterCIDR) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ClusterCIDR). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ ClusterCIDR.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-clustercidr-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ClusterCIDR).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_1.ClusterCIDR, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes ClusterCIDR shouldn't use an unstable API (networking.v1alpha1.ClusterCIDR)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(ClusterCIDR || (ClusterCIDR = {})); exports.ClusterCIDR = ClusterCIDR; var ClusterCIDRList; (function (ClusterCIDRList) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ClusterCIDRList). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ ClusterCIDRList.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-clustercidrlist-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ClusterCIDRList).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_2.ClusterCIDRList, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes ClusterCIDRList shouldn't use an unstable API (networking.v1alpha1.ClusterCIDRList)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(ClusterCIDRList || (ClusterCIDRList = {})); exports.ClusterCIDRList = ClusterCIDRList; var ClusterCIDRPatch; (function (ClusterCIDRPatch) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ClusterCIDRPatch). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ ClusterCIDRPatch.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-clustercidrpatch-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ClusterCIDRPatch).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_3.ClusterCIDRPatch, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes ClusterCIDRPatch shouldn't use an unstable API (networking.v1alpha1.ClusterCIDRPatch)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(ClusterCIDRPatch || (ClusterCIDRPatch = {})); exports.ClusterCIDRPatch = ClusterCIDRPatch; var IPAddress; (function (IPAddress) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.IPAddress). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ IPAddress.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-ipaddress-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.IPAddress).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_4.IPAddress, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes IPAddress shouldn't use an unstable API (networking.v1alpha1.IPAddress)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(IPAddress || (IPAddress = {})); exports.IPAddress = IPAddress; var IPAddressList; (function (IPAddressList) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.IPAddressList). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ IPAddressList.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-ipaddresslist-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.IPAddressList).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_5.IPAddressList, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes IPAddressList shouldn't use an unstable API (networking.v1alpha1.IPAddressList)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(IPAddressList || (IPAddressList = {})); exports.IPAddressList = IPAddressList; var IPAddressPatch; (function (IPAddressPatch) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.IPAddressPatch). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ IPAddressPatch.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-ipaddresspatch-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.IPAddressPatch).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_6.IPAddressPatch, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes IPAddressPatch shouldn't use an unstable API (networking.v1alpha1.IPAddressPatch)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(IPAddressPatch || (IPAddressPatch = {})); exports.IPAddressPatch = IPAddressPatch; var ServiceCIDR; (function (ServiceCIDR) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ServiceCIDR). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ ServiceCIDR.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-servicecidr-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ServiceCIDR).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_7.ServiceCIDR, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes ServiceCIDR shouldn't use an unstable API (networking.v1alpha1.ServiceCIDR)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(ServiceCIDR || (ServiceCIDR = {})); exports.ServiceCIDR = ServiceCIDR; var ServiceCIDRList; (function (ServiceCIDRList) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ServiceCIDRList). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ ServiceCIDRList.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-servicecidrlist-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ServiceCIDRList).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_8.ServiceCIDRList, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes ServiceCIDRList shouldn't use an unstable API (networking.v1alpha1.ServiceCIDRList)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(ServiceCIDRList || (ServiceCIDRList = {})); exports.ServiceCIDRList = ServiceCIDRList; var ServiceCIDRPatch; (function (ServiceCIDRPatch) { /** * Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ServiceCIDRPatch). * * @severity medium * @frameworks none * @topics alpha, api, unstable * @link https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning */ ServiceCIDRPatch.disallowAlphaResource = compliance_policy_manager_1.policyManager.registerPolicy({ resourceValidationPolicy: { name: "kubernetes-networking-v1alpha1-servicecidrpatch-disallow-alpha-resource", description: "Disallow the use of non-stable (Alpha) Kubernetes resouces (networking.v1alpha1.ServiceCIDRPatch).", configSchema: compliance_policy_manager_1.policyManager.policyConfigSchema, enforcementLevel: "advisory", validateResource: (0, policy_1.validateResourceOfType)(v1alpha1_9.ServiceCIDRPatch, (_, args, reportViolation) => { if (!compliance_policy_manager_1.policyManager.shouldEvalPolicy(args)) { return; } reportViolation("Kubernetes ServiceCIDRPatch shouldn't use an unstable API (networking.v1alpha1.ServiceCIDRPatch)."); }), }, vendors: ["kubernetes"], services: ["networking"], severity: "medium", topics: ["api", "unstable", "alpha"], }); })(ServiceCIDRPatch || (ServiceCIDRPatch = {})); exports.ServiceCIDRPatch = ServiceCIDRPatch;