1. Packages
  2. Alicloud Provider
  3. API Docs
  4. threatdetection
  5. getAntiBruteForceRules
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.threatdetection.getAntiBruteForceRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides Threat Detection Anti Brute Force Rule available to the user.What is Anti Brute Force Rule

    NOTE: Available since v1.195.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "example_value";
    const defaultAntiBruteForceRule = new alicloud.threatdetection.AntiBruteForceRule("default", {
        antiBruteForceRuleName: name,
        forbiddenTime: 360,
        uuidLists: ["7567806c-4ec5-4597-9543-7c9543381a13"],
        failCount: 80,
        span: 10,
    });
    const default = defaultAntiBruteForceRule.id.apply(id => alicloud.threatdetection.getAntiBruteForceRulesOutput({
        ids: [id],
        nameRegex: defaultAntiBruteForceRule.name,
    }));
    export const alicloudThreatDetectionAntiBruteForceRuleExampleId = _default.apply(_default => _default.rules?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "example_value"
    default_anti_brute_force_rule = alicloud.threatdetection.AntiBruteForceRule("default",
        anti_brute_force_rule_name=name,
        forbidden_time=360,
        uuid_lists=["7567806c-4ec5-4597-9543-7c9543381a13"],
        fail_count=80,
        span=10)
    default = default_anti_brute_force_rule.id.apply(lambda id: alicloud.threatdetection.get_anti_brute_force_rules_output(ids=[id],
        name_regex=default_anti_brute_force_rule.name))
    pulumi.export("alicloudThreatDetectionAntiBruteForceRuleExampleId", default.rules[0].id)
    
    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 := "example_value";
    if param := cfg.Get("name"); param != ""{
    name = param
    }
    defaultAntiBruteForceRule, err := threatdetection.NewAntiBruteForceRule(ctx, "default", &threatdetection.AntiBruteForceRuleArgs{
    AntiBruteForceRuleName: pulumi.String(name),
    ForbiddenTime: pulumi.Int(360),
    UuidLists: pulumi.StringArray{
    pulumi.String("7567806c-4ec5-4597-9543-7c9543381a13"),
    },
    FailCount: pulumi.Int(80),
    Span: pulumi.Int(10),
    })
    if err != nil {
    return err
    }
    _default := defaultAntiBruteForceRule.ID().ApplyT(func(id string) (threatdetection.GetAntiBruteForceRulesResult, error) {
    return threatdetection.GetAntiBruteForceRulesResult(interface{}(threatdetection.GetAntiBruteForceRulesOutput(ctx, threatdetection.GetAntiBruteForceRulesOutputArgs{
    Ids: []string{
    id,
    },
    NameRegex: defaultAntiBruteForceRule.Name,
    }, nil))), nil
    }).(threatdetection.GetAntiBruteForceRulesResultOutput)
    ctx.Export("alicloudThreatDetectionAntiBruteForceRuleExampleId", _default.ApplyT(func(_default threatdetection.GetAntiBruteForceRulesResult) (*string, error) {
    return &default.Rules[0].Id, nil
    }).(pulumi.StringPtrOutput))
    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") ?? "example_value";
        var defaultAntiBruteForceRule = new AliCloud.ThreatDetection.AntiBruteForceRule("default", new()
        {
            AntiBruteForceRuleName = name,
            ForbiddenTime = 360,
            UuidLists = new[]
            {
                "7567806c-4ec5-4597-9543-7c9543381a13",
            },
            FailCount = 80,
            Span = 10,
        });
    
        var @default = AliCloud.ThreatDetection.GetAntiBruteForceRules.Invoke(new()
        {
            Ids = new[]
            {
                defaultAntiBruteForceRule.Id,
            },
            NameRegex = defaultAntiBruteForceRule.Name,
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudThreatDetectionAntiBruteForceRuleExampleId"] = @default.Apply(@default => @default.Apply(getAntiBruteForceRulesResult => getAntiBruteForceRulesResult.Rules[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.threatdetection.AntiBruteForceRule;
    import com.pulumi.alicloud.threatdetection.AntiBruteForceRuleArgs;
    import com.pulumi.alicloud.threatdetection.ThreatdetectionFunctions;
    import com.pulumi.alicloud.threatdetection.inputs.GetAntiBruteForceRulesArgs;
    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("example_value");
            var defaultAntiBruteForceRule = new AntiBruteForceRule("defaultAntiBruteForceRule", AntiBruteForceRuleArgs.builder()
                .antiBruteForceRuleName(name)
                .forbiddenTime(360)
                .uuidLists("7567806c-4ec5-4597-9543-7c9543381a13")
                .failCount(80)
                .span(10)
                .build());
    
            final var default = ThreatdetectionFunctions.getAntiBruteForceRules(GetAntiBruteForceRulesArgs.builder()
                .ids(defaultAntiBruteForceRule.id())
                .nameRegex(defaultAntiBruteForceRule.name())
                .build());
    
            ctx.export("alicloudThreatDetectionAntiBruteForceRuleExampleId", default_.applyValue(default_ -> default_.rules()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: example_value
    resources:
      defaultAntiBruteForceRule:
        type: alicloud:threatdetection:AntiBruteForceRule
        name: default
        properties:
          antiBruteForceRuleName: ${name}
          forbiddenTime: 360
          uuidLists:
            - 7567806c-4ec5-4597-9543-7c9543381a13
          failCount: 80
          span: 10
    variables:
      default:
        fn::invoke:
          Function: alicloud:threatdetection:getAntiBruteForceRules
          Arguments:
            ids:
              - ${defaultAntiBruteForceRule.id}
            nameRegex: ${defaultAntiBruteForceRule.name}
    outputs:
      alicloudThreatDetectionAntiBruteForceRuleExampleId: ${default.rules[0].id}
    

    Using getAntiBruteForceRules

    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 getAntiBruteForceRules(args: GetAntiBruteForceRulesArgs, opts?: InvokeOptions): Promise<GetAntiBruteForceRulesResult>
    function getAntiBruteForceRulesOutput(args: GetAntiBruteForceRulesOutputArgs, opts?: InvokeOptions): Output<GetAntiBruteForceRulesResult>
    def get_anti_brute_force_rules(ids: Optional[Sequence[str]] = None,
                                   name_regex: Optional[str] = None,
                                   output_file: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetAntiBruteForceRulesResult
    def get_anti_brute_force_rules_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                   name_regex: Optional[pulumi.Input[str]] = None,
                                   output_file: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetAntiBruteForceRulesResult]
    func GetAntiBruteForceRules(ctx *Context, args *GetAntiBruteForceRulesArgs, opts ...InvokeOption) (*GetAntiBruteForceRulesResult, error)
    func GetAntiBruteForceRulesOutput(ctx *Context, args *GetAntiBruteForceRulesOutputArgs, opts ...InvokeOption) GetAntiBruteForceRulesResultOutput

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

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

    The following arguments are supported:

    Ids List<string>
    A list of Anti-Brute Force Rule IDs.
    NameRegex string
    A regex string to filter results by the name of the defense rule.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Anti-Brute Force Rule IDs.
    NameRegex string
    A regex string to filter results by the name of the defense rule.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Anti-Brute Force Rule IDs.
    nameRegex String
    A regex string to filter results by the name of the defense rule.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Anti-Brute Force Rule IDs.
    nameRegex string
    A regex string to filter results by the name of the defense rule.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Anti-Brute Force Rule IDs.
    name_regex str
    A regex string to filter results by the name of the defense rule.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Anti-Brute Force Rule IDs.
    nameRegex String
    A regex string to filter results by the name of the defense rule.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getAntiBruteForceRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Anti Brute Force Rule IDs.
    Names List<string>
    A list of name of Anti Brute Force Rules.
    Rules List<Pulumi.AliCloud.ThreatDetection.Outputs.GetAntiBruteForceRulesRule>
    A list of Anti Brute Force Rule Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Anti Brute Force Rule IDs.
    Names []string
    A list of name of Anti Brute Force Rules.
    Rules []GetAntiBruteForceRulesRule
    A list of Anti Brute Force Rule Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Anti Brute Force Rule IDs.
    names List<String>
    A list of name of Anti Brute Force Rules.
    rules List<GetAntiBruteForceRulesRule>
    A list of Anti Brute Force Rule Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Anti Brute Force Rule IDs.
    names string[]
    A list of name of Anti Brute Force Rules.
    rules GetAntiBruteForceRulesRule[]
    A list of Anti Brute Force Rule Entries. Each element contains the following attributes:
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Anti Brute Force Rule IDs.
    names Sequence[str]
    A list of name of Anti Brute Force Rules.
    rules Sequence[GetAntiBruteForceRulesRule]
    A list of Anti Brute Force Rule Entries. Each element contains the following attributes:
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Anti Brute Force Rule IDs.
    names List<String>
    A list of name of Anti Brute Force Rules.
    rules List<Property Map>
    A list of Anti Brute Force Rule Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String

    Supporting Types

    GetAntiBruteForceRulesRule

    AntiBruteForceRuleId string
    The ID of the defense rule.
    AntiBruteForceRuleName string
    The name of the defense rule.
    DefaultRule bool
    Specifies whether to set the defense rule as the default rule.
    FailCount int
    The threshold for the number of failed user logins when the brute-force defense rule takes effect.
    ForbiddenTime int
    The period of time during which logons from an account are not allowed. Unit: minutes.
    Id string
    The ID of the defense rule.
    Span int
    The period of time during which logon failures from an account are measured. Unit: minutes. If Span is set to 10, the defense rule takes effect when the logon failures measured within 10 minutes reaches the specified threshold. The IP address of attackers cannot be used to log on to the server in the specified period of time.
    UuidLists List<string>
    An array consisting of the UUIDs of servers to which the defense rule is applied.
    AntiBruteForceRuleId string
    The ID of the defense rule.
    AntiBruteForceRuleName string
    The name of the defense rule.
    DefaultRule bool
    Specifies whether to set the defense rule as the default rule.
    FailCount int
    The threshold for the number of failed user logins when the brute-force defense rule takes effect.
    ForbiddenTime int
    The period of time during which logons from an account are not allowed. Unit: minutes.
    Id string
    The ID of the defense rule.
    Span int
    The period of time during which logon failures from an account are measured. Unit: minutes. If Span is set to 10, the defense rule takes effect when the logon failures measured within 10 minutes reaches the specified threshold. The IP address of attackers cannot be used to log on to the server in the specified period of time.
    UuidLists []string
    An array consisting of the UUIDs of servers to which the defense rule is applied.
    antiBruteForceRuleId String
    The ID of the defense rule.
    antiBruteForceRuleName String
    The name of the defense rule.
    defaultRule Boolean
    Specifies whether to set the defense rule as the default rule.
    failCount Integer
    The threshold for the number of failed user logins when the brute-force defense rule takes effect.
    forbiddenTime Integer
    The period of time during which logons from an account are not allowed. Unit: minutes.
    id String
    The ID of the defense rule.
    span Integer
    The period of time during which logon failures from an account are measured. Unit: minutes. If Span is set to 10, the defense rule takes effect when the logon failures measured within 10 minutes reaches the specified threshold. The IP address of attackers cannot be used to log on to the server in the specified period of time.
    uuidLists List<String>
    An array consisting of the UUIDs of servers to which the defense rule is applied.
    antiBruteForceRuleId string
    The ID of the defense rule.
    antiBruteForceRuleName string
    The name of the defense rule.
    defaultRule boolean
    Specifies whether to set the defense rule as the default rule.
    failCount number
    The threshold for the number of failed user logins when the brute-force defense rule takes effect.
    forbiddenTime number
    The period of time during which logons from an account are not allowed. Unit: minutes.
    id string
    The ID of the defense rule.
    span number
    The period of time during which logon failures from an account are measured. Unit: minutes. If Span is set to 10, the defense rule takes effect when the logon failures measured within 10 minutes reaches the specified threshold. The IP address of attackers cannot be used to log on to the server in the specified period of time.
    uuidLists string[]
    An array consisting of the UUIDs of servers to which the defense rule is applied.
    anti_brute_force_rule_id str
    The ID of the defense rule.
    anti_brute_force_rule_name str
    The name of the defense rule.
    default_rule bool
    Specifies whether to set the defense rule as the default rule.
    fail_count int
    The threshold for the number of failed user logins when the brute-force defense rule takes effect.
    forbidden_time int
    The period of time during which logons from an account are not allowed. Unit: minutes.
    id str
    The ID of the defense rule.
    span int
    The period of time during which logon failures from an account are measured. Unit: minutes. If Span is set to 10, the defense rule takes effect when the logon failures measured within 10 minutes reaches the specified threshold. The IP address of attackers cannot be used to log on to the server in the specified period of time.
    uuid_lists Sequence[str]
    An array consisting of the UUIDs of servers to which the defense rule is applied.
    antiBruteForceRuleId String
    The ID of the defense rule.
    antiBruteForceRuleName String
    The name of the defense rule.
    defaultRule Boolean
    Specifies whether to set the defense rule as the default rule.
    failCount Number
    The threshold for the number of failed user logins when the brute-force defense rule takes effect.
    forbiddenTime Number
    The period of time during which logons from an account are not allowed. Unit: minutes.
    id String
    The ID of the defense rule.
    span Number
    The period of time during which logon failures from an account are measured. Unit: minutes. If Span is set to 10, the defense rule takes effect when the logon failures measured within 10 minutes reaches the specified threshold. The IP address of attackers cannot be used to log on to the server in the specified period of time.
    uuidLists List<String>
    An array consisting of the UUIDs of servers to which the defense rule is applied.

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi