General Introduction
AI-Infra-Guard is an open-source AI infrastructure security assessment tool developed by Tencent's hybrid security team, Zhuqiao Labs, designed to help users quickly discover and detect potential security risks in AI systems. The tool supports fingerprinting of more than 30 AI frameworks and components, and has a built-in database of more than 200 security vulnerabilities for individual developers, enterprise operations and maintenance personnel, and security researchers. Through efficient scanning and easy-to-use design, users can complete the security patrol of AI systems without complex configuration. The project is hosted on GitHub, open source under MIT license, and the community is welcome to contribute fingerprinting rules and vulnerability data.AI-Infra-Guard is not only suitable for security inspection of AI development environments, but can also be integrated into DevSecOps processes, providing lightweight and practical security solutions for enterprises.
Related reading:DeepSeek sets Ollama on fire, is your local deployment safe? Be wary of 'stolen' power!
Function List
- Efficient Fingerprint Recognition: Support for recognizing more than 30 AI components including LangChain, Ollama, Gradio, Open-WebUI, ComfyUI, etc. to quickly locate the technology stack used by the target system.
- vulnerability scan: Built-in 200+ security vulnerability matching rules to detect potential threats in AI infrastructure and provide CVE vulnerability information.
- AI Analytics Report:: Optionally integrate into a hybrid grand model or other AI model to generate detailed security analysis reports and remediation recommendations.
- Local One-Click Detection: Support local environment scanning without additional network requests to protect data privacy.
- multi-target scanning: Supports scanning multiple IPs or domains at the same time to improve the efficiency of large-scale detection.
- visualization interface: Provides Web UI operation mode for users to visualize the scanning results.
- Flexible rules customization: Users can customize fingerprinting and vulnerability rules to suit specific needs through YAML files.
Using Help
AI-Infra-Guard is a command line tool that also supports visual interface operation. Below is a detailed installation and usage guide to help users get started quickly.
Installation process
- environmental preparation
- System requirements: Linux, macOS, Windows are supported.
- Dependencies: Go language environment (recommended version 1.18 or higher) is required.
- Optional: If using AI analysis function, need to configure the hybrid large model token or an API Key for other models (e.g. OpenAI).
- Download Tools
- Visit the GitHub Releases page and download the latest version of the binary depending on your operating system (e.g.
ai-infra-guard-linux-amd64
). - Or build from source:
git clone https://github.com/Tencent/AI-Infra-Guard.git cd AI-Infra-Guard go build -o ai-infra-guard main.go
- Visit the GitHub Releases page and download the latest version of the binary depending on your operating system (e.g.
- Verify Installation
- Run the following command in the terminal to check the version:
. /ai-infra-guard --version
- If the version number is displayed (e.g. v0.0.6), the installation was successful.
- Run the following command in the terminal to check the version:
Functional operation flow
1. Local one-click detection
- use: Quickly scan for locally running AI systems.
- procedure::
- Ensure that local AI services are running.
- Enter it in the terminal:
. /ai-infra-guard -localscan
- The tool automatically detects local ports and services, outputting identified AI components and potential vulnerabilities.
- Sample output::
[INFO] Detected Component: Gradio
[VULN] CVE-2023-1234: Vulnerability in Gradio v3.0
2. Scanning individual targets
- use: Detects AI systems with a specified IP or domain name.
- procedure::
- Enter the command and specify the target:
. /ai-infra-guard -target 192.168.1.1
- The tool will scan the target address, identify AI components and list security risks.
- take note of: Ensure that the target is accessible, otherwise the connection will fail.
3. Scanning multiple targets
- use: Batch detection of multiple addresses.
- procedure::
- Run the multi-target scan command:
. /ai-infra-guard -target 192.168.1.1 -target example.com
- Or write the target to a file (e.g.
targets.txt
), one address per line:192.168.1.1 example.com
- Scanning using file input:
. /ai-infra-guard -file targets.txt
- When the scanning is complete, the results are displayed one by one.
4. AI analysis function
- use: Generate detailed security reports and remediation recommendations.
- procedure::
- Get the hybrid token (or configure an API Key for another model, e.g. OpenAI).
- Run a scan with AI analysis:
. /ai-infra-guard -target example.com -ai -token [your-token]
- The output will include vulnerability details and remediation recommendations:
[REPORT] Component: LangChain
[VULN] CVE-2023-5678
[FIX] Update to version 1.2.3
5. Visualization of interface operations
- use: View scanning results through the web interface.
- procedure::
- Start the web service:
. /ai-infra-guard -ws
- Open your browser and visit
http://localhost:8080
The - Enter the target address in the interface and click the "Scan" button to view the results in real time.
- Interface Functions::
- Displays the scanning progress.
- Lists detected components and vulnerabilities.
- Download the report file.
Customized rules
- trails: The fingerprinting rules are located in the
data/fingerprints
directory, the vulnerability rules are located in thedata/vuln
Catalog. - procedure::
- Edit the YAML file, for example to add new fingerprinting rules:
info. name: my-component author: User severity: info http: method: GET - method: GET path: "/" matchers: body: "unique-string - body: "unique-string"
- Save and re-run the scan and the tool will load the new rules.
caveat
- network access: Ensure that there is legal authorization when scanning external targets to avoid violating the law.
- performance optimization: When scanning multiple targets, it is recommended to adjust the number of concurrencies according to the hardware configuration (well optimized by default).
- Update Tool: Check GitHub Releases regularly to download the latest version for more fingerprinting and vulnerability data.
With the above steps, users can easily use AI-Infra-Guard to check the security of AI systems, either in local development environments or in enterprise-level deployments, and get up and running quickly with useful results.