All Products
Search
Document Center

Web Application Firewall:DescribeDefenseRule

Last Updated:Jun 09, 2026

Mengambil detail aturan perlindungan tertentu.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

yundun-waf:DescribeDefenseRule

get

*全部资源

*

  • acs:ResourceGroupId
None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID Instans Web Application Firewall (WAF).

Catatan

Panggil operasi DescribeInstance untuk mengkueri ID Instans WAF.

waf_cdnsdf3****

TemplateId

integer

No

ID Templat aturan perlindungan.

Catatan

Parameter ini hanya diperlukan jika DefenseType diatur ke template.

10318

RuleId

integer

Yes

ID aturan perlindungan.

20026192

DefenseType

string

No

Tipe aturan perlindungan. Nilai valid:

  • template (default): Templat aturan perlindungan.

  • Sumber daya: Aturan untuk objek yang dilindungi.

  • global: Aturan global.

Valid values:

  • template :

    template.

  • resource :

    Sumber daya.

template

RegionId

string

No

Wilayah tempat Instans WAF berada. Nilai valid:

  • cn-hangzhou: Tiongkok daratan.

  • ap-southeast-1: di luar Tiongkok daratan.

cn-hangzhou

ResourceManagerResourceGroupId

string

No

ID kelompok sumber daya Alibaba Cloud.

rg-acfm***q

Resource

string

No

Objek yang dilindungi tempat aturan perlindungan diterapkan.

Catatan

Parameter ini hanya diperlukan jika DefenseType diatur ke Sumber daya.

rencs***-waf

Elemen respons

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

D7861F61-5B61-46CE-A47C-6B19160D5EB0

Rule

object

The details of the protection rule.

Status

integer

The status of the protection rule. Valid values:

  • 0: disabled.

  • 1: enabled.

1

DefenseOrigin

string

The origin of the protection rule. This parameter indicates whether the rule was created by the user or by the system. Valid values:

  • custom: a custom rule.

  • system: a system-generated rule.

custom

Config

string

The configuration of the protection rule, returned as a JSON string. For more information, see the Protection rule parameters section in CreateDefenseRule.

{\"status\":1,\"policyId\":1012,\"action\":\"block\"}

RuleId

integer

The ID of the protection rule.

2732975

DefenseScene

string

The scenario to which the protection rule applies.

If the DefenseType parameter is set to template, the valid values are:

  • waf_group: basic protection with regular expression rules.

  • waf_base: web core protection.

  • waf_base_compliance: basic protection with protocol compliance rules.

  • waf_base_sema: basic protection with semantic analysis rules.

  • cc: HTTP flood protection.

  • antiscan_dirscan: directory traversal blocking in scan protection.

  • antiscan_highfreq: high-frequency scan blocking in scan protection.

  • antiscan_scantools: scanning tool blocking in scan protection.

  • ip_blacklist: an IP address blacklist.

  • custom_acl: a custom rule.

  • region_block: a location blacklist.

  • tamperproof: webpage tamper protection.

  • dlp: data leakage prevention.

  • custom_response_block: a custom response.

  • spike_throttle: peak traffic throttling.

If the DefenseType parameter is set to resource, the valid values are:

  • account_identifier: account identification.

  • custom_response: a custom response.

  • waf_codec: data decoding settings.

If the DefenseType parameter is set to global, the valid values are:

  • regular_custom: a custom regular expression.

  • address_book: an IP address book.

  • custom_response: a custom response.

waf_group

GmtModified

integer

The time when the protection rule was modified. This value is a UNIX timestamp. Unit: milliseconds.

1665196746000

RuleName

string

The name of the protection rule.

test1

TemplateId

integer

The ID of the protection rule template.

Catatan

This parameter is returned only if the DefenseType parameter is set to template.

9114

Resource

string

The protected object to which the protection rule applies.

Catatan

This parameter is returned only if the DefenseType parameter is set to resource.

rencs***-waf

DefenseType

string

The type of the protection rule. Valid values:

  • template (default): a protection rule template.

  • resource: a rule for a protected object.

  • global: a global rule.

template

Contoh

Respons sukses

JSONformat

{
  "RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0",
  "Rule": {
    "Status": 1,
    "DefenseOrigin": "custom",
    "Config": "{\\\"status\\\":1,\\\"policyId\\\":1012,\\\"action\\\":\\\"block\\\"}",
    "RuleId": 2732975,
    "DefenseScene": "waf_group",
    "GmtModified": 1665196746000,
    "RuleName": "test1",
    "TemplateId": 9114,
    "Resource": "rencs***-waf",
    "DefenseType": "template"
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.