> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Silence Rules

export const MethodSection = ({children}) => children ?? null;

export const MethodSwitch = ({children}) => {
  const tabs = React.Children.toArray(children).map(c => {
    if (!c || !c.props) return null;
    if (c.props.id) return c;
    const inner = c.props.children;
    if (inner && inner.props && inner.props.id) return inner;
    return null;
  }).filter(Boolean);
  const firstId = tabs.length > 0 ? tabs[0].props.id : "";
  const [active, setActive] = React.useState(firstId);
  React.useEffect(() => {
    try {
      const saved = localStorage.getItem("gcore_docs_method");
      if (saved && tabs.find(t => t.props.id === saved)) {
        setActive(saved);
      }
    } catch (_) {}
  }, []);
  React.useEffect(() => {
    try {
      document.querySelectorAll("h2[id], h3[id]").forEach(heading => {
        const visible = heading.offsetParent !== null;
        document.querySelectorAll(`a[href="#${heading.id}"]`).forEach(link => {
          if (link.closest("h1,h2,h3,h4,h5,h6")) return;
          const li = link.closest("li");
          if (li) li.style.display = visible ? "" : "none";
        });
      });
    } catch (_) {}
    window.dispatchEvent(new Event("scroll"));
  }, [active]);
  const handleClick = id => {
    setActive(id);
    try {
      localStorage.setItem("gcore_docs_method", id);
    } catch (_) {}
  };
  return <div>
      <div className="not-prose flex gap-0 border-b border-zinc-200 dark:border-zinc-800 mb-8 mt-2" role="tablist">
        {tabs.map(tab => {
    const isActive = active === tab.props.id;
    return <button key={tab.props.id} role="tab" aria-selected={isActive} onClick={() => handleClick(tab.props.id)} className={["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer", isActive ? "border-primary text-primary" : "border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" ")}>
              {tab.props.label}
            </button>;
  })}
      </div>

      {tabs.map(tab => <div key={tab.props.id} style={{
    display: active === tab.props.id ? "" : "none"
  }}>
          {tab.props.children}
        </div>)}
    </div>;
};

<MethodSwitch>
  <MethodSection id="portal" label="Customer Portal">
    <p>To adjust notifications for a particular insight or remove any configured Silence Rules, open the [Gcore Customer Portal](https://portal.gcore.com/) and navigate to **WAAP** > **Security Insights**, then select the required domain.
    The **Silence Rules** tab shows all configured rules to silence irrelevant alerts. To learn how to create them, refer to [Silence insights](/waap/threat-intelligence/security-insights/manage-insights#silence-insights).</p>

    <p>Find the rule you want to modify or remove, then open the action menu on the right side.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/Mj45GxzndDrMNb3G/images/docs/waap/threat-intelligence/security-insights/manage-insights/security-insights-silence-rules.png?fit=max&auto=format&n=Mj45GxzndDrMNb3G&q=85&s=bb1e0e992a97e39063d3a9880c1b0635" alt="Modify or remove silence rules" width="1780" height="626" data-path="images/docs/waap/threat-intelligence/security-insights/manage-insights/security-insights-silence-rules.png" />
    </Frame>

    <p>To unsilence it, click **Delete**.</p>

    <p>To change the silence duration, select **Edit**, and the new silence duration, then click the **Save** button.</p>

    <Frame>
      <img src="https://mintcdn.com/gcore/Mj45GxzndDrMNb3G/images/docs/waap/threat-intelligence/security-insights/manage-insights/edit-silence-rule.png?fit=max&auto=format&n=Mj45GxzndDrMNb3G&q=85&s=dbcd1124aa0a36481961cb18c68f5fae" alt="Select the new silence duration" width="1125" height="632" data-path="images/docs/waap/threat-intelligence/security-insights/manage-insights/edit-silence-rule.png" />
    </Frame>

    <Info>
      **Info**

      To stop receiving security insights, silence both Insight types: **Attack on disabled policy** and **Allowed high-risk IP**. Insights can be enabled at any time, but it may take up to one hour to resume receiving them.
    </Info>
  </MethodSection>

  <MethodSection id="api" label="REST API">
    <p>The [Security Insights](/api-reference/waap#security-insights) endpoints let you list, update, and delete silence rules for a domain. Response examples include only the fields used in each step.</p>

    <Info>
      An [API token](/account-settings/api-tokens) and a domain ID are required. To find silence rule IDs, use the List operation below.
    </Info>

    <p>Set the following environment variables before running any examples:</p>

    ```bash theme={null}
    export GCORE_API_KEY="your_api_key"
    export WAAP_DOMAIN_ID=your_domain_id
    ```

    ## List silence rules

    <p>Returns all silence rules configured for the domain, including their IDs, expiry dates, and labels. Use the returned `id` field to identify a rule for update or delete.</p>

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        import os
        import gcore

        client = gcore.Gcore(api_key=os.environ["GCORE_API_KEY"])
        domain_id = int(os.environ["WAAP_DOMAIN_ID"])

        silences = client.waap.domains.insight_silences.list(domain_id)
        for s in silences.results:
            print(f"{s.id}  {s.insight_type}  expires: {s.expire_at}  labels: {s.labels}")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        package main

        import (
            "context"
            "fmt"
            "os"
            "strconv"

            "github.com/G-Core/gcore-go"
            "github.com/G-Core/gcore-go/option"
            "github.com/G-Core/gcore-go/waap"
        )

        func main() {
            domainID, _ := strconv.ParseInt(os.Getenv("WAAP_DOMAIN_ID"), 10, 64)
            client := gcore.NewClient(option.WithAPIKey(os.Getenv("GCORE_API_KEY")))

            result, err := client.Waap.Domains.InsightSilences.List(
                context.Background(),
                domainID,
                waap.DomainInsightSilenceListParams{},
            )
            if err != nil {
                panic(err)
            }
            for _, s := range result.Results {
                fmt.Printf("%s  %s  expires: %s\n", s.ID, s.InsightType, s.ExpireAt)
            }
        }
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        curl "https://api.gcore.com/waap/v1/domains/${WAAP_DOMAIN_ID}/insight-silences" \
             -H "Authorization: APIKey ${GCORE_API_KEY}"
        ```

        Response:

        ```json theme={null}
        {
          "count": 1,
          "results": [
            {
              "id": "86905266-3f32-4a1e-845c-23d3188182e8",
              "insight_type": "allowed-high-risk-ip",
              "labels": {"ip": "198.51.100.42"},
              "expire_at": "2026-07-25T00:00:00Z"
              // ...
            }
            // ...
          ]
        }
        ```
      </Tab>
    </Tabs>

    ## Update a silence rule

    <p>Changes the expiry date or comment of an existing silence rule. All fields — `author`, `comment`, `expire_at`, and `labels` — are required in the request body. Set `expire_at` to `null` to make the silence indefinite.</p>

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        import os
        import gcore

        client = gcore.Gcore(api_key=os.environ["GCORE_API_KEY"])
        domain_id = int(os.environ["WAAP_DOMAIN_ID"])

        silence_id = "86905266-3f32-4a1e-845c-23d3188182e8"

        # Extend expiry by one month
        updated = client.waap.domains.insight_silences.update(
            silence_id,
            domain_id=domain_id,
            author="security-team",
            comment="Trusted internal scanner — extended",
            expire_at="2026-08-25T00:00:00Z",
            labels={"ip": "198.51.100.42"},
        )
        print(f"New expiry: {updated.expire_at}")

        # Make silence indefinite
        client.waap.domains.insight_silences.update(
            silence_id,
            domain_id=domain_id,
            author="security-team",
            comment="Trusted internal scanner — no expiry",
            expire_at=None,
            labels={"ip": "198.51.100.42"},
        )
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        package main

        import (
            "context"
            "fmt"
            "os"
            "strconv"
            "time"

            "github.com/G-Core/gcore-go"
            "github.com/G-Core/gcore-go/option"
            "github.com/G-Core/gcore-go/packages/param"
            "github.com/G-Core/gcore-go/waap"
        )

        func main() {
            domainID, _ := strconv.ParseInt(os.Getenv("WAAP_DOMAIN_ID"), 10, 64)
            client := gcore.NewClient(option.WithAPIKey(os.Getenv("GCORE_API_KEY")))

            silenceID := "86905266-3f32-4a1e-845c-23d3188182e8"
            newExpiry := time.Now().AddDate(0, 1, 0)

            // Extend expiry by one month
            updated, err := client.Waap.Domains.InsightSilences.Update(
                context.Background(),
                silenceID,
                waap.DomainInsightSilenceUpdateParams{
                    DomainID: domainID,
                    Author:   "security-team",
                    Comment:  "Trusted internal scanner — extended",
                    ExpireAt: param.NewOpt(newExpiry),
                    Labels:   map[string]string{"ip": "198.51.100.42"},
                },
            )
            if err != nil {
                panic(err)
            }
            fmt.Printf("New expiry: %s\n", updated.ExpireAt)
        }
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        SILENCE_ID="86905266-3f32-4a1e-845c-23d3188182e8"

        # Extend expiry by one month
        curl -X PATCH "https://api.gcore.com/waap/v1/domains/${WAAP_DOMAIN_ID}/insight-silences/${SILENCE_ID}" \
             -H "Authorization: APIKey ${GCORE_API_KEY}" \
             -H "Content-Type: application/json" \
             -d '{
               "author": "security-team",
               "comment": "Trusted internal scanner — extended",
               "expire_at": "2026-08-25T00:00:00Z",
               "labels": {"ip": "198.51.100.42"}
             }'
        ```

        Response:

        ```json theme={null}
        {
          "id": "86905266-3f32-4a1e-845c-23d3188182e8",
          "insight_type": "allowed-high-risk-ip",
          "labels": {"ip": "198.51.100.42"},
          "expire_at": "2026-08-25T00:00:00Z"
          // ...
        }
        ```

        <p>To make the silence indefinite, set `"expire_at": null` in the request body.</p>
      </Tab>
    </Tabs>

    ## Delete a silence rule

    <p>Removes a silence rule and re-enables notifications for the silenced insight type. The operation returns no body on success.</p>

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        import os
        import gcore

        client = gcore.Gcore(api_key=os.environ["GCORE_API_KEY"])
        domain_id = int(os.environ["WAAP_DOMAIN_ID"])

        silence_id = "86905266-3f32-4a1e-845c-23d3188182e8"

        client.waap.domains.insight_silences.delete(silence_id, domain_id=domain_id)
        print("Silence rule deleted")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        package main

        import (
            "context"
            "fmt"
            "os"
            "strconv"

            "github.com/G-Core/gcore-go"
            "github.com/G-Core/gcore-go/option"
            "github.com/G-Core/gcore-go/waap"
        )

        func main() {
            domainID, _ := strconv.ParseInt(os.Getenv("WAAP_DOMAIN_ID"), 10, 64)
            client := gcore.NewClient(option.WithAPIKey(os.Getenv("GCORE_API_KEY")))

            silenceID := "86905266-3f32-4a1e-845c-23d3188182e8"

            err := client.Waap.Domains.InsightSilences.Delete(
                context.Background(),
                silenceID,
                waap.DomainInsightSilenceDeleteParams{DomainID: domainID},
            )
            if err != nil {
                panic(err)
            }
            fmt.Println("Silence rule deleted")
        }
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        SILENCE_ID="86905266-3f32-4a1e-845c-23d3188182e8"

        curl -X DELETE "https://api.gcore.com/waap/v1/domains/${WAAP_DOMAIN_ID}/insight-silences/${SILENCE_ID}" \
             -H "Authorization: APIKey ${GCORE_API_KEY}"
        ```

        A `204 No Content` response confirms the rule was deleted.
      </Tab>
    </Tabs>
  </MethodSection>
</MethodSwitch>
