剑庭安
首页
黑客安全首页全部安全栏目 黑客技术黑客技术、渗透测试、漏洞利用工具与教程 安全软件安全工具、扫描器、检测与审计软件 病毒分析恶意软件分析、样本、逆向与沙箱 CTF思路CTF 题目、writeup、解题思路与工具 防护思路防御技术、加固、检测响应与蓝队 红蓝攻防红队攻击模拟、蓝队对抗、攻防演练 漏洞知识库漏洞、CVE、PoC、EXP 与安全研究
逆向|反编译
PHP源码PHP 网站源码、程序、系统 APP源码安卓/iOS APP 源码 ASP源码ASP 网站源码与程序 NET源码.NET 网站源码与系统 小程序源码微信/支付宝小程序源码 Dedecms风格模板Dedecms 织梦风格模板 Empirecms风格模板EmpireCMS 帝国风格模板 Discuz商业模板/插件Discuz 商业模板与插件 WordPress主题/插件WordPress 主题与插件 其它源码、模板其它各类源码与模板 游戏源码游戏源码与引擎项目 加密货币源码加密货币、区块链、钱包、USDT/比特币相关源码与工具 手游源码手机游戏源码、服务端、客户端与引擎项目 传奇源码热血传奇、传奇世界、复古传奇等客户端/服务端/引擎源码 页游源码网页游戏、H5 游戏、浏览器游戏源码 端游源码电脑单机游戏、PC 网游客户端/服务端源码
最新万能免驱动支持所有型号打印机下载程序 日历天气老黄历 · 每天同步真实日期与天气
站长工具站长工具 自助开通会员浏览该分类 其他资源qtziy SEO工具SEO工具 站群源码站群源码 泛程序泛程序 蜘蛛模板蜘蛛模板 蜘蛛池蜘蛛池 外链工具外链工具
搜索 自助开通会员🔓 破甲 API
登录 注册
首页 分类列表 防护思路 nss - 6-Layer Defensive Arch…
防护思路
作者:admin 发布:2026-10-06

nss - 6-Layer Defensive Architecture Sovereign, GDPR-co

