1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. threatdetection
  5. getBaselineStrategies
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.threatdetection.getBaselineStrategies

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides Threat Detection Baseline Strategy available to the user.What is Baseline Strategy

    NOTE: Available in 1.195.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultBaselineStrategy = new alicloud.threatdetection.BaselineStrategy("default", {
        customType: "custom",
        endTime: "08:00:00",
        baselineStrategyName: "apispec",
        cycleDays: 3,
        targetType: "groupId",
        startTime: "05:00:00",
        riskSubTypeName: "hc_exploit_redis",
    });
    const default = defaultBaselineStrategy.id.apply(id => alicloud.threatdetection.getBaselineStrategiesOutput({
        ids: [id],
        nameRegex: defaultBaselineStrategy.name,
        customType: "custom",
    }));
    export const alicloudThreatDetectionBaselineStrategyExampleId = defaultAlicloudThreatDetectionBaselineStrategys.strategys[0].id;
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_baseline_strategy = alicloud.threatdetection.BaselineStrategy("default",
        custom_type="custom",
        end_time="08:00:00",
        baseline_strategy_name="apispec",
        cycle_days=3,
        target_type="groupId",
        start_time="05:00:00",
        risk_sub_type_name="hc_exploit_redis")
    default = default_baseline_strategy.id.apply(lambda id: alicloud.threatdetection.get_baseline_strategies_output(ids=[id],
        name_regex=default_baseline_strategy.name,
        custom_type="custom"))
    pulumi.export("alicloudThreatDetectionBaselineStrategyExampleId", default_alicloud_threat_detection_baseline_strategys["strategys"][0]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultBaselineStrategy, err := threatdetection.NewBaselineStrategy(ctx, "default", &threatdetection.BaselineStrategyArgs{
    			CustomType:           pulumi.String("custom"),
    			EndTime:              pulumi.String("08:00:00"),
    			BaselineStrategyName: pulumi.String("apispec"),
    			CycleDays:            pulumi.Int(3),
    			TargetType:           pulumi.String("groupId"),
    			StartTime:            pulumi.String("05:00:00"),
    			RiskSubTypeName:      pulumi.String("hc_exploit_redis"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = defaultBaselineStrategy.ID().ApplyT(func(id string) (threatdetection.GetBaselineStrategiesResult, error) {
    			return threatdetection.GetBaselineStrategiesOutput(ctx, threatdetection.GetBaselineStrategiesOutputArgs{
    				Ids: []string{
    					id,
    				},
    				NameRegex:  defaultBaselineStrategy.Name,
    				CustomType: "custom",
    			}, nil), nil
    		}).(threatdetection.GetBaselineStrategiesResultOutput)
    		ctx.Export("alicloudThreatDetectionBaselineStrategyExampleId", defaultAlicloudThreatDetectionBaselineStrategys.Strategys[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultBaselineStrategy = new AliCloud.ThreatDetection.BaselineStrategy("default", new()
        {
            CustomType = "custom",
            EndTime = "08:00:00",
            BaselineStrategyName = "apispec",
            CycleDays = 3,
            TargetType = "groupId",
            StartTime = "05:00:00",
            RiskSubTypeName = "hc_exploit_redis",
        });
    
        var @default = AliCloud.ThreatDetection.GetBaselineStrategies.Invoke(new()
        {
            Ids = new[]
            {
                defaultBaselineStrategy.Id,
            },
            NameRegex = defaultBaselineStrategy.Name,
            CustomType = "custom",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudThreatDetectionBaselineStrategyExampleId"] = defaultAlicloudThreatDetectionBaselineStrategys.Strategys[0].Id,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.threatdetection.BaselineStrategy;
    import com.pulumi.alicloud.threatdetection.BaselineStrategyArgs;
    import com.pulumi.alicloud.threatdetection.ThreatdetectionFunctions;
    import com.pulumi.alicloud.threatdetection.inputs.GetBaselineStrategiesArgs;
    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) {
            var defaultBaselineStrategy = new BaselineStrategy("defaultBaselineStrategy", BaselineStrategyArgs.builder()        
                .customType("custom")
                .endTime("08:00:00")
                .baselineStrategyName("apispec")
                .cycleDays(3)
                .targetType("groupId")
                .startTime("05:00:00")
                .riskSubTypeName("hc_exploit_redis")
                .build());
    
            final var default = ThreatdetectionFunctions.getBaselineStrategies(GetBaselineStrategiesArgs.builder()
                .ids(defaultBaselineStrategy.id())
                .nameRegex(defaultBaselineStrategy.name())
                .customType("custom")
                .build());
    
            ctx.export("alicloudThreatDetectionBaselineStrategyExampleId", defaultAlicloudThreatDetectionBaselineStrategys.strategys()[0].id());
        }
    }
    
    resources:
      defaultBaselineStrategy:
        type: alicloud:threatdetection:BaselineStrategy
        name: default
        properties:
          customType: custom
          endTime: 08:00:00
          baselineStrategyName: apispec
          cycleDays: 3
          targetType: groupId
          startTime: 05:00:00
          riskSubTypeName: hc_exploit_redis
    variables:
      default:
        fn::invoke:
          Function: alicloud:threatdetection:getBaselineStrategies
          Arguments:
            ids:
              - ${defaultBaselineStrategy.id}
            nameRegex: ${defaultBaselineStrategy.name}
            customType: custom
    outputs:
      alicloudThreatDetectionBaselineStrategyExampleId: ${defaultAlicloudThreatDetectionBaselineStrategys.strategys[0].id}
    

    Using getBaselineStrategies

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getBaselineStrategies(args: GetBaselineStrategiesArgs, opts?: InvokeOptions): Promise<GetBaselineStrategiesResult>
    function getBaselineStrategiesOutput(args: GetBaselineStrategiesOutputArgs, opts?: InvokeOptions): Output<GetBaselineStrategiesResult>
    def get_baseline_strategies(custom_type: Optional[str] = None,
                                ids: Optional[Sequence[str]] = None,
                                name_regex: Optional[str] = None,
                                output_file: Optional[str] = None,
                                strategy_ids: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetBaselineStrategiesResult
    def get_baseline_strategies_output(custom_type: Optional[pulumi.Input[str]] = None,
                                ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                name_regex: Optional[pulumi.Input[str]] = None,
                                output_file: Optional[pulumi.Input[str]] = None,
                                strategy_ids: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetBaselineStrategiesResult]
    func GetBaselineStrategies(ctx *Context, args *GetBaselineStrategiesArgs, opts ...InvokeOption) (*GetBaselineStrategiesResult, error)
    func GetBaselineStrategiesOutput(ctx *Context, args *GetBaselineStrategiesOutputArgs, opts ...InvokeOption) GetBaselineStrategiesResultOutput

    > Note: This function is named GetBaselineStrategies in the Go SDK.

    public static class GetBaselineStrategies 
    {
        public static Task<GetBaselineStrategiesResult> InvokeAsync(GetBaselineStrategiesArgs args, InvokeOptions? opts = null)
        public static Output<GetBaselineStrategiesResult> Invoke(GetBaselineStrategiesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBaselineStrategiesResult> getBaselineStrategies(GetBaselineStrategiesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:threatdetection/getBaselineStrategies:getBaselineStrategies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CustomType string
    The type of policy. Value:-common: standard policy-custom: custom policy
    Ids List<string>
    A list of Baseline Strategy IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    StrategyIds string
    CustomType string
    The type of policy. Value:-common: standard policy-custom: custom policy
    Ids []string
    A list of Baseline Strategy IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    StrategyIds string
    customType String
    The type of policy. Value:-common: standard policy-custom: custom policy
    ids List<String>
    A list of Baseline Strategy IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    strategyIds String
    customType string
    The type of policy. Value:-common: standard policy-custom: custom policy
    ids string[]
    A list of Baseline Strategy IDs.
    nameRegex string
    A regex string to filter results by Group Metric Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    strategyIds string
    custom_type str
    The type of policy. Value:-common: standard policy-custom: custom policy
    ids Sequence[str]
    A list of Baseline Strategy IDs.
    name_regex str
    A regex string to filter results by Group Metric Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    strategy_ids str
    customType String
    The type of policy. Value:-common: standard policy-custom: custom policy
    ids List<String>
    A list of Baseline Strategy IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    strategyIds String

    getBaselineStrategies Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Baseline Strategy IDs.
    Names List<string>
    A list of name of Baseline Strategys.
    Strategies List<Pulumi.AliCloud.ThreatDetection.Outputs.GetBaselineStrategiesStrategy>
    CustomType string
    The type of policy. Value:

    • common: standard policy
    • custom: custom policy
    NameRegex string
    OutputFile string
    StrategyIds string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Baseline Strategy IDs.
    Names []string
    A list of name of Baseline Strategys.
    Strategies []GetBaselineStrategiesStrategy
    CustomType string
    The type of policy. Value:

    • common: standard policy
    • custom: custom policy
    NameRegex string
    OutputFile string
    StrategyIds string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Baseline Strategy IDs.
    names List<String>
    A list of name of Baseline Strategys.
    strategies List<GetBaselineStrategiesStrategy>
    customType String
    The type of policy. Value:

    • common: standard policy
    • custom: custom policy
    nameRegex String
    outputFile String
    strategyIds String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Baseline Strategy IDs.
    names string[]
    A list of name of Baseline Strategys.
    strategies GetBaselineStrategiesStrategy[]
    customType string
    The type of policy. Value:

    • common: standard policy
    • custom: custom policy
    nameRegex string
    outputFile string
    strategyIds string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Baseline Strategy IDs.
    names Sequence[str]
    A list of name of Baseline Strategys.
    strategies Sequence[GetBaselineStrategiesStrategy]
    custom_type str
    The type of policy. Value:

    • common: standard policy
    • custom: custom policy
    name_regex str
    output_file str
    strategy_ids str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Baseline Strategy IDs.
    names List<String>
    A list of name of Baseline Strategys.
    strategies List<Property Map>
    customType String
    The type of policy. Value:

    • common: standard policy
    • custom: custom policy
    nameRegex String
    outputFile String
    strategyIds String

    Supporting Types

    GetBaselineStrategiesStrategy

    BaselineStrategyId string
    The ID of the baseline check policy.
    BaselineStrategyName string
    Policy name.
    CustomType string
    The type of policy. Value:-common: standard policy-custom: custom policy
    CycleDays int
    The detection period of the policy.
    CycleStartTime int
    The detection period of the policy. Value:

    • 0: 0:00~06:00
    • 6: 6:00~12:00
    • 12*: 12:00~18:00
    • 18: 18:00~24:00
    EndTime string
    The baseline check policy execution end time.
    Id string
    The ID of the baseline check policy.
    RiskSubTypeName string
    StartTime string
    The baseline check policy start time.
    TargetType string
    BaselineStrategyId string
    The ID of the baseline check policy.
    BaselineStrategyName string
    Policy name.
    CustomType string
    The type of policy. Value:-common: standard policy-custom: custom policy
    CycleDays int
    The detection period of the policy.
    CycleStartTime int
    The detection period of the policy. Value:

    • 0: 0:00~06:00
    • 6: 6:00~12:00
    • 12*: 12:00~18:00
    • 18: 18:00~24:00
    EndTime string
    The baseline check policy execution end time.
    Id string
    The ID of the baseline check policy.
    RiskSubTypeName string
    StartTime string
    The baseline check policy start time.
    TargetType string
    baselineStrategyId String
    The ID of the baseline check policy.
    baselineStrategyName String
    Policy name.
    customType String
    The type of policy. Value:-common: standard policy-custom: custom policy
    cycleDays Integer
    The detection period of the policy.
    cycleStartTime Integer
    The detection period of the policy. Value:

    • 0: 0:00~06:00
    • 6: 6:00~12:00
    • 12*: 12:00~18:00
    • 18: 18:00~24:00
    endTime String
    The baseline check policy execution end time.
    id String
    The ID of the baseline check policy.
    riskSubTypeName String
    startTime String
    The baseline check policy start time.
    targetType String
    baselineStrategyId string
    The ID of the baseline check policy.
    baselineStrategyName string
    Policy name.
    customType string
    The type of policy. Value:-common: standard policy-custom: custom policy
    cycleDays number
    The detection period of the policy.
    cycleStartTime number
    The detection period of the policy. Value:

    • 0: 0:00~06:00
    • 6: 6:00~12:00
    • 12*: 12:00~18:00
    • 18: 18:00~24:00
    endTime string
    The baseline check policy execution end time.
    id string
    The ID of the baseline check policy.
    riskSubTypeName string
    startTime string
    The baseline check policy start time.
    targetType string
    baseline_strategy_id str
    The ID of the baseline check policy.
    baseline_strategy_name str
    Policy name.
    custom_type str
    The type of policy. Value:-common: standard policy-custom: custom policy
    cycle_days int
    The detection period of the policy.
    cycle_start_time int
    The detection period of the policy. Value:

    • 0: 0:00~06:00
    • 6: 6:00~12:00
    • 12*: 12:00~18:00
    • 18: 18:00~24:00
    end_time str
    The baseline check policy execution end time.
    id str
    The ID of the baseline check policy.
    risk_sub_type_name str
    start_time str
    The baseline check policy start time.
    target_type str
    baselineStrategyId String
    The ID of the baseline check policy.
    baselineStrategyName String
    Policy name.
    customType String
    The type of policy. Value:-common: standard policy-custom: custom policy
    cycleDays Number
    The detection period of the policy.
    cycleStartTime Number
    The detection period of the policy. Value:

    • 0: 0:00~06:00
    • 6: 6:00~12:00
    • 12*: 12:00~18:00
    • 18: 18:00~24:00
    endTime String
    The baseline check policy execution end time.
    id String
    The ID of the baseline check policy.
    riskSubTypeName String
    startTime String
    The baseline check policy start time.
    targetType String

    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.54.0 published on Wednesday, Apr 24, 2024 by Pulumi