标签: tfsec

如何在 tfsec 中创建自定义检查

我希望使用 tfsec 在 IaC 代码扫描中实施以下策略:

Custom Check: GCP Firewall rule allows all traffic on Telnet port (23)

以下是我的自定义检查 .json 格式:

{
  "checks": 
    [
      {
        "code": "CUS003",
        "description": "Custom Check: GCP Firewall rule allows all traffic on Telnet port (23)",
        "requiredTypes": 
          [
            "resource"
          ],
          "requiredLabels": 
          [
            "google_compute_firewall"
          ],
          "severity": "WARNING",
          "matchSpec": 
          {
            "name": "CUS003_matchSpec_name",
            "action": "and",
            "predicateMatchSpec": 
            [
                  {
                    "name": "source_ranges",
                    "action": "contains",
                    "value": "0.0.0.0/0"
                },
                {
                    "name": "ports",
                    "action": "contains",
                    "value": "23"
                }
            ]
          },
        "errorMessage": "[WARNING] GCP Firewall rule …
Run Code Online (Sandbox Code Playgroud)

terraform tfsec

0
推荐指数
1
解决办法
1042
查看次数

标签 统计

terraform ×1

tfsec ×1