@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
315 lines • 12.3 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* SecurityRule resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* // First, create the tag objects that you will reference.
* const outboundTag = new scm.Tag("outbound_tag", {
* folder: "All",
* name: "outbound143",
* color: "Red",
* });
* const webTag = new scm.Tag("web_tag", {
* folder: "All",
* name: "web143",
* color: "Blue",
* });
* // --- Existing Rules (Backward Compatibility) ---
* const standardWebAccess = new scm.SecurityRule("standard_web_access", {
* folder: "All",
* name: "Allow Standard Web Access143",
* description: "Allow outbound web traffic to any destination...",
* position: "pre",
* action: "allow",
* categories: ["any"],
* applications: [
* "web-browsing",
* "ssl",
* ],
* services: [
* "service-http",
* "service-https",
* ],
* froms: [
* "untrust",
* "trust",
* ],
* tos: ["trust"],
* sources: ["any"],
* destinations: ["any"],
* negateSource: false,
* negateDestination: false,
* sourceUsers: ["any"],
* sourceHips: ["any"],
* destinationHips: ["any"],
* logStart: true,
* logEnd: true,
* disabled: false,
* tags: [
* outboundTag.name,
* webTag.name,
* ],
* });
* const blockRiskySaas = new scm.SecurityRule("block_risky_saas", {
* folder: "All",
* name: "Block Risky SaaS Applications143",
* description: "Prevent data exfiltration by blocking risky SaaS apps...",
* action: "deny",
* policyType: "Internet",
* securitySettings: {
* antiSpyware: "yes",
* vulnerability: "yes",
* virusAndWildfireAnalysis: "yes",
* },
* blockWebApplications: ["facebook-posting"],
* logSettings: {
* logSessions: true,
* },
* froms: ["any"],
* tos: ["any"],
* sources: ["any"],
* destinations: ["any"],
* sourceUsers: ["any"],
* disabled: false,
* tags: [
* outboundTag.name,
* webTag.name,
* ],
* });
* // --- NEW Examples Demonstrating Rule Ordering ---
* // Example 1: Place a critical block rule at the absolute top
* const criticalBlockTop = new scm.SecurityRule("critical_block_top", {
* folder: "All",
* name: "CRITICAL Block Malicious IPs Top143",
* description: "Always block known malicious IPs first.",
* relativePosition: "top",
* action: "deny",
* froms: ["any"],
* tos: ["any"],
* sources: ["any"],
* destinations: ["any"],
* sourceUsers: ["any"],
* categories: ["any"],
* applications: ["any"],
* services: ["any"],
* logEnd: true,
* tags: [outboundTag.name],
* });
* // Example 2: Place a cleanup rule at the absolute bottom
* const cleanupDenyBottom = new scm.SecurityRule("cleanup_deny_bottom", {
* folder: "All",
* name: "Cleanup Deny All Bottom143",
* description: "Deny any traffic not explicitly allowed.",
* relativePosition: "bottom",
* action: "deny",
* froms: ["any"],
* tos: ["any"],
* sources: ["any"],
* destinations: ["any"],
* sourceUsers: ["any"],
* categories: ["any"],
* applications: ["any"],
* services: ["any"],
* logEnd: true,
* tags: [outboundTag.name],
* });
* // Example 3: Place a rule *before* the standard web access rule
* const allowUpdatesBeforeWeb = new scm.SecurityRule("allow_updates_before_web", {
* folder: "All",
* name: "Allow OS Updates Before Web143",
* description: "Allow specific OS update traffic before general web access.",
* relativePosition: "before",
* targetRule: standardWebAccess.id,
* action: "allow",
* froms: ["trust"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* sourceUsers: ["any"],
* categories: ["any"],
* applications: [
* "ms-update",
* "apple-update",
* ],
* services: ["service-https"],
* logEnd: true,
* tags: [outboundTag.name],
* });
* // Example 4: Place a rule *after* the standard web access rule
* const allowCorpAppsAfterWeb = new scm.SecurityRule("allow_corp_apps_after_web", {
* folder: "All",
* name: "Allow Corp Apps After Web143",
* description: "Allow access to specific corporate apps after general web access.",
* relativePosition: "after",
* targetRule: standardWebAccess.id,
* action: "allow",
* froms: ["trust"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* sourceUsers: ["any"],
* categories: ["any"],
* applications: ["ms-update"],
* services: ["service-https"],
* logEnd: true,
* tags: [webTag.name],
* });
* ```
*
* ## Import
*
* The following command can be used to import a resource not managed by Terraform:
*
* bash
*
* ```sh
* $ pulumi import scm:index/securityRule:SecurityRule example folder:::id
* ```
*
* or
*
* bash
*
* ```sh
* $ pulumi import scm:index/securityRule:SecurityRule example :snippet::id
* ```
*
* or
*
* bash
*
* ```sh
* $ pulumi import scm:index/securityRule:SecurityRule example ::device:id
* ```
*/
class SecurityRule extends pulumi.CustomResource {
/**
* Get an existing SecurityRule resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new SecurityRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecurityRule. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SecurityRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state?.action;
resourceInputs["allowUrlCategories"] = state?.allowUrlCategories;
resourceInputs["allowWebApplications"] = state?.allowWebApplications;
resourceInputs["applications"] = state?.applications;
resourceInputs["blockUrlCategories"] = state?.blockUrlCategories;
resourceInputs["blockWebApplications"] = state?.blockWebApplications;
resourceInputs["categories"] = state?.categories;
resourceInputs["defaultProfileSettings"] = state?.defaultProfileSettings;
resourceInputs["description"] = state?.description;
resourceInputs["destinationHips"] = state?.destinationHips;
resourceInputs["destinations"] = state?.destinations;
resourceInputs["device"] = state?.device;
resourceInputs["devices"] = state?.devices;
resourceInputs["disabled"] = state?.disabled;
resourceInputs["folder"] = state?.folder;
resourceInputs["froms"] = state?.froms;
resourceInputs["logEnd"] = state?.logEnd;
resourceInputs["logSetting"] = state?.logSetting;
resourceInputs["logSettings"] = state?.logSettings;
resourceInputs["logStart"] = state?.logStart;
resourceInputs["name"] = state?.name;
resourceInputs["negateDestination"] = state?.negateDestination;
resourceInputs["negateSource"] = state?.negateSource;
resourceInputs["negateUser"] = state?.negateUser;
resourceInputs["policyType"] = state?.policyType;
resourceInputs["position"] = state?.position;
resourceInputs["profileSetting"] = state?.profileSetting;
resourceInputs["relativePosition"] = state?.relativePosition;
resourceInputs["schedule"] = state?.schedule;
resourceInputs["securitySettings"] = state?.securitySettings;
resourceInputs["services"] = state?.services;
resourceInputs["snippet"] = state?.snippet;
resourceInputs["sourceHips"] = state?.sourceHips;
resourceInputs["sourceUsers"] = state?.sourceUsers;
resourceInputs["sources"] = state?.sources;
resourceInputs["tags"] = state?.tags;
resourceInputs["targetRule"] = state?.targetRule;
resourceInputs["tenantRestrictions"] = state?.tenantRestrictions;
resourceInputs["tfid"] = state?.tfid;
resourceInputs["tos"] = state?.tos;
}
else {
const args = argsOrState;
resourceInputs["action"] = args?.action;
resourceInputs["allowUrlCategories"] = args?.allowUrlCategories;
resourceInputs["allowWebApplications"] = args?.allowWebApplications;
resourceInputs["applications"] = args?.applications;
resourceInputs["blockUrlCategories"] = args?.blockUrlCategories;
resourceInputs["blockWebApplications"] = args?.blockWebApplications;
resourceInputs["categories"] = args?.categories;
resourceInputs["defaultProfileSettings"] = args?.defaultProfileSettings;
resourceInputs["description"] = args?.description;
resourceInputs["destinationHips"] = args?.destinationHips;
resourceInputs["destinations"] = args?.destinations;
resourceInputs["device"] = args?.device;
resourceInputs["devices"] = args?.devices;
resourceInputs["disabled"] = args?.disabled;
resourceInputs["folder"] = args?.folder;
resourceInputs["froms"] = args?.froms;
resourceInputs["logEnd"] = args?.logEnd;
resourceInputs["logSetting"] = args?.logSetting;
resourceInputs["logSettings"] = args?.logSettings;
resourceInputs["logStart"] = args?.logStart;
resourceInputs["name"] = args?.name;
resourceInputs["negateDestination"] = args?.negateDestination;
resourceInputs["negateSource"] = args?.negateSource;
resourceInputs["negateUser"] = args?.negateUser;
resourceInputs["policyType"] = args?.policyType;
resourceInputs["position"] = args?.position;
resourceInputs["profileSetting"] = args?.profileSetting;
resourceInputs["relativePosition"] = args?.relativePosition;
resourceInputs["schedule"] = args?.schedule;
resourceInputs["securitySettings"] = args?.securitySettings;
resourceInputs["services"] = args?.services;
resourceInputs["snippet"] = args?.snippet;
resourceInputs["sourceHips"] = args?.sourceHips;
resourceInputs["sourceUsers"] = args?.sourceUsers;
resourceInputs["sources"] = args?.sources;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetRule"] = args?.targetRule;
resourceInputs["tenantRestrictions"] = args?.tenantRestrictions;
resourceInputs["tos"] = args?.tos;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecurityRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecurityRule = SecurityRule;
/** @internal */
SecurityRule.__pulumiType = 'scm:index/securityRule:SecurityRule';
//# sourceMappingURL=securityRule.js.map