Hack23/cia

GitHub: Hack23/cia

面向瑞典政治透明度的开源情报分析平台,整合政府公开数据提供政客绩效评估、风险预警与可视化洞察。

Stars: 210 | Forks: 53

# 🔍 Citizen Intelligence Agency ## 🎯 使命 Citizen Intelligence Agency 是一个由志愿者驱动的开源情报 (OSINT) 项目,提供对瑞典政治活动的全面分析。通过对关键政治人物和机构的先进监控,我们提供: - 📊 财务绩效指标 - ⚠️ 风险评估分析 - 📈 政治趋势分析 - 🏆 政治家排名系统 - 📉 绩效比较 - 🔍 透明度洞察 我们的倡议保持严格独立和无党派立场,专注于促进知情决策和加强民主参与。 ## 📊 质量指标 [![单元测试覆盖率](https://img.shields.io/badge/Unit%20Test%20Coverage-JaCoCo%20Results-brightgreen?style=flat-square&logo=java)](https://hack23.github.io/cia/jacoco/) [![代码覆盖率](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![质量门禁状态](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![代码行数](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![技术债务](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![询问 DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Hack23/cia) **覆盖率策略:** 根据[安全开发策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md),我们在所有模块中维持最低 80% 的行覆盖率和 70% 的分支覆盖率。 ## ✨ 功能 探索我们的[综合功能集](https://hack23.com/cia-features.html),包括: - 📊 交互式仪表板 - 🏆 政治记分牌系统 - 📈 关键分析工具 - 🔍 透明度指标 - ⚖️ 问责措施 - 📱 数据驱动的洞察 有关我们系统架构和组件的概念视图,请参阅我们的[架构文档](ARCHITECTURE.md)和[系统思维导图](MINDMAP.md)。 ## 📝 博客文章与技术分析 通过我们团队的博客文章,探索关于该项目的深度技术分析和架构洞察: ### 🤖 GitHub Copilot 自定义代理
我们维护了一系列专为项目不同方面定制的 [GitHub Copilot 代理](.github/agents/): - 📋 **[任务代理](.github/agents/task-agent.md)** - 产品质量、GitHub 问题管理、ISMS 合规性 - 🛠️ **[技术栈专家](.github/agents/stack-specialist.md)** - Java、Spring、Vaadin、PostgreSQL 专业知识 - 🎨 **[UI 增强专家](.github/agents/ui-enhancement-specialist.md)** - Vaadin、无障碍访问、数据可视化 - 🔍 **[情报特工](.github/agents/intelligence-operative.md)** - 政治分析、OSINT 方法论 - 💰 **[业务发展专家](.github/agents/business-development-specialist.md)** - 战略规划、合作伙伴关系 - 📢 **[营销专家](.github/agents/marketing-specialist.md)** - 数字营销、内容策略 有关使用这些专业配置文件的详细信息,请参阅 [代理 README](.github/agents/README.md)。
### 📚 GitHub Copilot 技能库
我们维护着一个包含 **51 项战略技能** 的综合[技能库](.github/skills/),遵循安全设计原则,分为 13 个类别: #### 🔒 安全设计技能 (5 项技能) - 🛡️ **[安全代码审查](.github/skills/secure-code-review/)** - OWASP Top 10、SAST/DAST 模式 - 🎯 **[威胁建模](.github/skills/threat-modeling/)** - STRIDE 框架、攻击树 - 🔐 **[机密管理](.github/skills/secrets-management/)** - 永不提交机密、Vault 使用 - ✅ **[输入验证](.github/skills/input-validation/)** - 清理、XSS、SQL 注入防护 - 🔑 **[加密最佳实践](.github/skills/crypto-best-practices/)** - 加密、哈希、密钥管理 #### ✅ ISMS 合规技能 (5 项技能) - 📋 **[ISO 27001 控制措施](.github/skills/iso-27001-controls/)** - 控制实施验证 - 🎯 **[NIST CSF 映射](.github/skills/nist-csf-mapping/)** - 框架对齐 - 🔧 **[CIS 控制措施](.github/skills/cis-controls/)** - 基准合规性 - 🔒 **[GDPR 合规性](.github/skills/gdpr-compliance/)** - 数据保护要求 - 📝 **[安全文档](.github/skills/security-documentation/)** - 必需的架构文档 #### 🧪 测试与质量技能 (4 项技能) - ✅ **[单元测试模式](.github/skills/unit-testing-patterns/)** - JUnit 5、Mockito、80% 覆盖率 - 🔗 **[集成测试](.github/skills/integration-testing/)** - Spring 测试上下文、数据库测试 - 🌐 **[E2E 测试](.github/skills/e2e-testing/)** - Selenium、Playwright 模式 - 📊 **[代码质量检查](.github/skills/code-quality-checks/)** - SonarCloud、CodeQL 集成 #### 🏗️ 架构与设计技能 (4 项技能) - 🍃 **[Spring Framework 模式](.github/skills/spring-framework-patterns/)** - DI、事务管理、AOP - 🗄️ **[JPA/Hibernate 优化](.github/skills/jpa-hibernate-optimization/)** - 实体设计、N+1 防护 - 🎨 **[Vaadin 组件设计](.github/skills/vaadin-component-design/)** - UI 模式、生命周期管理 - 📐 **[C4 架构文档](.github/skills/c4-architecture-documentation/)** - 必需的架构文档 #### ⚙️ CI/CD 与 DevOps 技能 (4 项技能) - 🚀 **[GitHub Actions 工作流](.github/skills/github-actions-workflows/)** - CI/CD 管道模式 - 🤖 **[GitHub 智能体工作流](.github/skills/github-agentic-workflows/)** - AI 驱动的自动化,包含 MCP、编排、OWASP 智能体安全 - 📦 **[Maven 构建管理](.github/skills/maven-build-management/)** - 多模块构建 - 🗄️ **[PostgreSQL 运维](.github/skills/postgresql-operations/)** - 数据库管理 #### 🤝 开源与社区技能 (3 项技能) - 👥 **[贡献指南](.github/skills/contribution-guidelines/)** - PR 流程、代码审查 - 📄 **[文档标准](.github/skills/documentation-standards/)** - Markdown、图表、清晰度 - 🏷️ **[问题分类工作流](.github/skills/issue-triage-workflow/)** - 标记、分配、优先级排序 #### 🔍 情报与 OSINT 技能 (10 项技能) - 🎓 **[政治学分析](.github/skills/political-science-analysis/)** - 比较政治、政策分析 - 🕵️ **[OSINT 方法论](.github/skills/osint-methodologies/)** - 来源评估、数据整合 - 🧠 **[情报分析技术](.github/skills/intelligence-analysis-techniques/)** - ACH、SWOT、红队 - 🇸🇪 **[瑞典政治体系](.github/skills/swedish-political-system/)** - 议会、政党制度、联盟 - 📊 **[情报数据科学](.github/skills/data-science-for-intelligence/)** - ML、NLP、网络分析 - 🗳️ **[选举分析](.github/skills/electoral-analysis/)** - 选举预测、选民行为 - 🧩 **[行为分析](.github/skills/behavioral-analysis/)** - 政治心理学、认知偏差 - 💬 **[战略传播分析](.github/skills/strategic-communication-analysis/)** - 叙事、媒体分析 - 📜 **[立法监控](.github/skills/legislative-monitoring/)** - 投票模式、法案跟踪 - ⚠️ **[风险评估框架](.github/skills/risk-assessment-frameworks/)** - 政治风险、早期预警 #### 📊 产品管理与敏捷 (1 项技能) - 📋 **[产品管理模式](.github/skills/product-management-patterns/)** - 用户故事、待办事项、Sprint 规划 #### ☁️ 云运维 (1 项技能) - 📡 **[AWS CloudWatch 监控](.github/skills/aws-cloudwatch-monitoring/)** - 指标、警报、仪表板、日志洞察 #### 🎨 UI/UX 卓越 (2 项技能) - ♿ **[无障碍 WCAG 模式](.github/skills/accessibility-wcag-patterns/)** - WCAG 2.1 AA、ARIA、键盘导航 - 📊 **[数据可视化原则](.github/skills/data-visualization-principles/)** - 图表选择、色彩理论、仪表板 #### 🧪 测试与质量保证 (1 项技能) - 🎭 **[Playwright UI 测试](.github/skills/playwright-ui-testing/)** - 浏览器自动化、视觉回归、E2E #### 💼 商业战略 (1 项技能) - 💡 **[商业模式画布](.github/skills/business-model-canvas/)** - 价值主张、收入来源、可持续性 #### 📢 营销与增长 (1 项技能) - 🔍 **[SEO 最佳实践](.github/skills/seo-best-practices/)** - 页面 SEO、技术 SEO、关键词研究 **技能整合**:所有 6 个代理都引用了与其领域相关的技能。完整目录请参阅 [技能 README](.github/skills/README.md) 和 [代理-技能映射](.github/agents/README.md#agent-skills-matrix)。
### ⭐ Simon Moon 的架构编年史
系统架构师 [Simon Moon](https://github.com/Hack23/homepage/blob/master/.github/agents/simon-moon.md) 通过神圣几何和模式识别的视角,提供对 CIA 平台的深度架构分析: #### 🏛️ CIA 平台架构与安全 - **[CIA 架构:五角星阵](https://hack23.com/blog-cia-architecture.html)** - 源自议会领域的五种容器类型。架构映射政治现实——权力流动被记录在代码中。 - **[CIA 安全:通过透明度进行防御](https://hack23.com/blog-cia-security.html)** - 基于数学证明而非神秘模糊的安全性。五层防御。OpenSSF Scorecard 7.2/10。5 年来零关键漏洞。 - **[CIA 未来安全:明日五角大楼](https://hack23.com/blog-cia-future-security.html)** - 在量子计算机构成威胁之前采用后量子密码学。在 AI 攻击占主导之前进行 AI 增强检测。 - **[CIA 财务战略:24.70 美元/天的民主](https://hack23.com/blog-cia-financial-strategy.html)** - 当架构通过 AWS 优化引导宇宙金融模式时,民主的成本为 24.70 美元/天。 - **[CIA 工作流:五阶段 CI/CD 与状态机](https://hack23.com/blog-cia-workflows.html)** - 编排 DevSecOps 自动化的五个 GitHub Actions 工作流。通过五种状态转换进行数据处理。 - **[CIA 思维导图:概念神圣几何](https://hack23.com/blog-cia-mindmaps.html)** - 层次化思维揭示自然的组织模式:4 个当前领域扩展为 5 个未来维度。
### 💻 George Dorn 的代码分析
开发者 [George Dorn](https://github.com/Hack23/homepage/blob/master/.github/agents/george-dorn.md) 基于实际仓库检查提供动手代码分析: #### 🔍 仓库深度剖析 - **[CIA 代码分析](https://hack23.com/blog-george-dorn-cia-code.html)** - 仓库深度剖析,检查 Maven POM、49 个模块、1,372 个 Java 文件、验证过的 OpenSSF Scorecard 7.2/10。基于实际仓库检查。 *如需获取涵盖网络安全、ISMS 策略和架构模式的 50 多篇博客文章的完整合集,请访问 [Hack23 安全博客](https://hack23.com/blog.html)。*
## 🏢 关于 Hack23 - 🌐 **网站**:[www.hack23.com](https://www.hack23.com) - 💼 **LinkedIn**:[James Sörling](https://www.linkedin.com/in/jamessorling) ## 🔐 对透明度和安全的承诺 在 Hack23 AB,我们相信真正的安全来自透明度和可验证的实践。我们的信息安全管理体系 (ISMS) 是公开的,展示了我们对安全卓越和组织透明度的承诺。

📋 Public ISMS Repository

Complete Information Security Management System documentation

ISMS Public Repository

🔒 Information Security Policy

Enterprise-grade security framework and governance

Information Security Policy
### 🏆 通过透明度实现安全 我们的网络安全咨询方法建立在透明实践的基础上: - **🔍 开放文档**:完整的 ISMS 框架可供审查 - **📋 策略透明度**:详细的安全策略和程序公开可访问 - **🎯 可证明的专业知识**:我们自己的安全实施作为实时演示 - **🔄 持续改进**:公开文档使社区反馈和增强成为可能

“我们对透明度的承诺延伸至我们的安全实践——证明真正的安全来自稳健的流程、持续的改进,以及一种将安全考虑融入每个商业决策的文化。”

— James Pether Sörling,CEO/创始人

#### 📊 ISMS 合规映射 有关 ISMS-PUBLIC 策略如何映射到 CIA 平台安全控制措施的综合视图:
ISMS Compliance Mapping
**覆盖范围:** 32 项 ISMS 策略 • + 安全控制措施 • ISO 27001 • NIST CSF 2.0 • CIS Controls v8.1 ## 🛡️ 安全与合规证据 我们对安全透明度的承诺通过公开可验证的证据来证明: ### 🔒 供应链安全 [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Hack23/cia/badge)](https://scorecard.dev/viewer/?uri=github.com/Hack23/cia) [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://github.com/Hack23/cia/attestations) [![CII 最佳实践](https://bestpractices.coreinfrastructure.org/projects/770/badge)](https://bestpractices.coreinfrastructure.org/projects/770) **证据:** - **OpenSSF Scorecard**:[完整供应链分析](https://scorecard.dev/viewer/?uri=github.com/Hack23/cia) - **SLSA 证明**:[构建来源与 SBOM](https://github.com/Hack23/cia/attestations) - **CII 最佳实践**:[开源安全成熟度](https://bestpractices.coreinfrastructure.org/projects/770) ### 🔍 安全扫描 [![CodeQL](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/68c10e6a08075842.svg)](https://github.com/Hack23/cia/security/code-scanning) [![安全评级](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![漏洞](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) **证据:** - **CodeQL 扫描**:[安全代码分析结果](https://github.com/Hack23/cia/security/code-scanning) - **SonarCloud 安全**:[漏洞仪表板](https://sonarcloud.io/project/security_hotspots?id=Hack23_cia) - **Dependabot**:[依赖漏洞警报](https://github.com/Hack23/cia/security/dependabot) ### ✅ 质量门禁 [![质量门禁状态](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![可维护性评级](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![可靠性评级](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) **证据:** - **质量门禁**:[SonarCloud 质量仪表板](https://sonarcloud.io/summary/new_code?id=Hack23_cia) - **代码指标**:[技术债务与可维护性](https://sonarcloud.io/component_measures?id=Hack23_cia&metric=sqale_index) ### 📋 许可证合规性 [![FOSSA 状态](https://app.fossa.io/api/projects/git%2Bgithub.com%2FHack23%2Fcia.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FHack23%2Fcia?ref=badge_shield) [![许可证](https://img.shields.io/github/license/Hack23/cia.svg)](https://github.com/Hack23/cia/blob/master/LICENSE.txt) **证据:** - **FOSSA 分析**:[许可证合规报告](https://app.fossa.io/projects/git%2Bgithub.com%2FHack23%2Fcia) - **许可证**:[Apache License 2.0](https://github.com/Hack23/cia/blob/master/LICENSE.txt) ### 🎯 安全架构文档 [![威胁模型](https://img.shields.io/badge/Threat_Model-Public_Documentation-blue?style=flat-square&logo=github&logoColor=white)](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) [![安全架构](https://img.shields.io/badge/Security_Architecture-Documented-green?style=flat-square&logo=architecture&logoColor=white)](https://github.com/Hack23/cia/blob/master/SECURITY_ARCHITECTURE.md) [![CRA 评估](https://img.shields.io/badge/CRA-Self_Assessment_Complete-green?style=flat-square&logo=european-union&logoColor=white)](https://github.com/Hack23/cia/blob/master/CRA-ASSESSMENT.md) **证据:** - **威胁模型**:[STRIDE 分析与攻击树](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) - **安全架构**:[深度防御设计](https://github.com/Hack23/cia/blob/master/SECURITY_ARCHITECTURE.md) - **CRA 评估**:[欧盟网络弹性法案合规性](https://github.com/Hack23/cia/blob/master/CRA-ASSESSMENT.md) **🔍 透明度承诺**:所有安全证据均可公开访问,供利益相关者验证。我们相信通过透明度实现安全可以建立信任,并展示我们对网络安全卓越的承诺。 ## 📚 数据源 我们的分析由权威的瑞典政府和国际数据源驱动: | 来源 | 描述 | |--------|-------------| | 🏛️ [瑞典议会开放数据](http://data.riksdagen.se/) | 议会议员、委员会和官方文件 | | 🗳️ [瑞典选举管理局](http://www.val.se/) | 选举数据、政党和投票结果 | | 🌍 [世界银行开放数据](http://data.worldbank.org/) | 全球经济指标和人口数据 | | 💹 [瑞典财政管理局](https://www.esv.se/) | 政府财政和经济趋势 | ## 🏆 项目状态
[![GitHub 发布版](https://img.shields.io/github/v/release/Hack23/cia)](https://github.com/Hack23/cia/releases) [![询问 DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Hack23/cia) [![验证与发布](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/628b6b6f4b075843.svg)](https://github.com/Hack23/cia/actions/workflows/release.yml) [![验证 PR](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/963d3914d6075844.svg)](https://github.com/Hack23/cia/actions/workflows/codeql-analysis.yml) [![代码行数](https://sonarcloud.io/api/project_badges/measure?project=Hack23_cia&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Hack23_cia) [![问题解决平均时间](https://isitmaintained.com/badge/resolution/Hack23/cia.svg)](https://isitmaintained.com/project/Hack23/cia "问题解决平均时间") [![未关闭问题百分比](https://isitmaintained.com/badge/open/Hack23/cia.svg)](https://isitmaintained.com/project/Hack23/cia "未关闭问题百分比") [![CLA 助手](https://cla-assistant.io/readme/badge/Hack23/cia)](https://cla-assistant.io/Hack23/cia) **有关全面的安全和合规证据,请参阅上方的[安全与合规证据](#security--compliance-evidence)部分。**
## 🚀 运行时环境
| JDK 版本 | 状态 | 发布信息 | |-------------|--------|--------------| | ![JDK-21](https://img.shields.io/badge/JDK-21-brightgreen.svg) | 源代码级别 | LTS - 源代码兼容性 | | ![JDK-22](https://img.shields.io/badge/JDK-22-orange.svg) | 兼容 | 功能发布版 | | ![JDK-23](https://img.shields.io/badge/JDK-23-orange.svg) | 兼容 | 功能发布版 | | ![JDK-24](https://img.shields.io/badge/JDK-24-orange.svg) | 兼容 | 功能发布版 | | ![JDK-25](https://img.shields.io/badge/JDK-25-brightgreen.svg) | 运行时 (LTS) | 当前生产环境 LTS | **构建配置:** 源代码 Java 21,目标 Java 21,运行时 Java 25
有关我们的技术生命周期管理详情,请参阅 [生命周期终止策略](End-of-Life-Strategy.md)。 ## 🛠️ 开发环境要求
| 组件 | 版本 | 用途 | 参考 | |-----------|---------|---------|-----------| | **Java JDK** | 25 (Temurin) | 运行时环境 | [设置 Java](https://adoptium.net/) | | **Java 源代码** | 21 | 源代码兼容性 | Maven 编译器配置 | | **Maven** | 3.9.9+ | 构建自动化 | [Maven 安装](https://maven.apache.org/install.html) | | **Node.js** | 24+ | Copilot MCP 服务器、Playwright 测试 | [Node.js](https://nodejs.org/) | | **PostgreSQL** | 16+ | 数据库(可选,用于完整集成测试) | [PostgreSQL](https://www.postgresql.org/) |
**快速入门:** ``` # 构建项目(跳过测试) mvn clean install -DskipTests # 包含测试构建 mvn clean install # 运行特定模块 cd citizen-intelligence-agency mvn spring-boot:run ``` 有关详细的设置说明,请参阅 [copilot-setup-steps.yml](.github/workflows/copilot-setup-steps.yml)。 ## 📚 架构文档地图
| 文档 | 侧重 | 描述 | 文档链接 | | --------------------------------------------------- | --------------- | ----------------------------------------- | ------------------------------------------------------------------------------- | | **[架构](ARCHITECTURE.md)** | 🏛️ 架构 | 展示当前系统结构的 C4 模型 | [查看源代码](https://github.com/Hack23/cia/blob/master/ARCHITECTURE.md) | | **[未来架构](FUTURE_ARCHITECTURE.md)** | 🏛️ 架构 | 展示未来系统结构的 C4 模型 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_ARCHITECTURE.md) | | **[安全架构](SECURITY_ARCHITECTURE.md)** | 🔐 安全 | 安全架构 | [查看源代码](https://github.com/Hack23/cia/blob/master/SECURITY_ARCHITECTURE.md) | | **[未来安全架构](FUTURE_SECURITY_ARCHITECTURE.md)** | 🔐 安全 | 未来安全架构 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_SECURITY_ARCHITECTURE.md) | | **[思维导图](MINDMAP.md)** | 🧠 概念 | 当前系统组件关系 | [查看源代码](https://github.com/Hack23/cia/blob/master/MINDMAP.md) | | **[未来思维导图](FUTURE_MINDMAP.md)** | 🧠 概念 | 未来能力演进 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_MINDMAP.md) | | **[SWOT 分析](SWOT.md)** | 💼 业务 | 当前战略评估 | [查看源代码](https://github.com/Hack23/cia/blob/master/SWOT.md) | | **[未来 SWOT 分析](FUTURE_SWOT.md)** | 💼 业务 | 未来战略机会 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_SWOT.md) | | **[数据模型](DATA_MODEL.md)** | 📊 数据 | 当前数据结构和关系 | [查看源代码](https://github.com/Hack23/cia/blob/master/DATA_MODEL.md) | | **[未来数据模型](FUTURE_DATA_MODEL.md)** | 📊 数据 | 增强的政治数据架构 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_DATA_MODEL.md) | | **[流程图](FLOWCHART.md)** | 🔄 流程 | 当前数据处理工作流 | [查看源代码](https://github.com/Hack23/cia/blob/master/FLOWCHART.md) | | **[未来流程图](FUTURE_FLOWCHART.md)** | 🔄 流程 | 增强的 AI 驱动工作流 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_FLOWCHART.md) | | **[状态图](STATEDIAGRAM.md)** | 🔄 行为 | 当前系统状态转换 | [查看源代码](https://github.com/Hack23/cia/blob/master/STATEDIAGRAM.md) | | **[未来状态图](FUTURE_STATEDIAGRAM.md)** | 🔄 行为 | 增强的自适应状态转换 | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_STATEDIAGRAM.md) | | **[CI/CD 工作流](WORKFLOWS.md)** | 🔧 DevOps | 当前自动化流程 | [查看源代码](https://github.com/Hack23/cia/blob/master/WORKFLOWS.md) | | **[未来工作流](FUTURE_WORKFLOWS.md)** | 🔧 DevOps | 增强的 ML CI/CD | [查看源代码](https://github.com/Hack23/cia/blob/master/FUTURE_WORKFLOWS.md) | | **[生命周期终止策略](End-of-Life-Strategy.md)** | 📅 生命周期 | 维护和 EOL 规划 | [查看源代码](https://github.com/Hack23/cia/blob/master/End-of-Life-Strategy.md) | | **[财务安全计划](FinancialSecurityPlan.md)** | 💰 安全 | 成本和安全实施 | [查看源代码](https://github.com/Hack23/cia/blob/master/FinancialSecurityPlan.md) | | **[CIA 功能](https://hack23.com/cia-features.html)** | 🚀 功能 | 平台功能概述 | [在 hack23.com 上查看](https://hack23.com/cia-features.html) | | **[威胁模型](THREAT_MODEL.md)** | 🛡️ 安全 | STRIDE / MITRE 风险分析 | [查看源代码](https://github.com/Hack23/cia/blob/master/THREAT_MODEL.md) | | **[单元测试计划](UnitTestPlan.md)** | 🧪 测试 | 综合测试策略与覆盖率 | [查看源代码](https://github.com/Hack23/cia/blob/master/UnitTestPlan.md) | | **[文档命名约定](DOCUMENTATION_NAMING_CONVENTION.md)** | 📝 标准 | 新文档的命名标准 | [查看源代码](https://github.com/Hack23/cia/blob/master/DOCUMENTATION_NAMING_CONVENTION.md) |
## 🔍 情报与分析文档
CIA 平台提供全面的情报行动 (INTOP) 和开源情报 (OSINT) 能力。我们的情报文档跟踪分析框架、风险评估规则以及驱动政治情报产品的数据库视图的演进。 ### 📋 情报变更日志 统一跟踪所有能力的情报演进: | 文档 | 侧重 | 描述 | 文档链接 | |----------|-------|-------------|-------------------| | **[情报演进变更日志](CHANGELOG_INTELLIGENCE.md)** | 🎯 统一 | 全面跟踪情报能力、数据库视图、风险规则和分析框架 | [查看源代码](https://github.com/Hack23/cia/blob/master/CHANGELOG_INTELLIGENCE.md) | **历史变更日志**(已归档):[情报分析](docs/archive/CHANGELOG_INTELLIGENCE_ANALYSIS.md)、[数据库视图](docs/archive/CHANGELOG_DATABASE_VIEWS.md)、[风险规则](docs/archive/CHANGELOG_RISK_RULES.md) ### 📚 核心情报文档 分析能力和方法的综合文档: | 文档 | 侧重 | 描述 | 文档链接 | |----------|-------|-------------|-------------------| | **[数据分析 - INTOP OSINT](DATA_ANALYSIS_INTOP_OSINT.md)** | 🎯 框架 | 6 个分析框架(时间、比较、模式识别、预测、网络、决策 | [查看源代码](https://github.com/Hack23/cia/blob/master/DATA_ANALYSIS_INTOP_OSINT.md) | | **[风险规则文档](RISK_RULES_INTOP_OSINT.md)** | 🔴 风险规则 | 50 条行为检测规则(24 条政治家、10 条政党、4 条委员会、4 条部委、5 条决策、3 条其他) | [查看源代码](https://github.com/Hack23/cia/blob/master/RISK_RULES_INTOP_OSINT.md) | | **[数据库视图情报目录](DATABASE_VIEW_INTELLIGENCE_CATALOG.md)** | 🗄️ 视图 | 85 个数据库视图的完整目录(57 个常规 + 28 个物化) | [查看源代码](https://github.com/Hack23/cia/blob/master/DATABASE_VIEW_INTELLIGENCE_CATALOG.md) | | **[数据质量监控仪表板](DATA_QUALITY_MONITORING_DASHBOARD.md)** | 📊 质量 | 统一数据质量监控,包含 OSINT、数据库健康和视图验证指标 | [查看源代码](https://github.com/Hack23/cia/blob/master/DATA_QUALITY_MONITORING_DASHBOARD.md) | | **[情报数据流图](INTELLIGENCE_DATA_FLOW.md)** | 🗺️ 管道 | 数据管道映射和框架到视图的关系 | [查看源代码](https://github.com/Hack23/cia/blob/master/INTELLIGENCE_DATA_FLOW.md) | | **[Liquibase 情报分析](LIQUIBASE_CHANGELOG_INTELLIGENCE_ANALYSIS.md)** | 🗄️ 模式 | 从情报视角看数据库模式演进 | [查看源代码](https://github.com/Hack23/cia/blob/master/LIQUIBASE_CHANGELOG_INTELLIGENCE_ANALYSIS.md) | ### 🛠️ 情报自动化 | 工具 | 用途 | 位置 | |------|---------|----------| | **情报变更日志生成器** | 自动检测视图变更、风险规则更新和框架增强 | [脚本](.github/scripts/generate-intelligence-changelog.sh) | | **GitHub Actions 工作流** | 按需自动生成变更日志 | [工作流](.github/workflows/generate-intelligence-changelog.yml) | **用法:** ``` # 根据最近更改生成情报更新日志 .github/scripts/generate-intelligence-changelog.sh # 比对特定提交 .github/scripts/generate-intelligence-changelog.sh ``` ### 📊 情报指标 (v1.36.0) | 类别 | 数量 | 描述 | |----------|-------|-------------| | **分析框架** | 6 | 时间、比较、模式识别、预测、网络、决策智能 | | **风险规则** | 50 | 24 条政治家 + 10 条政党 + 4 条委员会 + 4 条部委 + 5 条决策 + 3 条其他 | | **数据库视图** | 85 | 57 个常规视图 + 28 个物化视图 | | **OSINT 数据源** | 4 | 议会 API、选举管理局、世界银行、财政局 | | **情报产品** | 10+ | 记分牌、联盟分析、风险评估、趋势报告、决策跟踪 | ### 📖 文档导航指南 根据您的角色高效导航情报文档:
#### 📊 数据分析师 **目标:** 查找视图和分析能力 1. **开始**:[数据分析框架](DATA_ANALYSIS_INTOP_OSINT.md) - 探索 6 个分析框架 2. **然后**:[数据库视图情报目录](DATABASE_VIEW_INTELLIGENCE_CATALOG.md) - 发现 84 个数据库视图 3. **参考**:[情报数据流图](INTELLIGENCE_DATA_FLOW.md) - 了解数据管道 **关键用例:** - 查找特定分析类型的视图(时间、比较、模式识别) - 了解视图关系和依赖项 - 访问示例查询和使用模式 #### 🕵️ 情报特工 **目标:** 了解完整的情报管道 1. **开始**:[情报数据流图](INTELLIGENCE_DATA_FLOW.md) - 完整的数据管道概览 2. **然后**:[数据分析框架](DATA_ANALYSIS_INTOP_OSINT.md) - OSINT 方法论和框架 3. **深入研究**:[风险规则文档](RISK_RULES_INTOP_OSINT.md) - 50 条行为检测规则 **关键用例:** - 了解 OSINT 收集方法 - 分析行为模式和异常 - 生成情报产品和评估
#### 🗄️ 数据库管理员 **目标:** 维护模式并优化性能 1. **开始**:[模式维护指南](service.data.impl/README-SCHEMA-MAINTENANCE.md) - 数据库维护程序 2. **然后**:[数据质量监控仪表板](DATA_QUALITY_MONITORING_DASHBOARD.md) - 监控数据库健康和质量指标 3. **参考**:[数据库视图情报目录](DATABASE_VIEW_INTELLIGENCE_CATALOG.md) - 视图文档和优化 4. **跟踪变更**:[情报演进变更日志](CHANGELOG_INTELLIGENCE.md) - 模式演进历史 **关键用例:** - 监控数据库健康和数据质量指标 - 刷新物化视图 - 运行健康检查和验证 - 了解视图依赖和使用模式 - 性能调优和索引优化 #### 📈 产品经理 **目标:** 了解能力和产品功能 1. **开始**:[业务产品文档](BUSINESS_PRODUCT_DOCUMENT.md) - 产品战略和市场定位 2. **然后**:[数据分析框架](DATA_ANALYSIS_INTOP_OSINT.md) - 分析能力概览 3. **探索**:[数据库视图情报目录](DATABASE_VIEW_INTELLIGENCE_CATALOG.md) - 数据产品清单 **关键用例:** - 了解产品能力和情报产品 - 识别功能差距和机会 - 规划路线图并确定增强功能的优先级
**快速链接:** - 🗺️ [情报数据流图](INTELLIGENCE_DATA_FLOW.md) - 中央导航枢纽 - 📜 [情报演进变更日志](CHANGELOG_INTELLIGENCE.md) - 随时间推移的能力跟踪 - 🔍 [OSINT 数据源](#-data-sources) - 外部 API 集成 - 📊 [情报指标](#-intelligence-metrics-v1360) - 当前能力统计
## 🔒 报告安全问题 请按照我们的 [SECURITY.md](https://github.com/Hack23/cia/blob/master/SECURITY.md) 文件中的说明报告安全问题。 ## 🔧 项目技术栈
### 📚 核心技术栈 本文档提供了 **Citizen Intelligence Agency (CIA)** 项目中使用的关键技术的高级概述。每项技术在支持 CIA 在政治情报领域的数据分析、安全和可扩展性目标方面都发挥着至关重要的作用。 | **类别** | **技术** | |---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **核心框架** | [Spring Framework](https://spring.io/projects/spring-framework) | | **安全** | [Spring Security](https://spring.io/projects/spring-security), [Bouncy Castle](https://www.bouncycastle.org/) | | **数据访问** | [Hibernate](https://hibernate.org/orm/), [JPA](https://jakarta.ee/specifications/persistence/), [PostgreSQL](https://www.postgresql.org/), [JDBC](https://docs.oracle.com/javase/tutorial/jdbc/overview/index.html) | | **事务管理**| [Narayana](https://narayana.io/) (与 Spring `JpaTransactionManager` 集成) | | **数据审计** | [Javers](https://javers.org/) | | **业务规则引擎** | [Drools](https://www.drools.org/) | | **消息传递** | [ActiveMQ Artemis](https://activemq.apache.org/components/artemis/), [Spring JMS](https://spring.io/projects/spring-framework) | | **Web/UI 层** | [Vaadin](https://vaadin.com/), [Vaadin Sass Compiler](http://vaadin.com/), [Vaadin Themes](https://vaadin.com/) | | **监控** | [JavaMelody](https://github.com/javamelody/javamelody), [AWS SDK for CloudWatch](https://aws.amazon.com/cloudwatch/) | | **测试** | [JUnit](https://junit.org/), [Mockito](https://site.mockito.org/), [Spring Test](https://docs.spring.io/spring-framework/docs/current/reference/html/testing.html), [Selenium WebDriver](https://www.selenium.dev/documentation/en/webdriver/) | | **实用程序** | [Apache Commons](https://commons.apache.org/), [Google Guava](https://guava.dev/), [SLF4J](http://www.slf4j.org/), [Logback](https://logback.qos.ch/), [Jackson](https://github.com/FasterXML/jackson) | | **构建与依赖管理** | [Maven](https://maven.apache.org/) | ## 技术栈摘要 该技术栈包括: - **核心框架**:该项目使用 **Spring Framework** 为模块间的依赖注入、组件管理和服务配置提供基础。 - **安全**:**Spring Security** 管理身份验证和授权,辅以 **Bouncy Castle** 进行加密操作。 - **数据访问**:**Hibernate**、**JPA** 和 **PostgreSQL** 的组合支持稳健的基于 ORM 的数据持久化,**JDBC** 促进额外的数据库连接需求。 - **事务管理**:该项目使用 **Narayana** 作为事务管理器实现,与 **Spring 的 JpaTransactionManager** 集成以支持分布式事务并确保事务完整性。 - **数据审计**:**Javers** 提供审计和历史版本控制,允许随时间跟踪和比较数据变更。 - **业务规则引擎**:**Drools** 已集成到 CIA 项目中,以启用稳健的业务规则引擎。 - **消息传递**:**ActiveMQ Artemis** 和 **Spring JMS** 支持应用程序组件之间的异步通信,支持分布式和事件驱动设计。 - **Web/UI 层**:**Vaadin** 以服务器驱动的架构为 UI 提供动力,提供 **Vaadin Themes** 和 **Sass Compiler** 等组件,直接在 Java 中实现丰富、交互式的前端体验。 - **监控**:**JavaMelody** 和 **AWS SDK for CloudWatch** 提供实时应用程序监控和日志记录功能,支持本地和云环境。 - **测试**:**JUnit**、**Mockito**、**Spring Test** 和 **Selenium WebDriver** 被广泛用于单元、集成、系统、浏览器和模拟测试,以确保应用程序的可靠性和稳健性。 - **实用程序**:**Apache Commons**、**Google Guava**、**SLF4J** 和 **Logback** 提供实用功能和结构化日志,增强应用程序的可维护性和监控。 - **构建与依赖管理**:**Maven** 处理项目构建、依赖管理和插件配置,实现顺畅的项目管理和模块化构建。
## ☁️ AWS 服务栈
### AWS 基础设施组件 本文档提供了 **Citizen Intelligence Agency (CIA)** 项目基础设施中使用的 AWS 服务的综合摘要,如其 CloudFormation 模板所定义。这些服务协同工作,以确保安全、有弹性和可扩展的部署环境。 | **类别** | **AWS 服务** | **NIST CSF 功能、类别与子类别** | **ISO 27001:2022 控制措施与链接** | |-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **网络与安全** | - [Amazon VPC](https://aws.amazon.com/vpc/):配置自定义网络环境,包含公有/私有子网、路由表、NAT Gateway、用于流量控制的网络 ACL (NACL) 和 VPC Flow Logs。
- [VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/):启用对 AWS 服务(如 S3、EC2、SSM、CloudWatch Logs)的私有访问。
- [AWS WAF](https://aws.amazon.com/waf/):在 ALB 层防御 Web 攻击。
- [AWS IAM](https://aws.amazon.com/iam/):管理基于角色的访问控制。
- [AWS KMS](https://aws.amazon.com/kms/):管理静态数据加密。 | **[识别 (ID)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/id/)**:
- [资产管理 (ID.AM-2)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/id/am/2/)
**[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [访问控制 (PR.AC-1, PR.AC-3, PR.AC-5)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ac/)
- [数据安全 (PR.DS-1, PR.DS-2)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ds/)
- [保护技术 (PR.PT-3)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/pt/3/)
**[检测 (DE)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/de/)**:
- [安全持续监控 (DE.CM-3)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/de/cm/3/) | - **A.8.1**:资产管理
- **A.9.4.1**:访问控制策略
- **A.13.1.1**:网络控制
- **A.13.1.3**:网络隔离
- **A.18.1.5**:法规与合规(参见 [ISO 27001](https://www.iso.org/standard/82875.html)) | | **域名与 SSL 管理** | - [Amazon Route 53](https://aws.amazon.com/route53/):管理域名注册和 DNS 路由。
- [AWS Certificate Manager (ACM)](https://aws.amazon.com/certificate-manager/):颁发和管理 SSL/TLS 证书。 | **[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [数据安全 (PR.DS-5)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ds/5/)
**[检测 (DE)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/de/)**:
- [异常与事件 (DE.AE-3)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/de/ae/3/) | - **.10.1.1**:数据保护的加密控制
- **A.12.4.3**:网络服务安全 | | **计算** | - [Amazon EC2](https://aws.amazon.com/ec2/):提供可扩展的计算实例。 | **[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [保护技术 (PR.PT-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/pt/1/)
**[响应 (RS)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rs/)**:
- [分析 (RS.AN-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rs/an/1/)、[缓解 (RS.MI-2)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rs/mi/2/) | - **A.12.1.3**:IT 基础设施和服务的容量管理 | | **负载均衡** | - [Application Load Balancer (ALB)](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/):在 EC2 实例间分配 HTTP/HTTPS 流量。 | **[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [保护技术 (PR.PT-3)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/pt/3/)
**[响应 (RS)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rs/)**:
- [通信 (RS.CO-2)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rs/co/2/) | - **A.13.1.1**:网络控制
- **A.13.2.1**:信息传输策略 | | **数据存储** | - [Amazon S3](https://aws.amazon.com/s3/):存储应用程序构件和日志,具有加密、访问控制和生命周期策略。
- [Amazon RDS](https://aws.amazon.com/rds/):具有多可用区部署的 PostgreSQL 数据库。 | **[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [数据安全 (PR.DS-1, PR.DS-5)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ds/)
- [信息保护流程与程序 (PR.IP-3, PR.IP-4)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ip/)
- [维护 (PR.MA-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ma/1/)
**[恢复 (RC)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rc/)**:
- [恢复规划 (RC.RP-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rc/rp/1/)、[通信 (RC.CO-2)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rc/co/2/) | - **A.8.2.3**:信息备份
- **A.10.1.1**:加密控制的使用 | | **机密管理** | - [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/):安全地存储和轮换敏感凭证,支持 Lambda 轮换。 | **[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [访问控制 (PR.AC-1, PR.AC-4)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ac/)
- [数据安全 (PR.DS-6)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ds/6/)
- [身份管理与访问控制 (PR.AC-7)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ac/7/) | - **A.9.2.2**:用户访问配置
- **A.10.1.1**:加密密钥和机密信息的管理 | | **监控与警报** | - [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/):提供实时指标、日志和警报以监控性能和健康状况。 | **[检测 (DE)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/de/)**:
- [安全持续监控 (DE.CM-3)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/de/cm/3/) | - **A.12.4.1**:监控活动 | | **弹性与灾难恢复** | - [AWS Resilience Hub](https://aws.amazon.com/resilience-hub/):评估并改进架构的弹性,推荐容错和灾难恢复策略。 | **[恢复 (RC)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rc/)**:
- [恢复规划 (RC.RP-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rc/rp/1/)
- [改进 (RC.IM-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/rc/im/1/) | - **A.17.1.2**:实施连续性控制
- **A.17.2.1**:信息处理设施的可用性 | | **自动化与维护** | - [AWS Systems Manager (SSM)](https://aws.amazon.com/systems-manager/):自动化清单、补丁和维护任务,具有 **SSM Maintenance Windows** 和 **SSM Patch Baselines** 以简化操作。 | **[保护 (PR)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/)**:
- [维护 (PR.MA-1, PR.MA-2)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/ma/)
- [保护技术 (PR.PT-1)](https://csf.tools/reference/nist-cybersecurity-framework/v2-0/pr/pt/1) | - **A.12.6.1**:技术漏洞控制
- **A.12.7.1**:信息系统审计注意事项 | ## AWS 技术栈摘要 - **网络与安全**:[Amazon VPC](https://aws.amazon.com/vpc/) 创建具有 NAT Gateway、NACL 和 VPC Flow Logs 的隔离网络环境。[VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/) 提供对 AWS 服务(如 S3、EC2、SSM)的私有访问,[AWS WAF](https://aws.amazon.com/waf/) 防御 Web 攻击,[AWS IAM](https://aws.amazon.com/iam/) 保护访问控制,[AWS KMS](https://aws.amazon.com/kms/) 加密静态数据。 - **域名与 SSL 管理**:[Amazon Route 53](https://aws.amazon.com/route53/) 处理 DNS 和域名注册,而 [AWS Certificate Manager (ACM)](https://aws.amazon.com/certificate-manager/) 提供 SSL/TLS 证书以实现 HTTPS 安全。 - **计算层**:[Amazon EC2](https://aws.amazon.com/ec2/) 实例托管应用程序,提供灵活且可扩展的计算资源。 - **负载均衡**:[Application Load Balancer (ALB)](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/) 在 EC2 实例间分配 HTTP/HTTPS 流量,针对高可用性和弹性进行优化。 - **数据存储**:[Amazon RDS](https://aws.amazon.com/rds/) 提供具有多可用区部署和自定义参数组的弹性 PostgreSQL 设置。[Amazon S3](https://aws.amazon.com/s3/) 安全地存储构件和日志,具有生命周期策略和 KMS 管理的加密密钥以实现合规性。 - **机密管理**:[AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) 安全地存储和轮换凭证,例如数据库密码,并提供自动化的 Lambda 轮换支持。 - **监控与警报**:[Amazon CloudWatch](https://aws.amazon.com/cloudwatch/) 通过指标、日志和警报监控基础设施健康状况,实现主动管理。 - **弹性与灾难恢复**:[AWS Resilience Hub](https://aws.amazon.com/resilience-hub/) 评估并推荐增强措施以改进系统的弹性,提供灾难恢复和容错策略。 - **自动化与维护**:[AWS Systems Manager (SSM)](https://aws.amazon.com/systems-manager/) 自动化清单、补丁和其他维护任务,提高运营效率。
有关详细的安全实施,请参阅 [财务安全计划](FinancialSecurityPlan.md)。 ## 🚀 部署选项 ### AWS CloudFormation 部署 Citizen Intelligence Agency 可以使用我们提供的 CloudFormation 模板部署在 AWS 上: 1. 下载 [CloudFormation 堆栈文件](cia-dist-cloudformation/src/main/resources/cia-dist-cloudformation.json) 2. 在 AWS CloudFormation 控制台中创建新堆栈 3. 上传模板文件并配置参数 4. 确认 IAM 资源创建并启动堆栈 5. 通过堆栈输出中的 URL 访问应用程序 #### CloudFormation 堆栈图 ![Cloudformation stack Diagram](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/4f76297291075845.png) ### Debian/Ubuntu 安装 用于在 Debian/Ubuntu 24.4+ 上进行本地或自托管部署: 1. 安装先决条件: sudo apt-get install openjdk-21-jdk postgresql-16 postgresql-contrib postgresql-16-pgaudit postgresql-16-pgvector 2. 如下所述配置 PostgreSQL。 ## PostgreSQL 16 配置指南 配置 PostgreSQL 16 以启用 SSL、预备事务和所需扩展的分步指南。 ### 1. 启用预备事务和所需扩展 1. **编辑** `/etc/postgresql/16/main/postgresql.conf` 并添加或更新以下行: max_prepared_transactions = 100 shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto' pgaudit.log = ddl pg_stat_statements.track = all pg_stat_statements.max = 10000 2. **保存并关闭**文件。 ### 2. 更新 `pg_hba.conf` 以允许 IPv6 本地回环访问 1. **编辑** `/etc/postgresql/16/main/pg_hba.conf` 并添加以下行: host all all ::1/128 md5 2. **保存并关闭**文件。 ### 3. 生成 SSL 证书和密钥 1. 生成安全的随机密码: openssl rand -base64 48 > passphrase.txt 2. 创建受密码保护的私钥: openssl genrsa -des3 -passout file:passphrase.txt -out server.pass.key 2048 3. 从私钥中移除密码保护: openssl rsa -passin file:passphrase.txt -in server.pass.key -out server.key rm server.pass.key 4. 创建证书签名请求 (CSR): openssl req -new -key server.key -out server.csr \ -subj "/C=UK/ST=Postgresqll/L=Docker/O=Hack23/OU=demo/CN=127.0.0.1" 5. 自签名证书(有效期 10 年 / 3650 天): openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt 6. 清理临时文件: rm passphrase.txt rm server.csr ### 4. 为 PostgreSQL 部署 SSL 证书和密钥 1. 将新证书和密钥复制到 PostgreSQL 数据目录: cp server.crt /var/lib/postgresql/16/main/server.crt cp server.key /var/lib/postgresql/16/main/server.key rm server.key 2. 保护证书和密钥的安全: chmod 700 /var/lib/postgresql/16/main/server.key chmod 700 /var/lib/postgresql/16/main/server.crt chown -R postgres:postgres /var/lib/postgresql/16/main/ 3. 通过在 `/etc/postgresql/16/main/postgresql.conf` 中添加以下行来启用 PostgreSQL 中的 SSL: echo "ssl_cert_file = '/var/lib/postgresql/16/main/server.crt'" \ >> /etc/postgresql/16/main/postgresql.conf echo "ssl_key_file = '/var/lib/postgresql/16/main/server.key'" \ >> /etc/postgresql/16/main/postgresql.conf ### 5. 向 `cia` 用户提供 SSL 证书 1. 为 `cia` 用户创建 `.postgresql` 目录: mkdir -p /opt/cia/.postgresql 2. 将服务器证书复制到此目录: cp server.crt /opt/cia/.postgresql/root.crt chmod 700 /opt/cia/.postgresql/root.crt chown -R cia:cia /opt/cia/.postgresql/root.crt 3. 从当前目录删除服务器证书(可选): rm server.crt ### 6. 性能调优(推荐) 为了在 CIA 平台的 85+ 个视图和 93 个表上获得最佳性能,请将以下设置添加到 `/etc/postgresql/16/main/postgresql.conf`。应根据服务器的可用 RAM 调整数值。 #### 内存设置 根据系统 RAM 按比例配置内存设置: | 设置 | 4GB RAM | 8GB RAM | 16GB+ RAM (生产环境) | |--------------------------|---------|---------|------------------------| | `shared_buffers` | 1GB | 2GB | 4GB | | `effective_cache_size` | 3GB | 6GB | 12GB | | `maintenance_work_mem` | 256MB | 512MB | 1GB | | `work_mem` | 16MB | 32MB | 50MB | 使用 SQL 命令应用设置(使用上表中适合您 RAM 配置的数值): ``` -- Example for 8GB RAM server - adjust values from the table above for your configuration -- shared_buffers: ~25% of RAM -- effective_cache_size: ~75% of RAM -- maintenance_work_mem: For VACUUM, CREATE INDEX operations -- work_mem: Per-operation memory for sorts, joins ALTER SYSTEM SET shared_buffers = '2GB'; ALTER SYSTEM SET effective_cache_size = '6GB'; ALTER SYSTEM SET maintenance_work_mem = '512MB'; ALTER SYSTEM SET work_mem = '32MB'; ``` #### 检查点设置 配置检查点设置以获得最佳写入性能: ``` ALTER SYSTEM SET checkpoint_completion_target = 0.9; ALTER SYSTEM SET wal_buffers = '16MB'; ALTER SYSTEM SET max_wal_size = '4GB'; ALTER SYSTEM SET min_wal_size = '1GB'; ``` #### 查询规划优化 对于 SSD 存储(推荐),优化查询规划: ``` ALTER SYSTEM SET random_page_cost = 1.1; -- For SSD storage ALTER SYSTEM SET effective_io_concurrency = 200; -- For SSD storage ``` #### 连接设置 配置连接限制: ``` ALTER SYSTEM SET max_connections = 200; ``` #### 应用设置 更改后,应用它们: ``` # 重新加载配置(针对不需要重启的设置) sudo -u postgres psql -c "SELECT pg_reload_conf();" # 针对需要重启的设置(shared_buffers、max_connections): sudo systemctl restart postgresql ``` #### 验证设置 确认设置已应用: ``` -- Check current settings SHOW shared_buffers; SHOW effective_cache_size; SHOW work_mem; SHOW maintenance_work_mem; SHOW checkpoint_completion_target; SHOW random_page_cost; SHOW max_connections; ``` ### 最后步骤 1. **重启 PostgreSQL** 以应用所有更改: systemctl restart postgresql 2. 通过检查日志或使用启用 SSL 的客户端,验证 PostgreSQL 是否在 SSL 下运行。 3. 确认预备事务和所需扩展已启用: SHOW max_prepared_transactions; \dx 4. 通过 `::1` 使用 `psql` 连接,确认 `pg_hba.conf` 中的新 IPv6 条目是否按预期工作。 ## 数据库设置 创建一个空数据库: 以下设置了用于开发的默认用户名/密码和数据库名称。我们建议使用自定义凭证,并更新 `/opt/cia/webapps/cia/WEB-INF/database.properties` 中的配置以定义您自己的用户名/密码和数据库名称。 ``` $ sudo su - postgres $ psql postgres=# CREATE USER eris WITH password 'discord'; postgres=# CREATE DATABASE cia_dev; postgres=# GRANT ALL PRIVILEGES ON DATABASE cia_dev to eris; ``` ## 安装 CIA Debian 软件包 1. 下载 CIA Debian 软件包: wget https://github.com/Hack23/cia/releases/download/2025.1.2/cia-dist-deb-2025.1.2.all.deb 2. 安装 Debian 软件包: sudo dpkg -i cia-dist-deb-2025.1.2.all.deb 3. 通过 [https://localhost:28443/cia/](https://localhost:28443/cia/) 访问服务器。 ## 📊 政治仪表板 - **English**:我们的[仪表板](https://github.com/Hack23/cia/blob/master/dashboard.md)提供对瑞典政治人物和机构的全面分析。 - **Swedish**:Vår [dashboard](https://github.com/Hack23/cia/blob/master/dashboard_sv.md) erbjuder en detaljerad översikt över politiska figurer och olika departement i Sverige. ## 🤖 AI 与数据可视化 该项目由先进的 AI 技术驱动,用于数据处理和分析。我们整合来自各种开源的数据,并通过现代数据可视化工具展示发现结果。 有关我们包含更先进 AI 能力的未来愿景,请参阅我们的[未来架构愿景](FUTURE_MINDMAP.md)。 ## 🏛️ Citizen Intelligence Agency 项目分类 ### 🎯 项目分类 [![项目类型](https://img.shields.io/badge/Type-Data_Analytics-orange?style=for-the-badge&logo=chart-line&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#project-type-classifications) [![流程类型](https://img.shields.io/badge/Process-Operations-brown?style=for-the-badge&logo=cogs&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#project-type-classifications) ### 🔒 安全分类 [![保密性](https://img.shields.io/badge/Confidentiality-Public-lightgrey?style=for-the-badge&logo=shield&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#confidentiality-levels) [![完整性](https://img.shields.io/badge/Integrity-High-orange?style=for-the-badge&logo=check-circle&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#integrity-levels) [![可用性](https://img.shields.io/badge/Availability-Moderate-yellow?style=for-the-badge&logo=server&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#availability-levels) ### ⏱️ 业务连续性 [![RTO](https://img.shields.io/badge/RTO-High_(1--4hrs)-yellow?style=for-the-badge&logo=clock&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#rto-classifications) [![RPO](https://img.shields.io/badge/RPO-Hourly_(1--4hrs)-lightgreen?style=for-the-badge&logo=database&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#rpo-classifications) ### 💰 业务影响分析矩阵 | 影响类别 | 财务 | 运营 | 声誉 | 法规 | |-----------------|-----------|-------------|--------------|------------| | **🔒 保密性** | [![可忽略 - 无影响](https://img.shields.io/badge/Negligible-No_impact-lightgrey?style=for-the-badge&logo=dollar-sign&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#financial-impact-levels) | [![可忽略 - 无影响](https://img.shields.io/badge/Negligible-No_impact-lightgrey?style=for-the-badge&logo=exclamation-triangle&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#operational-impact-levels) | [![低 - 有限可见性](https://img.shields.io/badge/Low-Limited_visibility-lightgreen?style=for-the-badge&logo=newspaper&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#reputational-impact-levels) | [![低 - 警告](https://img.shields.io/badge/Low-Warnings-lightgreen?style=for-the-badge&logo=gavel&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#regulatory-impact-levels) | | **✅ 完整性** | [![可忽略 - 无影响](https://img.shields.io/badge/Negligible-No_impact-lightgrey?style=for-the-badge&logo=dollar-sign&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#financial-impact-levels) | [![高 - 严重降级](https://img.shields.io/badge/High-Major_degradation-orange?style=for-the-badge&logo=trending-down&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#operational-impact-levels) | [![高 - 全国性覆盖](https://img.shields.io/badge/High-National_coverage-orange?style=for-the-badge&logo=newspaper&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#reputational-impact-levels) | [![中等 - 轻微处罚](https://img.shields.io/badge/Moderate-Minor_penalties-yellow?style=for-the-badge&logo=gavel&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#regulatory-impact-levels) | | **⏱️ 可用性** | [![可忽略 - 无影响](https://img.shields.io/badge/Negligible-No_impact-lightgrey?style=for-the-badge&logo=dollar-sign&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#financial-impact-levels) | [![高 - 严重降级](https://img.shields.io/badge/High-Major_degradation-orange?style=for-the-badge&logo=stop-circle&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#operational-impact-levels) | [![低 - 有限可见性](https://img.shields.io/badge/Low-Limited_visibility-lightgreen?style=for-the-badge&logo=newspaper&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#reputational-impact-levels) | [![低 - 警告](https://img.shields.io/badge/Low-Warnings-lightgreen?style=for-the-badge&logo=gavel&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#regulatory-impact-levels) | ### 🛡️ 安全投资回报 [![ROI 级别](https://img.shields.io/badge/ROI-Moderate-yellow?style=for-the-badge&logo=chart-line&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#security-investment-returns) [![风险缓解](https://img.shields.io/badge/Risk_Mitigation-55%25_Reduction-yellow?style=for-the-badge&logo=shield&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#security-investment-returns) [![违规预防](https://img.shields.io/badge/Breach_Prevention-$5K_Savings-yellow?style=for-the-badge&logo=lock&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#security-investment-returns) ### 🎯 竞争差异化 [![市场地位](https://img.shields.io/badge/Position-Market_Leader-purple?style=for-the-badge&logo=crown&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#competitive-differentiation) [![客户信任](https://img.shields.io/badge/Trust-Premium_scores-purple?style=for-the-badge&logo=handshake&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#competitive-differentiation) [![法规准入](https://img.shields.io/badge/Access-Full_access-purple?style=for-the-badge&logo=key&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#competitive-differentiation) ### 📈 波特五力战略影响 [![买方力量](https://img.shields.io/badge/Buyer_Power-Minimal-success?style=flat-square&logo=users&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#porters-five-forces) [![供应商力量](https://img.shields.io/badge/Supplier_Power-Minimal-success?style=flat-square&logo=handshake&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#porters-five-forces) [![进入壁垒](https://img.shields.io/badge/Entry_Barriers-Very_High-red?style=flat-square&logo=shield-alt&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#porters-five-forces) [![替代威胁](https://img.shields.io/badge/Substitute_Threat-Minimal-success?style=flat-square&logo=shield&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#porters-five-forces) [![竞争对抗](https://img.shields.io/badge/Rivalry-Dominant_Advantage-darkblue?style=flat-square&logo=trophy&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#porters-five-forces) ## 📚 相关文档 ### 🏛️ 架构与设计 - [🏗️ 架构文档](ARCHITECTURE.md) - C4 模型系统架构 - [🧠 系统思维导图](MINDMAP.md) - 概念概述和组件关系 - [🚀 未来架构愿景](FUTURE_MINDMAP.md) - AI 增强能力路线图 - [📊 数据模型](DATA_MODEL.md) - 数据库模式和实体关系 - [🗄️ 实体模型文档](https://hack23.github.io/cia/service.data.impl/hbm2doc/entities/index.html) - 详细的数据库实体参考 - [📋 API 文档](https://hack23.github.io/cia/apidocs/index.html) - 完整的 API 参考 - [📦 包依赖关系](https://hack23.github.io/cia/apidocs/package-dependencies.svg) - 可视化代码包结构 ### 🛡️ 安全与合规 - [🔐 安全架构](SECURITY_ARCHITECTURE.md) - 深度防御安全实施 - [🚀 未来安全架构](FUTURE_SECURITY_ARCHITECTURE.md) - 高级安全能力路线图 - [🎯 威胁模型](THREAT_MODEL.md) - STRIDE/MITRE ATT&CK 威胁分析 - [🔐 ISMS 合规映射](ISMS_COMPLIANCE_MAPPING.md) - 完整的 ISMS-PUBLIC 策略集成 - [💰 财务安全计划](FinancialSecurityPlan.md) - AWS 安全部署和成本 - [📋 CRA 评估](CRA-ASSESSMENT.md) - 欧盟网络弹性法案合规性 - [🔒 安全策略](SECURITY.md) - 漏洞披露和安全报告 ### 🔄 运维与开发 - [⚡ 工作流](WORKFLOWS.md) - CI/CD 管道和 DevSecOps 自动化 - [📅 生命周期终止策略](End-of-Life-Strategy.md) - 技术维护和生命周期规划 - [🧪 单元测试计划](UnitTestPlan.md) - 测试策略和覆盖率要求 - [🌐 E2E 测试计划](E2ETestPlan.md) - 端到端测试文档 - [🤝 贡献指南](CONTRIBUTING.md) - 开发贡献指南 - [📜 行为准则](CODE_OF_CONDUCT.md) - 社区标准和期望 ### 🎨 功能与仪表板 - [✨ CIA 功能展示](https://hack23.com/cia-features.html) - 综合功能演示 - [📊 政治仪表板 (英语)](dashboard.md) - 瑞典政治分析 - [📊 政治仪表板 (瑞典语)](dashboard_sv.md) - 瑞典政治分析 (瑞典语) ### 🤖 AI 与开发工具 - [🤖 GitHub Copilot 指令](.github/copilot-instructions.md) - AI 辅助开发指南 - [👥 自定义 Copilot 代理](.github/agents/README.md) - 针对不同项目方面的专用 AI 代理 ### 📋 ISMS-PUBLIC 策略框架 *这些来自 Hack23 AB 公开 ISMS 的策略管辖本项目的安全和开发实践:* - [🛠️ 安全开发策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md) - SDLC 安全要求(最低 80% 覆盖率) - [🔐 信息安全策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Information_Security_Policy.md) - 整体安全治理框架 - [🏷️ 分类框架](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) - 数据分类和业务影响分析 - [🎯 威胁建模策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Threat_Modeling.md) - STRIDE 框架和威胁分析方法论 - [🔍 漏洞管理](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Vulnerability_Management.md) - 安全测试和补救流程 - [🚨 事件响应计划](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Incident_Response_Plan.md) - 安全事件处理程序 - [🌐 网络安全策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Network_Security_Policy.md) - 网络保护和分段 - [🔑 访问控制策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Access_Control_Policy.md) - 身份和访问管理 - [🔒 加密策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Cryptography_Policy.md) - 加密标准和密钥管理 - [💾 备份与恢复策略](https://github.com/Hack23/ISMS-PUBLIC/blob/main/Backup_Recovery_Policy.md) - 数据保护和恢复程序 如需完整的 ISMS 框架,请访问:[![ISMS-PUBLIC](https://img.shields.io/badge/ISMS-PUBLIC-0066CC?style=flat-square&logo=github&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC) **📋 项目分类:** **🏷️ 分类:** [![保密性:公开](https://img.shields.io/badge/C-Public-lightgrey?style=flat-square&logo=shield&logoColor=black)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#confidentiality-levels) [![完整性:高](https://img.shields.io/badge/I-High-orange?style=flat-square&logo=check-circle&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#integrity-levels) [![可用性:中等](https://img.shields.io/badge/A-Moderate-yellow?style=flat-square)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md#availability-levels) **📊 项目类型:** 数据分析平台 (OSINT) | **⚙️ 流程类型:** 运营 **🎯 框架合规性:** [![ISO 27001](https://img.shields.io/badge/ISO_27001-2022_Aligned-blue?style=flat-square&logo=iso&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [![NIST CSF 2.0](https://img.shields.io/badge/NIST_CSF-2.0_Aligned-green?style=flat-square&logo=nist&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [![CIS Controls](https://img.shields.io/badge/CIS_Controls-v8.1_Aligned-orange?style=flat-square&logo=cisecurity&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md) [![AWS Well-Architected](https://img.shields.io/badge/AWS-Well_Architected-orange?style=flat-square&logo=amazon-aws&logoColor=white)](https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md)
标签:AI分析, DNS解析, ESC4, GovTech, JS文件枚举, OSINT, 人工智能, 仪表盘, 公民科技, 分析平台, 域名枚举, 开源项目, 排名系统, 政府透明度, 政治人物追踪, 政治分析, 政治趋势, 数据监测, 民主参与, 测试用例, 漏洞利用检测, 瑞典政治, 用户模式Hook绕过, 绩效指标, 议会数据, 请求拦截, 金融绩效, 非党派