企业安全博客平台

这是一个基于Azure OpenAI和MCP服务器自动生成内容的Microsoft安全解决方案企业博客平台,严格限制内容来源为Microsoft Learn和Azure文档。

  • by Jalix07
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Jalix07/microsoft-security-blog

使用说明

🔒 微软安全博客-MCP专用版

关于微软安全解决方案的企业博客平台,由Azure OpenAI提供支持,并使用MCP(模型上下文协议)服务器进行自动化,以进行严格的源代码验证。

🎯 概述

这是一个生产就绪的博客平台,它:

  1. 自动生成博客内容 使用Azure OpenAI
  2. 仅强制MCP约束 -仅限Microsoft Learn+Azure文档中的所有内容
  3. 发布到GitHub 通过自动化工作流程
  4. 部署到Azure (应用服务或静态Web应用程序)
  5. 涵盖7个安全主题 有全面的指南

📋 涵盖的主题

  • 🛡️ 端点防御器 -高级设备保护
  • 📧 Office 365防御程序 -电子邮件和协作安全
  • 🔐 身份捍卫者 -身份威胁防护
  • ☁️ 云应用卫士 -云应用安全
  • 👤 微软Entra ID -身份和访问管理
  • 👁️ 微软哨兵 -SIEM和威胁检测
  • 📊 Microsoft权限 -数据治理与合规

🏗️ 建筑

┌─────────────────────────────────────────────────────────────────┐
│                     GitHub Actions Workflow                     │
│  (Weekly automated blog generation + MCP-only validation)       │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ↓
┌─────────────────────────────────────────────────────────────────┐
│                  MCP Fetcher (Constraint-Based)                 │
│  • Validates all sources from allowed domains only              │
│  • Fetches ONLY from: learn.microsoft.com, docs.microsoft.com   │
│  • Tracks audit trail of sources used                           │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ↓
┌─────────────────────────────────────────────────────────────────┐
│            Azure OpenAI (Foundry) - GPT-4                       │
│  • Receives ONLY MCP-sourced content in context                 │
│  • System prompt enforces MCP-only generation                   │
│  • No internet access - works with provided context only        │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ↓
┌─────────────────────────────────────────────────────────────────┐
│                   Blog Content (Markdown)                       │
│  • Fully sourced from Microsoft Learn                           │
│  • Includes source citations                                    │
│  • Audit trail validation                                       │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ↓
┌─────────────────────────────────────────────────────────────────┐
│                   Next.js 14 Blog Platform                      │
│  • Server-side rendering (SEO optimized)                        │
│  • Dynamic blog pages                                           │
│  • GitHub-integrated publishing                                 │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ↓
┌─────────────────────────────────────────────────────────────────┐
│                    Azure App Service                            │
│  • Hosted on Azure (Bicep IaC)                                  │
│  • Application Insights monitoring                              │
│  • Key Vault for secrets                                        │
│  • HTTPS + security headers                                     │
└─────────────────────────────────────────────────────────────────┘

🚀 快速开始

先决条件

  • Node.js 18+
  • npm或纱线
  • Azure OpenAI端点和密钥
  • GitHub账号

本地开发

# Clone repository
git clone https://github.com/Jalix07/microsoft-security-blog.git
cd microsoft-security-blog

# Install dependencies
npm install

# Create .env.local
cat > .env.local << EOF
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_KEY=your-api-key
AZURE_OPENAI_DEPLOYMENT=gpt-4
MCP_ONLY_MODE=true
EOF

# Run development server
npm run dev

打开 http://localhost:3000 查看博客。

🔧 可用脚本

# Development
npm run dev              # Start dev server on port 3000

# Production
npm run build            # Build Next.js application
npm start               # Start production server

# Blog Generation
npm run generate:blogs       # Generate blogs (development mode)
npm run generate:blogs:prod  # Generate blogs (MCP-only enforced)

# Linting
npm run lint            # Run ESLint

🤖 博客生成过程

1.自动每周生成(GitHub操作)

工作流程每周一00:00 UTC运行:

# Trigger workflow manually
gh workflow run generate-blogs.yml

2.仅MCP约束执行

// lib/mcp-fetcher.ts
const ALLOWED_DOMAINS = [
  'learn.microsoft.com',
  'docs.microsoft.com',
  'azure.microsoft.com',
]

// Only these domains are allowed as sources
// All other sources are rejected

3.根据上下文生成内容

