agentleFS
xu-xiangxu-xiang/everything-claude-code-zh/.cursor/rules/swift-security.md

everything-claude-code-zh / rules

Cursor rule2k starsChanged 9 months agoMITView on GitHub

扩展通用规则的 Swift 安全规范

  • Reads credentials

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the xu-xiang/everything-claude-code-zh repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about xu-xiang/everything-claude-code-zh

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

The file

Files
swift-security.md

Swift 安全规范 (Swift Security)

本文件在通用安全规则的基础上,增加了 Swift 特有的安全内容。

密钥管理 (Secret Management)

  • 对敏感数据(令牌、密码、密钥)使用 Keychain 服务 (Keychain Services) —— 绝不要使用 UserDefaults
  • 对构建时密钥使用环境变量或 .xcconfig 文件
  • 绝不要在源码中硬编码密钥 —— 反编译工具可以轻而易举地提取它们
let apiKey = ProcessInfo.processInfo.environment["API_KEY"]
guard let apiKey, !apiKey.isEmpty else {
    fatalError("API_KEY not configured")
}

传输安全 (Transport Security)

  • 应用传输安全 (App Transport Security, ATS) 默认强制执行 —— 不要禁用它
  • 对关键端点使用证书固定 (Certificate Pinning)
  • 验证所有服务器证书

输入验证 (Input Validation)

  • 在显示之前清理所有用户输入,以防止注入攻击
  • 使用 URL(string:) 并进行验证,而不是强制解包 (force-unwrapping)
  • 在处理来自外部源(API、深层链接、剪贴板)的数据之前进行验证

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.