项目说明NSS - Nexus So Standard v3.1.1![License: AGPL-3.0-or-later](LICENSE)![GDPR-yellow.svg)](#compliance-ratings)![EU AI Act-yellow.svg)](#compliance-r…
资源可下载 免费下载 0 条讨论
会员资源
开通会员后即可下载全部资源。
登录后开通会员
会员方案
263浏览量
0讨论
2下载链接
可下载资源状态
内容可验证
更新 2026-10-06
人工审核发布
评论区答疑

项目说明

NSS - Nexus So Standard v3.1.1

![License: AGPL-3.0-or-later](LICENSE)
![GDPR-yellow.svg)](#compliance-ratings)
![EU AI Act-yellow.svg)](#compliance-ratings)
![]()
![Status]()
![Python]()
![Tests](#test-suite)
![CI]()
![Security]()
![Docker]()
![codecov]()

So, GDPR-compliant AI infrastructure standard for the European Union.

> Status: Concept / RFC -- NSS v3.1.1 is a conceptual standard and reference architecture. It has not been independently tested, audited, or by third parties. The code in this repository is a reference implementation for demonstration purposes. Compliance ratings are self-assessed design targets, not certified results. Contributions, feedback, and peer review are welcome.

---

O

NSS (Nexus So Standard) proposes a 6-layer defensi with Guardian Shield for enterprise AI deployments. It is designed around Mistral AI models with local Ollama inference, targeting zero Cloud Act exposure and full EU data so.

NSS is a conceptual framework designed to meet European regulatory requirements, including GDPR and the EU AI Act. The architecture targets pri principles at every layer, from knowledge storage through cogniti to go o. All components are designed to operate within EU borders. This is a design specification and reference implementation -- production readiness requires independent security audits, penetration testing, and compliance certification.

---

Architecture

🏗️ Architecture (Mermaid Diagrams)


(Mermaid Diagrams)

#### Layer Stack (Data Flow)

#### Guardian Shield Defense Mechanisms

#### Microservice Communication

#### Privacy & Compliance Flow

Each layer enforces strict isolation boundaries. Requests flow upward from the Knowledge Fabric through Agent Execution, are filtered by the Cogniti, protected by Guardian Shield, and go by the Go Plane. No layer can be bypassed.

---

Microservice Architecture

| Service | Port | Bind | Description |
|---------|------|------|-------------|
| Cogniti | 11337 | External (only entry point) | PII redaction, STEER, PNC, HMAC, pipeline orchestration |
| Guardian Shield | 11338 | Internal (127.0.0.1) | MARS scoring, SENTINEL check, APEX routing, SHIELD, VIGIL |
| Go Plane | 11339 | Internal (127.0.0.1) | Policy e, privacy budget, DPIA, audit trail |
| Metrics Server | 11340 | Internal (127.0.0.1) | Prometheus-compatible operational metrics |
| Qdrant DB | 6333 | Internal (127.0.0.1) | SAG-encrypted storage for RAG |

See Port Schema for network isolation and firewall configuration.

---

Key Features

  • Europa-First Architecture -- Mistral AI foundation models with Ollama local inference; no US Cloud Act exposure

  • 6-Layer Security -- Guardian Shield with MARS, APEX, SENTINEL, SHIELD, and VIGIL subsystems

  • GDPR-Nati -- 98/100 compliance rating with built-in PII redaction, privacy budgets, and DPIA automation

  • EU AI Act Aligned -- 96/100 compliance rating with full transparency, auditability, and risk classification

  • Cost Optimization -- Up to 66% API cost savings via APEX intelligent model routing

  • Differential Privacy -- Laplace noise in RAG queries with per-user epsilon budget tracking

  • Immutable Audit Trail -- SHA-256 hash-chain audit logging with optional Redis persistence for tamper-e compliance

  • SAG Encryption -- AES-256-GCM encryption of payloads at rest in the Knowledge Fabric

  • RAG Pipeline -- Retrie Generation with encrypted document storage and context injection

  • GDPR Art. 17 Unlearning -- Automated right-to-be-forgotten orchestrator (budget reset + deletion)

  • Retention Policy -- Automatic cleanup of expired (configurable, default 90 days)

  • Prometheus Metrics -- OpenMetrics text format export for monitoring integration

  • TLS 1.3 Ready -- Optional TLS configuration for all microservices

  • Open Source + Commercial Support -- Dual-licensed under AGPL-3.0-or-later and Commercial License
  • ---

    Quick Start

    > Prerequisites: Python 3.11+, Ollama installed and running, Docker (for Qdrant and Redis).

    Installation

    Run Tests

    ---

    API Endpoints

    Cogniti (:11337)

    | Method | Endpoint | Description |
    |--------|----------|-------------|
    | GET | /health | Li/readiness probe |
    | GET | /metrics | Operational metrics |
    | POST | /v1/process | Full 6-layer pipeline (HMAC → Policy → PII → SENTINEL → MARS → APEX → SHIELD → LLM → Budget) |
    | POST | /v1/tools/execute | Sandboxed tool execution with VIGIL pre-check |
    | POST | /v1/unlearn/{user_id} | GDPR Art. 17 right-to-be-forgotten orchestrator |

    Guardian Shield (:11338)

    | Method | Endpoint | Description |
    |--------|----------|-------------|
    | GET | /health | Service health check |
    | POST | /v1/mars/score | MARS risk scoring (0-1 score, tier 0-3) |
    | POST | /v1/sentinel/check | SENTINEL 3-method injection defense |
    | POST | /v1/apex/route | APEX intelligent model routing |
    | POST | /v1/shield/enhance | SHIELD defensi wrapping |
    | POST | /v1/vigil/check | VIGIL tool-call CIA |

    Go Plane (:11339)

    | Method | Endpoint | Description |
    |--------|----------|-------------|
    | GET | /health | Service health check |
    | POST | /v1/policy/e | OPA-style policy e (role, risk, PII, tools) |
    | GET | /v1/privacy/budget/{user_id} | Remaining epsilon budget for a user |
    | POST | /v1/privacy/consume | Consume epsilon from privacy budget |
    | POST | /v1/dpia/generate | Generate GDPR Art. 35 DPIA report |
    | GET | /v1/audit/{audit_id} | Retrie audit trail entry |
    | GET | /v1/audit | Retrieve all audit trail entries |

    Metrics Server (:11340)

    | Method | Endpoint | Description |
    |--------|----------|-------------|
    | GET | /health | Service health check |
    | GET | /metrics | Full metrics snapshot (counters + histograms) |
    | GET | /metrics/prometheus | Prometheus/OpenMetrics text format export |

    ---

    Module Reference

    Layer 3: Cogniti

    | Module | File | Description |
    |--------|------|-------------|
    | Gateway Server | src/nss/gateway/server.py | FastAPI pipeline orchestrator, entry point for all requests |
    | PII Redaction | src/nss/gateway/pii_redaction.py | Regex-based detection and redaction of emails, phones, IBANs, credit cards, IPv4 |
    | STEER | src/nss/gateway/steer.py | Structured Transformation: language detection (DE/EN), pri context injection, normalization |
    | PNC Compression | src/nss/gateway/pnc_compression.py | Prompt Normalization and Compression: deduplication, filler removal, token budget truncation |
    | HMAC Signing | src/nss/gateway/hmac_signing.py | HMAC-SHA256 request signing and with timestamp-based replay protection |

    Layer 4: Guardian Shield

    | Module | File | Description |
    |--------|------|-------------|
    | Guardian Server | src/nss/guardian/server.py | FastAPI microservice exposing all Guardian components |
    | MARS | src/nss/guardian/mars.py | Model Audit & Risk Scoring: LLM-assisted risk e (score 0-1, tier 0-3) |
    | APEX | src/nss/guardian/apex.py | Adapti & Execution: intelligent model routing with cost optimization |
    | SENTINEL | src/nss/guardian/sentinel.py | 3-method injection defense: regex rules + LLM analysis + embedding cosine similarity |
    | SHIELD | src/nss/guardian/shield.py | Defensi injection: prepend/append safety tokens around user prompts |
    | VIGIL | src/nss/guardian/vigil.py | Tool-call safety : CIA triad (Confidentiality, Integrity, A) |

    Layer 5: Go Plane

    | Module | File | Description |
    |--------|------|-------------|
    | Go Server | src/nss/go/server.py | FastAPI microservice for go endpoints |
    | Policy Engine | src/nss/go/policy_engine.py | OPA/Rego simulation: role-based risk limits, PII privacy tiers, tool allowlists |
    | Privacy Budget | src/nss/go/pri.py | Per-user differential privacy epsilon budget tracking with optional Redis persistence |
    | DPIA Generator | src/nss/go/dpia.py | GDPR Article 35 DPIA auto-generation with 5 sections and markdown export |

    Layer 2: Agent Execution

    | Module | File | Description |
    |--------|------|-------------|
    | DPSparse | src/nss/agent/dp_sparse_vote.py | Differentially private RAG: Laplace noise on similarity scores, budget tracking |
    | Tool Sandbox | src/nss/agent/tool_isolation.py | WASM/WASI simulation with VIGIL pre-check and timeouts |

    Layer 1: Knowledge Fabric

    | Module | File | Description |
    |--------|------|-------------|
    | Store | src/nss/knowledge/.py | Qdrant wrapper with GDPR Art. 17 right-to-erasure, retention policy, auto-timestamps |
    | Embeddings | src/nss/knowledge/embeddings.py | Sentence-transformer embedding service (all-MiniLM-L6-v2) |
    | SAG Encryption | src/nss/knowledge/sag_encryption.py | AES-256-GCM encryption/decryption of payloads at rest |
    | RAG Pipeline | src/nss/knowledge/rag_pipeline.py | Retrie Generation: embed → search → decrypt → augment prompt |

    Cross-Cutting Infrastructure

    | Module | File | Description |
    |--------|------|-------------|
    | Config | src/nss/config.py | En configuration with NSS_ prefix |
    | Models | src/nss/models.py | Pydantic v2 data models (NSSRequest, NSSResponse, RiskScore, SentinelResult, etc.) |
    | Auth | src/nss/auth.py | JWT creation/ (HS256, 15min), RBAC (Admin/DataProcessor/Auditor/) |
    | Audit | src/nss/audit.py | Immutable audit logging with SHA-256 hash-chain and optional Redis persistence |
    | Metrics | src/nss/metrics.py | Lightweight Counter/Histogram registry with snapshot export |
    | Middleware | src/nss/middleware.py | SecurityHeaders, TracingMiddleware (X-Trace-ID), RateLimitMiddleware (sliding window) |
    | Cache | src/nss/cache.py | Redis async caching with graceful degradation (no-op when una) |
    | Metrics Server | src/nss/metrics_server.py | Dedicated FastAPI metrics endpoint |
    | LLM Client | src/nss/llm/ollama_client.py | Async Ollama client with health checks and confidence extraction |
    | Model Config | src/nss/llm/model_config.py | Model tier definitions for APEX routing decisions |

    ---

    Test Suite

    209 tests across 35 test files, organized by layer:

    | Category | Tests | Description |
    |----------|-------|-------------|
    | Gateway | 20 | PII redaction, HMAC signing, STEER, PNC compression |
    | Guardian | 25 | MARS, APEX, SENTINEL (rules + async + embedding), SHIELD, VIGIL |
    | Go | 18 | Policy engine, privacy budget, DPIA, go server |
    | Agent | 13 | DPSparse (noise, budget, fallback), tool sandbox |
    | Knowledge | 21 | store (retention, timestamps), embeddings, SAG encryption, RAG pipeline |
    | LLM | 6 | Ollama client (generate, confidence, health) |
    | Cross-Cutting | 25 | Audit, auth, metrics, middleware, cache, metrics server |
    | Guardian Server | 6 | All Guardian endpoints |
    | Go Server | 5 | All Go endpoints |
    | Integration | 46 | Full pipeline, security enforcement, persistence, unlearning, privacy, multi-service, wiring |

    ---

    Cross-Cutting Concerns

    JWT Authentication (RBAC)

  • HS256 tokens with 15-minute expiry

  • 4 roles: Admin > DataProcessor > Auditor >

  • JWTMiddleware skips /health and /metrics endpoints

  • require_role() FastAPI dependency for endpoint-le
  • Immutable Audit Logging

  • SHA-256 hash-chain: each entry references the previous hash

  • Redis persistence: optional durable storage via RPUSH to nss:audit:log with graceful degradation

  • Tamper detection: () the entire chain

  • Microsecond timestamps with UUID4 audit IDs

  • Audit events span all layers (gateway, guardian, go, agent)
  • Metrics & Obser

  • Counters: nss_requests_total, nss_requests_blocked, nss_pii_entities_redacted, nss_pri

  • Histograms: nss_request_latency_ms, nss_guardian_latency_ms

  • Export: JSON snapshot via GET /metrics and Prometheus text format via GET /metrics/prometheus on port 11340
  • Middleware Stack

  • SecurityHeadersMiddleware: X-Content-Type-Options, HSTS, X-Frame-Options, X-XSS-Protection

  • TracingMiddleware: X-Trace-ID (UUID4) generation and propagation

  • RateLimitMiddleware: Sliding-window per-IP rate limiting (configurable, default 100 req/min)
  • Redis Caching

  • Graceful degradation: system operates without Redis (cache misses, no errors)

  • Key schema: nss:{layer}:{hash}

  • TTL-based expiration
  • ---

    Compliance Ratings

    | Standard | Rating | Status |
    |----------|--------|--------|
    | GDPR (General Data Protection Regulation) | 98/100 | Self-Assessed Design Target |
    | EU AI Act | 96/100 | Self-Assessed Design Target |
    | ISO 27001 | 4.1/5 | Aligned (Not Certified) |
    | STRIDE Threat Model | 9.7/10 | Self-Assessed |

    > Note: All compliance ratings are self-assessed design targets based on architectural analysis. They have not been independently or certified. Production deployments require formal audits by accredited bodies. See the Compliance section for methodology.

    ---

    Tech Stack

    | Component | Technology | Purpose |
    |-----------|-----------|--------|
    | LLM Provider | Mistral AI | Foundation models (Mistral 7B, Mistral-Nemo 12B) |
    | Local Inference | Ollama | On-premises model serving with EU data residency |
    | Database | Qdrant | High-performance similarity search for RAG |
    | Caching Layer | Redis | Session management and response caching |
    | Policy Engine | OPA (simulated) | Go rules and access control dicts |
    | API Framework | FastAPI | High-performance async HTTP for all 4 microservices |
    | Auth | PyJWT | HS256 JWT tokens with RBAC |
    | Embeddings | sentence-transformers | all-MiniLM-L6-v2 for SENTINEL and RAG |
    | Runtime | Python 3.11+ | Core application runtime |
    | Encryption | cryptography | AES-256-GCM for SAG payload encryption |
    | Testing | pytest | 209 tests with asyncio support |

    ---

    Documentation

    | Document | Description |
    |----------|-------------|
    | White Paper | Full technical specification and design rationale |
    | API Reference | Complete REST API documentation for all 4 microservices |
    | Architecture | Detailed architecture diagrams and component descriptions |
    | ADRs | Architecture Decision Records (license, models, inference, layers, HMAC) |
    | Port Schema | Microservice ports, network isolation, firewall rules |
    | Security | Security model, threat analysis, and Guardian Shield documentation |
    | Compliance | GDPR, EU AI Act, and ISO 27001 compliance documentation |
    | Benchmarks | Reproducible benchmark methodology for performance metrics |
    | Deployment | Production deployment guides and infrastructure requirements |
    | Licensing | License terms, commercial options, and contributor agreements |

    ---

    Project Structure

    ---

    License

    NSS is dual-licensed:

  • AGPL-3.0-or-later -- For open-source use, research, and personal projects

  • Commercial License -- For proprietary deployments and enterprise use
  • If you use NSS in a proprietary product or service, you must obtain a commercial license. Contact for details.

    ---

    Contributing

    We welcome contributions from the community. Please read our Contributing Guide before submitting pull requests.

    All contributors must agree to the Contributor License Agreement (CLA) to ensure license compatibility.

    ---

    Security

    For security-related information, please see our Security Policy.

  • Critical/High : Report pri via

  • Low/Medium : Open a Security Issue
  • ---

    Author

    LEEI1337 -- Technical Architect

  • GitHub:

  • Location: Austria
  • ---

    Support

    | Channel | Contact |
    |---------|--------|
    | Bug Reports | GitHub Issues |
    | Feature Requests | Feature Request Template |

    ---

    <p align="center">
    Made in Austria | Powered by Mistral AI | Secured by Guardian Shield
    </p>

    项目信息

    开发语言:Python

    Star 数:4

    技术要点

    该项目属于防护思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕6-Layer Defensive Architecture Sovereign, GDPR-compliant AI security standard for the EU Guardian Shield展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。

    从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。

    使用与学习建议

    1. 下载源码压缩包,解压到本地环境。

    2. 根据项目类型准备对应的运行环境与依赖。

    3. 按照 README 中的步骤完成配置与部署。

    4. 在隔离的测试环境中运行验证,避免影响生产系统。

    免责声明

    本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。

    资源标题nss - 6-Layer Defensive Architecture Sovereign, GDPR-co
    所属分类防护思路
    发布作者admin
    发布时间2026-10-06 00:15:19
    下载权限 免费下载
    附件数量2 个下载链接
    浏览次数263
    讨论数量0
    主题状态正常讨论中

    本资源免费,登录后即可在本页「下载链接」区域获取全部附件。

    请在评论区留言说明具体链接,或联系作者补档。楼主更新后本页会同步最新的下载地址。

    请先阅读正文中的授权说明;未注明的默认仅限站内学习交流,禁止直接搬运到其他站点二次售卖。
    还没有讨论,快来抢沙发~
    登录 后才能参与讨论
    下载链接
    会员才能下载
    登录后开通会员
    同分类推荐
    暂无同类资源
    免费登录即可下载
    查看会员
    放大预览

    © 2026 剑庭安 - 网站开发定制 SEO 优化蜘蛛池代做 在线看手相算命. 保留所有权利。

    Powered by 酷像SEOv3.0

    网站地图 Sitemap.xml
    首页 全部分类 黑客安全 逆向|反编译 精品源码 站长工具自助开通会员其他资源SEO工具站群源码泛程序蜘蛛模板蜘蛛池外链工具创意乐园 搜索 会员服务 登录 注册