Code Velocity
AI安全

AI智能体域名控制:使用AWS网络防火墙保护Web访问

·7 分钟阅读·AWS·原始来源
分享
显示AWS网络防火墙在Amazon VPC环境中通过域名过滤控制AI智能体Web访问的示意图。

保护AI智能体:为什么域名控制至关重要

能够浏览Web的AI智能体的出现,开启了一个充满可能性的新时代,从自动化研究到实时数据收集。这些强大的工具有望改变企业运营,但它们访问开放互联网的能力也带来了重大的安全和合规挑战。对AI智能体而言,不受限制的互联网访问,就像给员工一张没有消费限额的公司信用卡一样——滥用、意外数据暴露或恶意利用的可能性巨大。问题不可避免地出现:如果智能体访问了未经授权的网站怎么办?敏感数据是否可能被泄露到外部域名?

Code Velocity 走在探索这些关键问题的前沿,今天我们将深入探讨 AWS 提供的一个强大解决方案,以直接应对这些担忧。通过将 Amazon Bedrock AgentCore 与 AWS 网络防火墙结合使用,组织可以实施严格的基于域名的过滤,确保 AI 智能体仅与经批准的Web资源交互。这种方法不仅是一种最佳实践;它是在任何企业环境中负责任地部署AI智能体的基本要求。

通过AI智能体出口控制满足企业安全要求

对于组织,特别是受监管行业的组织而言,AI智能体的部署伴随着一套严格的安全要求。网络隔离和出口控制在安全审查中始终被强调,需要详细解释智能体流量如何管理和审计。确保智能体运行时端点保持私有以及部署Web应用防火墙等强大安全控制措施的需求是不可谈判的。

解决的关键企业需求:

  • 受监管行业: 金融、医疗保健和政府客户要求证明AI智能体操作符合严格的数据治理和隐私法规。未经授权的域名访问可能导致严重的合规性违规。
  • 多租户SaaS提供商: 对于构建AI智能体功能的SaaS公司而言,每个客户的网络策略至关重要。客户A可能需要访问客户B明确阻止的特定域名。这需要精细的控制,包括针对执行的特定阻止、区域限制以及基于类别的规则(例如,禁用赌博或社交媒体网站)。
  • 安全漏洞缓解: 一个日益增长的担忧是AI智能体容易受到提示注入攻击。恶意提示可以诱骗智能体导航到意想不到或有害的网站。自定义URL允许列表大幅减少了这种攻击面,确保智能体无论指令如何被操纵,都能保持在批准的范围内。这直接关系到关于设计智能体以抵御提示注入的更广泛讨论。
  • 合规审计要求: 安全团队需要对所有智能体网络交互的可见性和审计追踪。基于域名的出口过滤提供了全面的日志记录和访问控制可见性,这对于安全监控和审计过程至关重要。

架构深入探讨:使用AWS网络防火墙保护AgentCore

该解决方案涉及在私有子网中部署AgentCore Browser,使其与直接互联网访问隔离。然后,来自AI智能体的所有出站流量都将经过AWS网络防火墙的精心路由。该防火墙充当中央检查点,审查TLS服务器名称指示(SNI)头部,以识别目标域名并强制执行预定义的过滤规则。这种集成还允许通过Amazon CloudWatch指标监控网络防火墙的操作,从而提供有关流量模式和被阻止尝试的宝贵见解。

解决方案组件:

组件功能安全优势
私有子网托管AgentCore Browser实例,无直接公共IP地址。将智能体与公共互联网隔离,减少暴露面。
公共子网包含用于出站连接的NAT Gateway。实现出站访问,同时不直接暴露智能体实例。
防火墙子网用于网络防火墙端点的专用子网。集中流量检查,强制执行安全策略。
AWS网络防火墙检查TLS SNI头部,应用过滤规则,记录流量。基于域名的出口控制,僵尸网络/恶意软件防护,审计追踪。
路由表通过防火墙引导流量。确保所有出站和返回流量都经过防火墙。

