这是一个实现 CISA 绑定操作指令 25-01 安全控制措施的 Model Context Protocol (MCP) 服务器,适用于 Microsoft 365(Azure AD/Entra ID)。
此 MCP 服务器提供了工具,用于根据 BOD 25-01 要求配置和管理 Microsoft 365 的安全设置。它与 Microsoft Graph API 集成,以执行安全控制、监控合规性并提供详细的报告。
截止日期:2025年6月20日
阻止旧版身份验证:
实现细节:
await graphClient
.api('/policies/authenticationMethodsPolicy')
.patch({
allowLegacyAuthentication: false,
blockLegacyAuthenticationMethods: true,
});
截止日期:2025年6月20日
阻止高风险用户和登录:
实现细节:
await graphClient
.api('/policies/identitySecurityDefaultsEnforcementPolicy')
.patch({
blockHighRiskUsers: true,
riskLevelForBlocking: 'high',
});
截止日期:2025年6月20日
多因素身份验证配置:
实现细节:
await graphClient
.api('/policies/authenticationMethodsPolicy')
.patch({
policies: {
fido2: {
isEnabled: true,
isSelfServiceRegistrationAllowed: true,
},
windowsHelloForBusiness: {
isEnabled: true,
isSelfServiceRegistrationAllowed: true,
},
},
});
截止日期:2025年6月20日
应用程序控制:
实现细节:
await graphClient
.api('/policies/applicationRegistrationManagement')
.patch({
restrictAppRegistration: true,
restrictNonAdminUsers: true,
});
截止日期:2205年6月20日
密码策略:
实现细节:
await graphClient
.api('/policies/passwordPolicy')
.patch({
passwordExpirationPolicy: {
passwordExpirationDays: 0,
neverExpire: true,
},
});
截止日期:2025年6月20日
特权角色管理:
实现细节:
await graphClient
.api('/policies/roleManagementPolicies')
.patch({
enforceGranularRoles: true,
blockGlobalAdminForGeneralUse: true,
requireApprovalForGlobalAdmin: true,
});
服务器类
认证
Graph 客户端
工具
graph TD
A[MCP 客户端] -->|请求| B[MCP 服务器]
B -->|认证| C[令牌管理器]
C -->|访问令牌| D[Graph 客户端]
D -->|API 调用| E[Microsoft Graph]
E -->|响应| D
D -->|结果| B
B -->|响应| A
要通过 Smithery 自动安装 CISA M365 MCP 服务器:
npx -y @smithery/cli install cisa-m365
您也可以直接从 Smithery 协议目录 复制 MCP 设置和定义,并将 MCP 服务器添加到支持 MCP 协议的 Claude 或 LLM 设置中。
git clone https://github.com/DynamicEndpoints/BOD-25-01-CSA-MCP.git
cd cisa-m365
npm install
npm run build
创建 Azure AD 应用程序:
配置环境变量:
cp .env.example .env
编辑 .env 文件:
TENANT_ID=your-tenant-id
CLIENT_ID=your-client-id
CLIENT_SECRET=your-client-secret
{
"mcpServers": {
"cisa-m365": {
"command": "node",
"args": ["path/to/cisa-m365/build/index.js"],
"env": {
"TENANT_ID": "your-tenant-id",
"CLIENT_ID": "your-client-id",
"CLIENT_SECRET": "your-client-secret"
}
}
}
}
阻止旧版身份验证方法。
{}
阻止检测到的高风险用户。
{}
对所有用户强制执行防钓鱼的多因素身份验证。
{}
配置全局管理员角色分配。
{
"userIds": ["user1-id", "user2-id"]
}
获取所有安全政策的当前状态。
{}
// 阻止旧版身份验证
const result = await client.callTool('block_legacy_auth', {});
// 获取政策状态
const status = await client.callTool('get_policy_status', {});
interface PolicySettings {
legacyAuthentication: {
blocked: boolean;
compliant: boolean;
};
highRiskUsers: {
blocked: boolean;
compliant: boolean;
};
mfa: {
phishingResistant: boolean;
alternativeEnabled: boolean;
compliant: boolean;
};
applications: {
registrationRestricted: boolean;
consentRestricted: boolean;
compliant: boolean;
};
passwords: {
expirationDisabled: boolean;
compliant: boolean;
};
roles: {
globalAdminCount: number;
granularRolesEnforced: boolean;
pamEnforced: boolean;
compliant: boolean;
};
}
服务器实现了全面的错误处理:
认证错误
API 错误
验证错误
运行时错误
示例错误响应:
{
"error": {
"code": "InvalidParams",
"message": "无效的角色分配参数",
"details": {
"parameter": "userIds",
"constraint": "必须在2到8个用户之间",
"received": "1个用户"
}
}
}
npm test
npm run test:integration
npm run test:compliance
认证
API 访问
数据保护
合规性
指南:
MIT