1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. threatdetection
  5. getAntiBruteForceRules
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.threatdetection.getAntiBruteForceRules

Explore with Pulumi AI

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);
Copy
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)
Copy
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
})
}
Copy
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)),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetAntiBruteForceRules(ctx *Context, args *GetAntiBruteForceRulesArgs, opts ...InvokeOption) (*GetAntiBruteForceRulesResult, error)
func GetAntiBruteForceRulesOutput(ctx *Context, args *GetAntiBruteForceRulesOutputArgs, opts ...InvokeOption) GetAntiBruteForceRulesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetAntiBruteForceRulesResult> getAntiBruteForceRules(GetAntiBruteForceRulesArgs args, InvokeOptions options)
public static Output<GetAntiBruteForceRulesResult> getAntiBruteForceRules(GetAntiBruteForceRulesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:threatdetection/getAntiBruteForceRules:getAntiBruteForceRules
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids List<string>
A list of Anti-Brute Force Rule IDs.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 This property is required. string
The ID of the defense rule.
AntiBruteForceRuleName This property is required. string
The name of the defense rule.
DefaultRule This property is required. bool
Specifies whether to set the defense rule as the default rule.
FailCount This property is required. int
The threshold for the number of failed user logins when the brute-force defense rule takes effect.
ForbiddenTime This property is required. int
The period of time during which logons from an account are not allowed. Unit: minutes.
Id This property is required. string
The ID of the defense rule.
Span This property is required. 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 This property is required. List<string>
An array consisting of the UUIDs of servers to which the defense rule is applied.
AntiBruteForceRuleId This property is required. string
The ID of the defense rule.
AntiBruteForceRuleName This property is required. string
The name of the defense rule.
DefaultRule This property is required. bool
Specifies whether to set the defense rule as the default rule.
FailCount This property is required. int
The threshold for the number of failed user logins when the brute-force defense rule takes effect.
ForbiddenTime This property is required. int
The period of time during which logons from an account are not allowed. Unit: minutes.
Id This property is required. string
The ID of the defense rule.
Span This property is required. 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 This property is required. []string
An array consisting of the UUIDs of servers to which the defense rule is applied.
antiBruteForceRuleId This property is required. String
The ID of the defense rule.
antiBruteForceRuleName This property is required. String
The name of the defense rule.
defaultRule This property is required. Boolean
Specifies whether to set the defense rule as the default rule.
failCount This property is required. Integer
The threshold for the number of failed user logins when the brute-force defense rule takes effect.
forbiddenTime This property is required. Integer
The period of time during which logons from an account are not allowed. Unit: minutes.
id This property is required. String
The ID of the defense rule.
span This property is required. 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 This property is required. List<String>
An array consisting of the UUIDs of servers to which the defense rule is applied.
antiBruteForceRuleId This property is required. string
The ID of the defense rule.
antiBruteForceRuleName This property is required. string
The name of the defense rule.
defaultRule This property is required. boolean
Specifies whether to set the defense rule as the default rule.
failCount This property is required. number
The threshold for the number of failed user logins when the brute-force defense rule takes effect.
forbiddenTime This property is required. number
The period of time during which logons from an account are not allowed. Unit: minutes.
id This property is required. string
The ID of the defense rule.
span This property is required. 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 This property is required. string[]
An array consisting of the UUIDs of servers to which the defense rule is applied.
anti_brute_force_rule_id This property is required. str
The ID of the defense rule.
anti_brute_force_rule_name This property is required. str
The name of the defense rule.
default_rule This property is required. bool
Specifies whether to set the defense rule as the default rule.
fail_count This property is required. int
The threshold for the number of failed user logins when the brute-force defense rule takes effect.
forbidden_time This property is required. int
The period of time during which logons from an account are not allowed. Unit: minutes.
id This property is required. str
The ID of the defense rule.
span This property is required. 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 This property is required. Sequence[str]
An array consisting of the UUIDs of servers to which the defense rule is applied.
antiBruteForceRuleId This property is required. String
The ID of the defense rule.
antiBruteForceRuleName This property is required. String
The name of the defense rule.
defaultRule This property is required. Boolean
Specifies whether to set the defense rule as the default rule.
failCount This property is required. Number
The threshold for the number of failed user logins when the brute-force defense rule takes effect.
forbiddenTime This property is required. Number
The period of time during which logons from an account are not allowed. Unit: minutes.
id This property is required. String
The ID of the defense rule.
span This property is required. 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 This property is required. 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.