流量流程解释:

  1. 运行在 Amazon Bedrock AgentCore 中的AI智能体调用AgentCore Browser工具。
  2. AgentCore Browser从其私有子网发起HTTPS请求。
  3. 私有子网的路由表将此流量导向公共子网中的NAT Gateway。
  4. NAT Gateway转换私有IP并将请求转发到网络防火墙端点。
  5. AWS网络防火墙拦截流量并检查TLS SNI头部,以确定目标域名。
  6. 如果域名与防火墙中配置的'允许列表'规则匹配,流量将被转发到Internet Gateway。
  7. Internet Gateway随后将批准的流量路由到外部Web目的地。
  8. 所有返回流量都沿着对称路径通过防火墙返回,从而确保持续的检查和安全策略的遵守。

需要注意的是,虽然基于SNI的过滤在TLS层控制智能体连接到哪些域名方面非常强大,但它只是更广泛的纵深防御策略的一部分。为了实现全面的DNS级过滤以及防范DNS隧道或数据泄露,此架构可以与Amazon Route 53 Resolver DNS Firewall相辅相成。

为您的AI智能体实施安全的域名过滤

为您的AI智能体建立这种强大的安全态势,需要利用AWS的综合基础设施服务,分几个关键步骤进行。

实施先决条件:

在深入操作之前,请确保您具备:

  • 一个活跃的AWS账户,具有创建VPC资源、网络防火墙和IAM角色的权限。
  • 已配置适当凭证的AWS命令行界面(AWS CLI)2.x版本。
  • 您的AWS账户中拥有Amazon Bedrock AgentCore的访问权限。
  • 对Amazon VPC网络概念有基础了解。

步骤1:通过CloudFormation部署资源

AWS提供了一个便捷的CloudFormation模板,以简化必要VPC和网络防火墙组件的部署。此模板设置了私有和公共子网、NAT Gateway、防火墙子网以及核心路由基础设施。通过利用它,您可以快速建立安全智能体操作所需的基础网络环境。

步骤2:审查IAM执行角色

为使AgentCore Browser正常且安全地运行,它需要一个具有特定信任策略的IAM角色。此策略允许bedrock-agentcore.amazonaws.com服务承担该角色,确保智能体具有必要的权限,而不会赋予其过多特权。

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "bedrock-agentcore.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

步骤3:配置AWS网络防火墙允许列表

您的域名控制策略核心在于在AWS网络防火墙中配置一个有状态规则组。此规则组定义了您的允许列表——即您的AI智能体被允许访问的特定域名。在您的域名条目中包含一个前导点(.)至关重要,以匹配子域名,确保全面覆盖。

例如,要允许访问Wikipedia和Stack Overflow,您的规则配置将如下所示:

{
  "RulesSource": {
    "RulesSourceList": {
      "Targets": [
        ".wikipedia.org",
        ".stackoverflow.com"
      ],
      "TargetType": "TLS_SNI",
      "GeneratedRulesType": "ALLOWLIST"
    }
  }
}

此配置确保只有流向这些明确允许的域名(包括其子域名)的流量才被防火墙允许通过。所有其他流量可以通过默认拒绝策略隐式拒绝。

超越SNI:纵深防御方法

尽管基于SNI的过滤功能强大,但针对AI智能体的真正零信任架构需要多层安全防护。如前所述,将AWS网络防火墙与Amazon Route 53 Resolver DNS Firewall结合使用,增加了另一个关键控制点。这可以防止智能体通过DNS解析被阻止的域名,有效堵塞了潜在的绕行途径——即如果域名解析也未受控,智能体可能会尝试直接连接到IP地址。

此外,集成其他安全服务,例如用于HTTP/S流量检查的AWS Web应用防火墙(WAF)(如果流量最终在另一层解密以进行检查),以及用于智能体调用的基于身份的访问控制,将巩固您的安全态势。这种多层方法与为机密AI工厂构建零信任架构的最佳实践保持一致。

结论:赋能安全的AI智能体部署

