1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. threatdetection
  5. ClientFileProtect
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

alicloud.threatdetection.ClientFileProtect

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

    Provides a Threat Detection Client File Protect resource. Client core file protection event monitoring, including file reading and writing, deletion, and permission change.

    For information about Threat Detection Client File Protect and how to use it, see What is Client File Protect.

    NOTE: Available since v1.212.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.threatdetection.ClientFileProtect("default", {
        status: 0,
        filePaths: ["/usr/local"],
        fileOps: ["CREATE"],
        ruleAction: "pass",
        procPaths: ["/usr/local"],
        alertLevel: 0,
        switchId: "FILE_PROTECT_RULE_SWITCH_TYPE_1693474122929",
        ruleName: "rule_example",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.threatdetection.ClientFileProtect("default",
        status=0,
        file_paths=["/usr/local"],
        file_ops=["CREATE"],
        rule_action="pass",
        proc_paths=["/usr/local"],
        alert_level=0,
        switch_id="FILE_PROTECT_RULE_SWITCH_TYPE_1693474122929",
        rule_name="rule_example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := threatdetection.NewClientFileProtect(ctx, "default", &threatdetection.ClientFileProtectArgs{
    			Status: pulumi.Int(0),
    			FilePaths: pulumi.StringArray{
    				pulumi.String("/usr/local"),
    			},
    			FileOps: pulumi.StringArray{
    				pulumi.String("CREATE"),
    			},
    			RuleAction: pulumi.String("pass"),
    			ProcPaths: pulumi.StringArray{
    				pulumi.String("/usr/local"),
    			},
    			AlertLevel: pulumi.Int(0),
    			SwitchId:   pulumi.String("FILE_PROTECT_RULE_SWITCH_TYPE_1693474122929"),
    			RuleName:   pulumi.String("rule_example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.ThreatDetection.ClientFileProtect("default", new()
        {
            Status = 0,
            FilePaths = new[]
            {
                "/usr/local",
            },
            FileOps = new[]
            {
                "CREATE",
            },
            RuleAction = "pass",
            ProcPaths = new[]
            {
                "/usr/local",
            },
            AlertLevel = 0,
            SwitchId = "FILE_PROTECT_RULE_SWITCH_TYPE_1693474122929",
            RuleName = "rule_example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.threatdetection.ClientFileProtect;
    import com.pulumi.alicloud.threatdetection.ClientFileProtectArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new ClientFileProtect("default", ClientFileProtectArgs.builder()        
                .status("0")
                .filePaths("/usr/local")
                .fileOps("CREATE")
                .ruleAction("pass")
                .procPaths("/usr/local")
                .alertLevel("0")
                .switchId("FILE_PROTECT_RULE_SWITCH_TYPE_1693474122929")
                .ruleName("rule_example")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:threatdetection:ClientFileProtect
        properties:
          status: '0'
          filePaths:
            - /usr/local
          fileOps:
            - CREATE
          ruleAction: pass
          procPaths:
            - /usr/local
          alertLevel: '0'
          switchId: FILE_PROTECT_RULE_SWITCH_TYPE_1693474122929
          ruleName: rule_example
    

    Create ClientFileProtect Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClientFileProtect(name: string, args: ClientFileProtectArgs, opts?: CustomResourceOptions);
    @overload
    def ClientFileProtect(resource_name: str,
                          args: ClientFileProtectArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClientFileProtect(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          file_ops: Optional[Sequence[str]] = None,
                          file_paths: Optional[Sequence[str]] = None,
                          proc_paths: Optional[Sequence[str]] = None,
                          rule_action: Optional[str] = None,
                          rule_name: Optional[str] = None,
                          alert_level: Optional[int] = None,
                          status: Optional[int] = None,
                          switch_id: Optional[str] = None)
    func NewClientFileProtect(ctx *Context, name string, args ClientFileProtectArgs, opts ...ResourceOption) (*ClientFileProtect, error)
    public ClientFileProtect(string name, ClientFileProtectArgs args, CustomResourceOptions? opts = null)
    public ClientFileProtect(String name, ClientFileProtectArgs args)
    public ClientFileProtect(String name, ClientFileProtectArgs args, CustomResourceOptions options)
    
    type: alicloud:threatdetection:ClientFileProtect
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ClientFileProtectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ClientFileProtectArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ClientFileProtectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClientFileProtectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClientFileProtectArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var clientFileProtectResource = new AliCloud.ThreatDetection.ClientFileProtect("clientFileProtectResource", new()
    {
        FileOps = new[]
        {
            "string",
        },
        FilePaths = new[]
        {
            "string",
        },
        ProcPaths = new[]
        {
            "string",
        },
        RuleAction = "string",
        RuleName = "string",
        AlertLevel = 0,
        Status = 0,
        SwitchId = "string",
    });
    
    example, err := threatdetection.NewClientFileProtect(ctx, "clientFileProtectResource", &threatdetection.ClientFileProtectArgs{
    	FileOps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	FilePaths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ProcPaths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RuleAction: pulumi.String("string"),
    	RuleName:   pulumi.String("string"),
    	AlertLevel: pulumi.Int(0),
    	Status:     pulumi.Int(0),
    	SwitchId:   pulumi.String("string"),
    })
    
    var clientFileProtectResource = new ClientFileProtect("clientFileProtectResource", ClientFileProtectArgs.builder()        
        .fileOps("string")
        .filePaths("string")
        .procPaths("string")
        .ruleAction("string")
        .ruleName("string")
        .alertLevel(0)
        .status(0)
        .switchId("string")
        .build());
    
    client_file_protect_resource = alicloud.threatdetection.ClientFileProtect("clientFileProtectResource",
        file_ops=["string"],
        file_paths=["string"],
        proc_paths=["string"],
        rule_action="string",
        rule_name="string",
        alert_level=0,
        status=0,
        switch_id="string")
    
    const clientFileProtectResource = new alicloud.threatdetection.ClientFileProtect("clientFileProtectResource", {
        fileOps: ["string"],
        filePaths: ["string"],
        procPaths: ["string"],
        ruleAction: "string",
        ruleName: "string",
        alertLevel: 0,
        status: 0,
        switchId: "string",
    });
    
    type: alicloud:threatdetection:ClientFileProtect
    properties:
        alertLevel: 0
        fileOps:
            - string
        filePaths:
            - string
        procPaths:
            - string
        ruleAction: string
        ruleName: string
        status: 0
        switchId: string
    

    ClientFileProtect Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ClientFileProtect resource accepts the following input properties:

    FileOps List<string>
    file operation.
    FilePaths List<string>
    file path.
    ProcPaths List<string>
    process path.
    RuleAction string
    rule action, pass or alert.
    RuleName string
    ruleName.
    AlertLevel int
    0 no alert 1 info 2 suspicious 3 critical.
    Status int
    rule status 0 is disable 1 is enable.
    SwitchId string
    switch id.
    FileOps []string
    file operation.
    FilePaths []string
    file path.
    ProcPaths []string
    process path.
    RuleAction string
    rule action, pass or alert.
    RuleName string
    ruleName.
    AlertLevel int
    0 no alert 1 info 2 suspicious 3 critical.
    Status int
    rule status 0 is disable 1 is enable.
    SwitchId string
    switch id.
    fileOps List<String>
    file operation.
    filePaths List<String>
    file path.
    procPaths List<String>
    process path.
    ruleAction String
    rule action, pass or alert.
    ruleName String
    ruleName.
    alertLevel Integer
    0 no alert 1 info 2 suspicious 3 critical.
    status Integer
    rule status 0 is disable 1 is enable.
    switchId String
    switch id.
    fileOps string[]
    file operation.
    filePaths string[]
    file path.
    procPaths string[]
    process path.
    ruleAction string
    rule action, pass or alert.
    ruleName string
    ruleName.
    alertLevel number
    0 no alert 1 info 2 suspicious 3 critical.
    status number
    rule status 0 is disable 1 is enable.
    switchId string
    switch id.
    file_ops Sequence[str]
    file operation.
    file_paths Sequence[str]
    file path.
    proc_paths Sequence[str]
    process path.
    rule_action str
    rule action, pass or alert.
    rule_name str
    ruleName.
    alert_level int
    0 no alert 1 info 2 suspicious 3 critical.
    status int
    rule status 0 is disable 1 is enable.
    switch_id str
    switch id.
    fileOps List<String>
    file operation.
    filePaths List<String>
    file path.
    procPaths List<String>
    process path.
    ruleAction String
    rule action, pass or alert.
    ruleName String
    ruleName.
    alertLevel Number
    0 no alert 1 info 2 suspicious 3 critical.
    status Number
    rule status 0 is disable 1 is enable.
    switchId String
    switch id.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClientFileProtect resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ClientFileProtect Resource

    Get an existing ClientFileProtect resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ClientFileProtectState, opts?: CustomResourceOptions): ClientFileProtect
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alert_level: Optional[int] = None,
            file_ops: Optional[Sequence[str]] = None,
            file_paths: Optional[Sequence[str]] = None,
            proc_paths: Optional[Sequence[str]] = None,
            rule_action: Optional[str] = None,
            rule_name: Optional[str] = None,
            status: Optional[int] = None,
            switch_id: Optional[str] = None) -> ClientFileProtect
    func GetClientFileProtect(ctx *Context, name string, id IDInput, state *ClientFileProtectState, opts ...ResourceOption) (*ClientFileProtect, error)
    public static ClientFileProtect Get(string name, Input<string> id, ClientFileProtectState? state, CustomResourceOptions? opts = null)
    public static ClientFileProtect get(String name, Output<String> id, ClientFileProtectState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AlertLevel int
    0 no alert 1 info 2 suspicious 3 critical.
    FileOps List<string>
    file operation.
    FilePaths List<string>
    file path.
    ProcPaths List<string>
    process path.
    RuleAction string
    rule action, pass or alert.
    RuleName string
    ruleName.
    Status int
    rule status 0 is disable 1 is enable.
    SwitchId string
    switch id.
    AlertLevel int
    0 no alert 1 info 2 suspicious 3 critical.
    FileOps []string
    file operation.
    FilePaths []string
    file path.
    ProcPaths []string
    process path.
    RuleAction string
    rule action, pass or alert.
    RuleName string
    ruleName.
    Status int
    rule status 0 is disable 1 is enable.
    SwitchId string
    switch id.
    alertLevel Integer
    0 no alert 1 info 2 suspicious 3 critical.
    fileOps List<String>
    file operation.
    filePaths List<String>
    file path.
    procPaths List<String>
    process path.
    ruleAction String
    rule action, pass or alert.
    ruleName String
    ruleName.
    status Integer
    rule status 0 is disable 1 is enable.
    switchId String
    switch id.
    alertLevel number
    0 no alert 1 info 2 suspicious 3 critical.
    fileOps string[]
    file operation.
    filePaths string[]
    file path.
    procPaths string[]
    process path.
    ruleAction string
    rule action, pass or alert.
    ruleName string
    ruleName.
    status number
    rule status 0 is disable 1 is enable.
    switchId string
    switch id.
    alert_level int
    0 no alert 1 info 2 suspicious 3 critical.
    file_ops Sequence[str]
    file operation.
    file_paths Sequence[str]
    file path.
    proc_paths Sequence[str]
    process path.
    rule_action str
    rule action, pass or alert.
    rule_name str
    ruleName.
    status int
    rule status 0 is disable 1 is enable.
    switch_id str
    switch id.
    alertLevel Number
    0 no alert 1 info 2 suspicious 3 critical.
    fileOps List<String>
    file operation.
    filePaths List<String>
    file path.
    procPaths List<String>
    process path.
    ruleAction String
    rule action, pass or alert.
    ruleName String
    ruleName.
    status Number
    rule status 0 is disable 1 is enable.
    switchId String
    switch id.

    Import

    Threat Detection Client File Protect can be imported using the id, e.g.

    $ pulumi import alicloud:threatdetection/clientFileProtect:ClientFileProtect example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi