# 使用 Homebrew, dnf, MacPorts 安装 rats

查看 rats 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:rats
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install rats
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install rats
```

  证据: MacPorts ports tree: security/rats/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- dnf (92%):

```sh
sudo dnf install rats
```

  证据: Fedora Rawhide package metadata: rats from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

## 软件包事实

- **软件包键:** brew:rats
- **软件包管理器:** Homebrew
- **版本:** 2.4
- **来源摘要:** Rough auditing tool for security
- **主页:** <https://security.web.cern.ch/security/recommendations/en/codetools/rats.shtml>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- rats (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.4
## 项目历史与用法

RATS, the Rough Auditing Tool for Security, is a command-line static analysis scanner for finding common security-sensitive programming patterns in source code.

### 项目历史

The official README says RATS was developed, maintained, and distributed by Secure Software, Inc. The 2.4 source archive describes it as a scanner for C, C++, Perl, PHP, Python, and Ruby source that flags issues such as buffer overflows and TOCTOU race conditions.

### 采用历史

RATS circulated as a small Unix security-auditing utility through source archives and package managers. Homebrew, Debian-derived manpage packaging, Fedora, MacPorts, and other Unix package collections carried it as a lightweight source-code auditing tool.

### 使用方式

Users run rats against files or directories and can select vulnerability databases with -d, force a language with -l, choose warning levels, recurse through directories, and emit text, XML, or HTML reports.

### 为什么软件包爱好者会关心

Package maintainers care about RATS because it is an old-style security CLI: small C code, autoconf build, XML vulnerability databases, and a package surface that exposes static-analysis behavior without a large framework.

### 时间线

- 2001: The bundled manpage date records RATS documentation in September 2001.
- 2.4: Homebrew packages the Google Code archive release as the stable version.

### Related projects

- The README notes Expat as a build/runtime requirement and credits Ben Laurie for OpenSSL-specific database contributions.

### 来源

- Google Code Archive: official rough-auditing-tool-for-security project and source download.
- Homebrew formula metadata for rats stable 2.4.
- RATS 2.4 README and rats.1 from the official Google Code archive tarball.


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- dnf - rats - 2.4-32.fc45: normalized package name match | Fedora Rawhide package metadata: rats from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Rough Auditing Tool for Security | https://code.google.com/p/rough-auditing-tool-for-security/
- MacPorts - rats: normalized package name match | MacPorts ports tree: security/rats/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/rats.yml](https://github.com/mxcl/pkgdb/blob/main/combined/rats.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
