CISA Microsoft 365 安全控制
STDIO实现M365安全控制的MCP服务器
实现M365安全控制的MCP服务器
A Model Context Protocol (MCP) server implementing CISA Binding Operational Directive 25-01 security controls for Microsoft 365 (Azure AD/Entra ID).
This MCP server provides tools for configuring and managing Microsoft 365 security settings in accordance with BOD 25-01 requirements. It integrates with Microsoft Graph API to enforce security controls, monitor compliance, and provide detailed reporting.
Due Date: 06/20/2025
Block legacy authentication:
Implementation details:
await graphClient .api('/policies/authenticationMethodsPolicy') .patch({ allowLegacyAuthentication: false, blockLegacyAuthenticationMethods: true, });
Due Date: 06/20/2025
Block high-risk users and sign-ins:
Implementation details:
await graphClient .api('/policies/identitySecurityDefaultsEnforcementPolicy') .patch({ blockHighRiskUsers: true, riskLevelForBlocking: 'high', });
Due Date: 06/20/2025
MFA configuration:
Implementation details:
await graphClient .api('/policies/authenticationMethodsPolicy') .patch({ policies: { fido2: { isEnabled: true, isSelfServiceRegistrationAllowed: true, }, windowsHelloForBusiness: { isEnabled: true, isSelfServiceRegistrationAllowed: true, }, }, });
Due Date: 06/20/2025
Application controls:
Implementation details:
await graphClient .api('/policies/applicationRegistrationManagement') .patch({ restrictAppRegistration: true, restrictNonAdminUsers: true, });
Due Date: 06/20/2025
Password policy:
Implementation details:
await graphClient .api('/policies/passwordPolicy') .patch({ passwordExpirationPolicy: { passwordExpirationDays: 0, neverExpire: true, }, });
Due Date: 06/20/2025
Privileged role management:
Implementation details:
await graphClient .api('/policies/roleManagementPolicies') .patch({ enforceGranularRoles: true, blockGlobalAdminForGeneralUse: true, requireApprovalForGlobalAdmin: true, });
Server Class
Authentication
Graph Client
Tools
graph TD A[MCP Client] -->|Request| B[MCP Server] B -->|Authentication| C[Token Manager] C -->|Access Token| D[Graph Client] D -->|API Calls| E[Microsoft Graph] E -->|Response| D D -->|Results| B B -->|Response| A
To install CISA M365 MCP Server automatically via Smithery:
npx -y @smithery/cli install cisa-m365
You can also directly copy the MCP settings and definitions from Smithery Protocol Directory and add the MCP server to your Claude or LLM setup that supports MCP protocol.
git clone https://github.com/DynamicEndpoints/BOD-25-01-CSA-MCP.git cd cisa-m365
npm install
npm run build
Create Azure AD application:
Configure environment variables:
cp .env.example .env
Edit .env
file:
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" } } } }
Block legacy authentication methods.
{}
Block users detected as high risk.
{}
Enforce phishing-resistant MFA for all users.
{}
Configure Global Administrator role assignments.
{ "userIds": ["user1-id", "user2-id"] }
Get current status of all security policies.
{}
// Block legacy authentication const result = await client.callTool('block_legacy_auth', {}); // Get policy status 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; }; }
The server implements comprehensive error handling:
Authentication Errors
API Errors
Validation Errors
Runtime Errors
Example error response:
{ "error": { "code": "InvalidParams", "message": "Invalid role assignment arguments", "details": { "parameter": "userIds", "constraint": "Must have between 2 and 8 users", "received": "1 user" } } }
npm test
npm run test:integration
npm run test:compliance
Authentication
API Access
Data Protection
Compliance
Guidelines:
MIT