Skip to main content
Glama

list_users_without_mfa

Identify IAM users without MFA enabled to enhance AWS account security by detecting potential vulnerabilities.

Instructions

Lists IAM users who do not have MFA enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler logic for the 'list_users_without_mfa' tool. It lists all IAM users and checks each for attached MFA devices using ListMFADevicesCommand, collecting those without MFA.
    if (name === "list_users_without_mfa") { const listCmd = new ListUsersCommand({}); const listResp = await iamClient.send(listCmd); const users = listResp.Users || []; const noMfaUsers = []; // Checking users sequentially to avoid rate limiting for (const user of users) { if (!user.UserName) continue; try { const mfaCmd = new ListMFADevicesCommand({ UserName: user.UserName }); const mfaResp = await iamClient.send(mfaCmd); if (!mfaResp.MFADevices || mfaResp.MFADevices.length === 0) { noMfaUsers.push({ UserName: user.UserName, UserId: user.UserId, CreateDate: user.CreateDate, PasswordLastUsed: user.PasswordLastUsed }); } } catch (err) { // Ignore errors (e.g. AccessDenied) } } return { content: [{ type: "text", text: JSON.stringify(noMfaUsers, null, 2) }] }; }
  • src/index.ts:350-356 (registration)
    Registration of the 'list_users_without_mfa' tool in the ListTools response, including its name, description, and empty input schema.
    { name: "list_users_without_mfa", description: "Lists IAM users who do not have MFA enabled.", inputSchema: { type: "object", properties: {} }
  • Input schema for the tool, which takes no parameters.
    description: "Lists IAM users who do not have MFA enabled.", inputSchema: { type: "object", properties: {}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Bhavesh8890/MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server