// System prompt ensures MCP-only compliance
"CRITICAL: ONLY use the Microsoft Learn documentation provided.
 NEVER use general knowledge or external information.
 ALL claims MUST be directly supported by provided sources."

4.审计跟踪与合规

{
  "topic": "defender-endpoint",
  "sources": [
    "https://learn.microsoft.com/en-us/defender/endpoint/",
    "https://learn.microsoft.com/en-us/defender/endpoint/deployment/"
  ],
  "success": true,
  "timestamp": "2024-01-31T10:00:00Z"
}

📁 项目结构

microsoft-security-blog/
├── app/                          # Next.js App Router
│   ├── page.tsx                 # Homepage with topic cards
│   ├── layout.tsx               # Root layout
│   ├── globals.css              # Tailwind + custom styles
│   └── blog/
│       └── [slug]/
│           └── page.tsx         # Dynamic blog pages
├── components/
│   ├── Navigation.tsx           # Header navigation
│   └── Footer.tsx               # Footer with links
├── lib/
│   ├── mcp-fetcher.ts          # MCP source validation & fetching
│   └── blog-generator.ts        # Azure OpenAI integration
├── scripts/
│   └── generate-blogs.ts        # Blog generation script
├── infra/
│   ├── main.bicep              # Azure infrastructure
│   └── main.parameters.json    # Deployment parameters
├── .github/workflows/
│   ├── generate-blogs.yml      # Weekly blog generation
│   └── deploy-azure.yml        # Deploy to Azure
└── public/
    └── blogs/
        └── generated/           # Generated blog posts

🔐 安全功能

1.仅MCP验证

private isValidMCPSource(url: string): boolean {
  return this.ALLOWED_DOMAINS.some(domain => 
    urlObj.hostname.endsWith(domain)
  )
}

2.审计日志

  • 追踪的所有来源
  • 记录的时间戳
  • 合规性可认证

3.Azure安全

  • 强制HTTPS
  • 秘密密钥库
  • 身份认证
  • 网络安全

📊 监控和分析

应用洞察

  • 实时监控
  • 性能指标
  • 错误追踪
  • 用户分析

博客生成指标

  • 发电成功率
  • 源验证结果
  • 平均发电时间
  • 内容质量分数

🚢 部署

部署到Azure(二头肌)

# Login to Azure
az login

# Create resource group
az group create --name microsoft-security-rg --location eastus

# Deploy infrastructure
az deployment group create \
  --resource-group microsoft-security-rg \
  --template-file infra/main.bicep \
  --parameters infra/main.parameters.json

# Deploy application
npm run build
npm run start

GitHub操作部署

  1. 设置秘密
gh secret set AZURE_WEBAPP_NAME -b "your-app-name"
gh secret set AZURE_RESOURCE_GROUP -b "your-rg-name"
gh secret set AZURE_CLIENT_ID -b "your-client-id"
gh secret set AZURE_TENANT_ID -b "your-tenant-id"
gh secret set AZURE_SUBSCRIPTION_ID -b "your-subscription-id"
gh secret set AZURE_OPENAI_ENDPOINT -b "https://your-resource.openai.azure.com/"
gh secret set AZURE_OPENAI_KEY -b "your-openai-key"
  1. 推送到主分支
git push origin main

部署通过GitHub Actions自动触发。

🔗 MCP服务器集成

此博客与Microsoft的MCP服务器集成:

  • 微软学习 MCP -正式文件
  • Azure文档MCP -特定服务指南
  • Azure服务MCP -技术规格

所有内容都是 保证 仅来自这些来源。

📈 SEO和流量

目标关键字

  • 微软安全解决方案
  • 端点部署防御器
  • entra id实现
  • 哨兵siem配置
  • 权限数据治理

预计交通量

  • 第1-3个月:10K-50000次访问
  • 第4-6个月:100K-500K访问量
  • 第7-12个月:500K-2M次访问
  • 第1年+:500万次/月访问量

🤝 贡献

欢迎投稿!如有重大变更,请:

  1. 分叉存储库
  2. 创建特征分支(git checkout -b feature/amazing-feature)
  3. 提交更改(git commit -m 'Add amazing feature')
  4. 推送到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

📄 许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。

⭐ 支持

如果你觉得这个项目很有价值,请给它一个⭐️!


🔐 MCP唯一承诺:每一篇博客文章都是由官方的Microsoft Learn和Azure文档生成的。零外部来源。100%可验证的内容。

建于❤️ 使用Next.js 14、TypeScript、Azure OpenAI和Microsoft Learn MCP服务器。