控制AI智能体可以访问哪些域名的能力不仅仅是一个功能;它是企业采用AI的基础安全要求。通过将AWS网络防火墙与Amazon Bedrock AgentCore结合使用,组织可以对智能体出口流量进行精细控制,缓解数据泄露和提示注入等重大安全风险,并满足严格的合规义务。

随着AI智能体变得越来越复杂并集成到关键业务流程中,一个强大的安全框架变得不可或缺。该解决方案为企业提供了一条清晰的路径,使其能够在利用AI智能体能力的同时,保持控制、可见性和不妥协的安全态势。采用这种架构模式是将智能体AI投入运营第一部分:利益相关者指南以及培育安全、创新未来的关键。

常见问题

Why is domain-level control essential for AI agents browsing the internet?
AI agents with internet access offer powerful capabilities but also introduce significant security risks. Unrestricted web access can lead to unintended data exfiltration to unauthorized domains, exposure to malicious content, or exploitation through prompt injection attacks that trick agents into navigating to harmful sites. Domain-level control, specifically allowlisting, ensures that agents can only access pre-approved websites, drastically reducing the attack surface. This is critical for maintaining data privacy, adhering to regulatory compliance standards, and safeguarding sensitive enterprise information, especially in regulated industries where strict network egress policies are mandatory.
How does AWS Network Firewall enhance the security posture of AI agents using Amazon Bedrock AgentCore?
AWS Network Firewall acts as a crucial layer of defense for AI agents deployed via Amazon Bedrock AgentCore. By routing all outbound traffic from AgentCore Browser through the firewall, organizations can implement granular domain-based filtering rules. The firewall inspects TLS Server Name Indication (SNI) headers to identify destination domains and applies allowlist or denylist policies. This ensures that agents only connect to approved external resources, logs all connection attempts for auditing, and can block access to known malicious domains or undesirable categories, thereby bolstering the overall security and compliance of AI agent operations.
What are the primary challenges addressed by implementing domain-based egress filtering for AI agents?
Domain-based egress filtering addresses several critical challenges for AI agent deployments. Firstly, it mitigates the risk of data exfiltration and unauthorized access by ensuring agents only interact with trusted domains. Secondly, it helps prevent prompt injection attacks, where malicious prompts could instruct an agent to visit harmful or unintended sites, by enforcing an allowlist of approved URLs. Thirdly, it meets stringent enterprise security and compliance requirements, particularly in regulated sectors, by providing transparent control and auditability of agent network interactions. Finally, for multi-tenant SaaS providers, it allows for customized, per-customer network policies, enabling specific domain restrictions based on individual client needs.
Can SNI-based domain filtering completely prevent all unauthorized connections by AI agents, and if not, what are the limitations?
While SNI-based domain filtering is highly effective for controlling web access at the TLS layer, it does have a limitation: it relies on the Server Name Indication field during the TLS handshake. An advanced attacker or a sophisticated agent could potentially resolve a blocked domain's IP address through an uninspected DNS query and attempt to connect directly via IP, bypassing SNI inspection. To address this, a defense-in-depth strategy is recommended. This involves pairing SNI filtering with DNS-level controls, such as Amazon Route 53 Resolver DNS Firewall, which can block DNS queries for unauthorized domains and prevent DNS tunneling, ensuring comprehensive egress control.
What is the typical traffic flow for an AI agent's web request when using AWS Network Firewall for domain control?
When an AI agent within Amazon Bedrock AgentCore initiates a web request, the traffic flow is meticulously controlled. First, the AgentCore Browser, residing in a private subnet, attempts to establish an HTTPS connection. This request is routed to a NAT Gateway in a public subnet, which then forwards it to the Network Firewall endpoint. The AWS Network Firewall inspects the TLS SNI header to identify the target domain. If the domain is on the allowlist, the firewall permits the traffic to pass to an Internet Gateway, which then routes it to the external destination. All return traffic follows a symmetric path back through the firewall, ensuring continuous inspection and adherence to security policies.

保持更新

将最新AI新闻发送到您的收件箱。

分享