A comprehensive web application for managing cloud resources across AWS and Azure. Features multi-cloud resource management, automated deployments, cross-account role management, and a modern web interface. Built with Go backend and Vue.js frontend with Docker support.
- π’ Multi-Account Management: Switch between AWS accounts using cross-account roles
- π₯ User Management: View, create, and manage IAM users across organization accounts
- π Access Key Management: Create, rotate, and delete access keys securely
- π Password Management: Check and manage console password status
- π User Details: Comprehensive user information including ARN, creation date, and permissions
- π¦ StackSet Deployment: Deploy IAM roles to all organization accounts with one click
- β Permission Validation: Automatically validate required AWS permissions before deployment
- π Real-time Monitoring: Track StackSet deployment progress across all accounts
- π Dark/Light Theme: Modern responsive UI with theme switching
- π‘οΈ Security: External ID protection and least privilege permissions
- π AWS SSO (IAM Identity Center) Management: View SSO users, groups, and account assignments
- βοΈ Azure AD Integration: Manage Azure AD Enterprise Applications (optional)
- Backend: Go 1.21+ with Gin framework and AWS SDK v2
- Frontend: Vue.js 3 with Vite, compiled and served by Go (no Node.js runtime dependency)
- Deployment: Docker Compose for easy deployment
- Authentication: AWS IAM roles for cross-account access
- Security: External ID validation and proper credential management
-
AWS Organization with multiple accounts
-
IAM user in master account with permissions to:
- List organization accounts (
organizations:ListAccounts) - Assume roles in target accounts (
sts:AssumeRole) - CloudFormation StackSets operations (for automated role deployment)
- Organizations service access
- IAM Identity Center (SSO) management (if using SSO features):
sso:ListInstancesidentitystore:ListUsers,identitystore:DescribeUseridentitystore:ListGroups,identitystore:DescribeGroupidentitystore:ListGroupMembershipssso:ListPermissionSets,sso:DescribePermissionSetsso:ListAccountAssignments,sso:ListAccountAssignmentsForPrincipalsso:ListManagedPoliciesInPermissionSet,sso:GetInlinePolicyForPermissionSet
Note: SSO permissions must be attached directly to the IAM user in the master account (not just the cross-account role). See SSO Setup section below.
- List organization accounts (
-
Target account roles (
IAMManagerCrossAccountRole) OR use our automated StackSet deployment -
Docker and Docker Compose (for containerized deployment)
-
Go 1.21+ (for CLI and local development)
Use our modern Go CLI with Makefile targets for the best experience:
# 1. Clone the repository
git clone https://github.com/rusik69/aws-iam-manager.git
cd aws-iam-manager
# 2. Check AWS configuration
make check-aws-config
# 3. Configure AWS credentials (if needed)
aws configure
# OR set environment variables:
# export AWS_ACCESS_KEY_ID=your_key
# export AWS_SECRET_ACCESS_KEY=your_secret
# export AWS_REGION=us-east-1
# 4. Deploy IAM user with required permissions
make deploy-user
# 5. Deploy roles to all organization accounts
make deploy-stackset
# 6. Check deployment status
make status-stackset
# 7. Start the web application
make devAccess the application at http://localhost:8080
# 1. Clone and configure
git clone https://github.com/rusik69/aws-iam-manager.git
cd aws-iam-manager
# 2. Configure environment
cp .env.example .env
# Edit .env with your AWS credentials
# 3. Build and run
docker-compose up --buildCopy .env.example to .env and configure:
# Required AWS credentials
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
AWS_REGION=us-east-1
AWS_SSO_REGION=eu-west-2 # Region for IAM Identity Center (SSO) management (defaults to eu-west-2)
# Optional IAM configuration
IAM_ORG_ROLE_NAME=IAMManagerCrossAccountRole
IAM_USER_NAME=iam-manager
IAM_POLICY_NAME=IAMManagerCustomPolicy
STACK_SET_NAME=IAMManagerRoleStackSet
# Optional Azure AD credentials (for Azure Enterprise Applications feature)
AZURE_TENANT_ID=your_tenant_id_here
AZURE_CLIENT_ID=your_client_id_here
AZURE_CLIENT_SECRET=your_client_secret_here
# Optional Azure Resource Manager credentials (for Azure VM and Storage management)
AZURE_SUBSCRIPTION_ID=your_subscription_id_here
# Application settings
PORT=8080To enable Azure AD Enterprise Applications management:
-
Register an Azure AD Application:
- Go to Azure Portal β Azure Active Directory β App registrations
- Click "New registration"
- Name:
cloud-manager(or your preferred name) - Supported account types: Single tenant or Multi-tenant
- Click "Register"
-
Create a Client Secret:
- In your app registration, go to "Certificates & secrets"
- Click "New client secret"
- Add description and expiration
- Copy the secret value immediately (it won't be shown again)
-
Grant API Permissions:
- Go to "API permissions"
- Click "Add a permission" β "Microsoft Graph" β "Application permissions"
- Add the following permissions:
Application.Read.All(to list and read enterprise applications)Application.ReadWrite.All(to delete enterprise applications)
- Click "Add permissions"
- Important: Click "Grant admin consent" for your organization
-
Get Required Values:
- Tenant ID: Found in Azure AD β Overview β Tenant ID
- Client ID: Found in your app registration β Overview β Application (client) ID
- Client Secret: The secret value you copied in step 2
-
Configure Environment Variables:
export AZURE_TENANT_ID=your_tenant_id export AZURE_CLIENT_ID=your_client_id export AZURE_CLIENT_SECRET=your_client_secret
Or add them to your
.env.prodfile (formake dev) or Kubernetes secrets (for production). -
Verify Setup:
- Start the application:
make dev - Check logs for:
[INFO] Azure service initialized successfully - Navigate to "Azure Apps" tab in the web interface
- Start the application:
Note: Azure features are optional. The application will work without Azure credentials, but Azure endpoints will not be available.
To enable AWS SSO (IAM Identity Center) management features:
-
Ensure IAM Identity Center is enabled in your AWS Organization:
- Go to AWS Console β IAM Identity Center
- If not enabled, follow the setup wizard to enable it
-
Attach SSO permissions to your IAM user in the master account:
The IAM user (e.g.,
iam-manager) needs SSO permissions directly attached, as SSO operations are performed in the master account context.Option A: Using AWS CLI (Recommended):
# Attach the SSO policy to your IAM user aws iam put-user-policy \ --user-name iam-manager \ --policy-name SSOIdentityCenterManagement \ --policy-document file://cloudformation/iam-manager-user-sso-policy.jsonOption B: Using AWS Console:
- Go to IAM β Users β
iam-managerβ Permissions - Click "Add permissions" β "Create inline policy"
- Choose JSON tab
- Copy the contents from
cloudformation/iam-manager-user-sso-policy.json - Review and create the policy
Option C: Using CloudFormation (if you prefer IaC):
# Create a stack that attaches the policy aws cloudformation create-stack \ --stack-name iam-manager-user-sso-policy \ --template-body file://cloudformation/iam-manager-user-sso-policy.yaml \ --parameters ParameterKey=UserName,ParameterValue=iam-manager - Go to IAM β Users β
-
Set the SSO region (if different from default):
export AWS_SSO_REGION=eu-west-2 # Default is eu-west-2 (London)
Or add to your
.env.prodfile or Kubernetes secrets. -
Verify Setup:
- Restart the application:
make dev - Check logs for:
[INFO] SSO service initialized successfully - Navigate to "SSO Users" or "SSO Groups" in the web interface
- If you see an error, check the
/api/sso/statusendpoint for details
- Restart the application:
Note: SSO features are optional. The application will work without SSO permissions, but SSO endpoints will return error messages indicating the service is unavailable.
To enable Azure VM and Storage Account management:
-
Follow Azure AD Setup (steps 1-4 above) to create the service principal
-
Grant Subscription Listing Permissions:
The service principal needs permission to list subscriptions. You have two options:
Option A: Grant Reader Role at Management Group Level (Recommended)
This allows the service principal to list all subscriptions under a management group:
# Get your Management Group ID (or use "Tenant Root Group") MANAGEMENT_GROUP_ID="your-management-group-id" # or use "/" for Tenant Root Group SERVICE_PRINCIPAL_ID="your-service-principal-object-id" # Found in Azure AD β Enterprise applications β Your app β Object ID # Grant Reader role at Management Group level az role assignment create \ --assignee $SERVICE_PRINCIPAL_ID \ --role "Reader" \ --scope "/providers/Microsoft.Management/managementGroups/$MANAGEMENT_GROUP_ID"
Via Azure Portal:
- Go to Azure Portal β Management groups
- Select your management group (or "Tenant Root Group")
- Click "Access control (IAM)"
- Click "Add" β "Add role assignment"
- Role: Reader
- Assign access to: User, group, or service principal
- Select your service principal (search by app name)
- Click "Save"
Option B: Grant Reader Role on Each Subscription
If you prefer to grant access per subscription:
SUBSCRIPTION_ID="your-subscription-id" SERVICE_PRINCIPAL_ID="your-service-principal-object-id" # Grant Reader role on subscription az role assignment create \ --assignee $SERVICE_PRINCIPAL_ID \ --role "Reader" \ --scope "/subscriptions/$SUBSCRIPTION_ID"
Via Azure Portal:
- Go to Azure Portal β Subscriptions
- Select your subscription
- Click "Access control (IAM)"
- Click "Add" β "Add role assignment"
- Role: Reader
- Assign access to: User, group, or service principal
- Select your service principal
- Click "Save"
- Repeat for each subscription you want to access
-
Grant VM and Storage Permissions:
For VM management, grant Virtual Machine Contributor role:
SUBSCRIPTION_ID="your-subscription-id" SERVICE_PRINCIPAL_ID="your-service-principal-object-id" # Grant VM Contributor role az role assignment create \ --assignee $SERVICE_PRINCIPAL_ID \ --role "Virtual Machine Contributor" \ --scope "/subscriptions/$SUBSCRIPTION_ID" # Grant Storage Account Contributor role az role assignment create \ --assignee $SERVICE_PRINCIPAL_ID \ --role "Storage Account Contributor" \ --scope "/subscriptions/$SUBSCRIPTION_ID"
Via Azure Portal:
- Go to Subscription β Access control (IAM)
- Add role assignment:
- Virtual Machine Contributor (for VM start/stop/delete)
- Storage Account Contributor (for storage account management)
- Assign to your service principal
-
Configure Environment Variables:
export AZURE_TENANT_ID=your_tenant_id export AZURE_CLIENT_ID=your_client_id export AZURE_CLIENT_SECRET=your_client_secret # Optional: Set AZURE_SUBSCRIPTION_ID as fallback if subscription listing fails export AZURE_SUBSCRIPTION_ID=your_subscription_id
-
Verify Setup:
- Start the application:
make dev - Check logs for:
[INFO] Azure Resource Manager service initialized successfully - Navigate to "Azure VMs" or "Azure Storage" tabs
- If subscriptions list is empty, the system will use
AZURE_SUBSCRIPTION_IDas fallback
- Start the application:
Troubleshooting:
- Empty subscriptions list: If you see
[WARNING] No subscriptions found, the service principal doesn't have permission to list subscriptions. Either:- Grant Reader role at Management Group/Tenant Root level (Option A above), OR
- Set
AZURE_SUBSCRIPTION_IDenvironment variable as a fallback
- Permission denied errors: Ensure the service principal has the required roles (Reader, Virtual Machine Contributor, Storage Account Contributor) on the subscriptions you want to access
make help- Show all available targetsmake build-frontend- Build Vue.js frontendmake build-backend- Build Go backend servermake build-cli- Build Go CLI applicationmake dev- Run Docker development environment
make deploy-user- Deploy IAM user and resourcesmake remove-user- Remove IAM user and resourcesmake create-role- Create IAM role for cross-account accessmake remove-role- Remove IAM role and resourcesmake deploy-stackset- Deploy StackSet for organization setupmake status-stackset- Show StackSet deployment statusmake delete-stackset- Delete StackSet and all instancesmake cli-status- Show current deployment status
make check-aws-config- Verify AWS credentials and configuration
make test- Run all testsmake lint- Lint all codemake check- Run all checks (fmt + lint + test)
The CLI deployment script creates an IAM user with these managed policies:
IAMFullAccess- For IAM user managementCloudFormationFullAccess- For StackSet operationsAWSOrganizationsReadOnlyAccess- For organization account discovery
If you prefer minimal permissions, create a custom policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "OrganizationsAccess",
"Effect": "Allow",
"Action": [
"organizations:ListAccounts",
"organizations:DescribeOrganization"
],
"Resource": "*"
},
{
"Sid": "AssumeRolePermissions",
"Effect": "Allow",
"Action": [
"sts:AssumeRole",
"sts:GetCallerIdentity"
],
"Resource": "*"
},
{
"Sid": "StackSetPermissions",
"Effect": "Allow",
"Action": [
"cloudformation:CreateStackSet",
"cloudformation:UpdateStackSet",
"cloudformation:DeleteStackSet",
"cloudformation:DescribeStackSet",
"cloudformation:ListStackSets",
"cloudformation:CreateStackInstances",
"cloudformation:DeleteStackInstances",
"cloudformation:DescribeStackInstance",
"cloudformation:ListStackInstances",
"cloudformation:DescribeStackSetOperation",
"cloudformation:ListStackSetOperations"
],
"Resource": "*"
}
]
}- Start the application:
make dev - Open browser:
http://localhost:8080 - Navigate to StackSet tab
- Validate permissions and deploy with one click
The StackSet creates in each target account:
- IAM Role:
IAMManagerCrossAccountRole - Permissions: Full IAM access for user management operations
- Trust Policy: Allows your master account user to assume the role
- External ID: Account-specific external ID for security (
{AccountId}-iam-manager) - Security: Built-in protection against confused deputy attacks
# Deploy StackSet to all organization accounts
make deploy-stackset
# Check deployment status
make status-stackset
# Get detailed status information
make cli-status
# Delete StackSet and all instances
make delete-stacksetGET /api/accounts- List organization accountsGET /api/accounts/:accountId/users- List users in accountGET /api/accounts/:accountId/users/:username- Get user detailsPOST /api/accounts/:accountId/users/:username/keys- Create access keyDELETE /api/accounts/:accountId/users/:username/keys/:keyId- Delete access keyPUT /api/accounts/:accountId/users/:username/keys/:keyId/rotate- Rotate access key
GET /api/security-groups- List security groups across all accountsGET /api/accounts/:accountId/security-groups- List security groups by accountGET /api/accounts/:accountId/regions/:region/security-groups/:groupId- Get security group detailsDELETE /api/accounts/:accountId/regions/:region/security-groups/:groupId- Delete security group
GET /api/stackset/status- Get StackSet deployment statusPOST /api/stackset/deploy- Deploy/update StackSet to all accountsGET /api/stackset/deployment/:operationId- Get deployment operation statusDELETE /api/stackset/- Delete StackSet and all instancesGET /api/stackset/validate- Validate StackSet deployment permissions
GET /api/azure/enterprise-applications- List all Azure AD enterprise applicationsGET /api/azure/enterprise-applications/:appId- Get enterprise application detailsDELETE /api/azure/enterprise-applications/:appId- Delete enterprise applicationPOST /api/azure/cache/clear- Clear all Azure cachePOST /api/azure/cache/enterprise-applications/invalidate- Invalidate enterprise applications cache
GET /api/azure/vms- List all Azure virtual machinesGET /api/azure/vms/:resourceGroup/:vmName- Get VM detailsPOST /api/azure/vms/:resourceGroup/:vmName/start- Start VMPOST /api/azure/vms/:resourceGroup/:vmName/stop- Stop VMDELETE /api/azure/vms/:resourceGroup/:vmName- Delete VMGET /api/azure/storage-accounts- List all storage accountsGET /api/azure/storage-accounts/:resourceGroup/:name- Get storage account detailsDELETE /api/azure/storage-accounts/:resourceGroup/:name- Delete storage accountPOST /api/azure/rm/cache/clear- Clear all Azure RM cachePOST /api/azure/rm/cache/vms/invalidate- Invalidate VMs cachePOST /api/azure/rm/cache/storage/invalidate- Invalidate storage cache
- Go 1.21+
- Node.js 18+ (for frontend development)
- AWS CLI configured
- Docker & Docker Compose
make build-backend
cd backend && go run ./cmd/servermake dev-frontend
# Runs on http://localhost:5173 with API proxy to :8080make dev
# Builds everything and runs with Docker Compose# Run all tests
make test
# Run with coverage
make test-coverage
# Lint code
make lint
# Run all checks
make check- Access Keys: Only displayed once when created/rotated
- IAM Permissions: All operations require proper AWS permissions
- Temporary Credentials: Uses temporary credentials when assuming roles
- External ID: Prevents confused deputy attacks
- Audit Trail: All operations logged in CloudTrail
- Frontend Security: Served by Go eliminates Node.js attack surface
- HTTPS Ready: Built-in support for TLS termination
AWS Credentials Not Configured
make check-aws-configPermission Denied
# Check if your user has required permissions
aws sts get-caller-identity
aws organizations list-accountsStackSet Deployment Fails
# Check StackSet status
make status-stackset
# View detailed logs
make logsContainer Won't Start
# Check container logs
docker-compose logs cloud-manager
# Rebuild containers
make clean
make rebuildAzure Features Not Available
# Check if Azure credentials are set
grep -E "AZURE_TENANT_ID|AZURE_CLIENT_ID|AZURE_CLIENT_SECRET" .env.prod
# If missing, add them to .env.prod:
# AZURE_TENANT_ID=your_tenant_id
# AZURE_CLIENT_ID=your_client_id
# AZURE_CLIENT_SECRET=your_client_secret
# Restart the application
make dev-stop
make dev
# Check logs for Azure initialization
make dev-logs | grep -i azureAzure Error: "Application not found in the directory" (AADSTS700016) This error means the app registration doesn't exist in the specified tenant. To fix:
-
Verify Tenant ID:
- Go to Azure Portal β Azure Active Directory β Overview
- Copy the "Tenant ID" (should match
AZURE_TENANT_ID)
-
Verify Client ID:
- Go to Azure Portal β Azure Active Directory β App registrations
- Find your app registration
- Copy the "Application (client) ID" (should match
AZURE_CLIENT_ID) - Important: Make sure the app registration exists in the same tenant as the Tenant ID
-
Check Tenant Match:
- The Tenant ID and Client ID must be from the same Azure AD tenant
- If you have multiple tenants, ensure you're using the correct pair
-
Verify App Registration:
- Ensure the app registration exists in the tenant
- Check that it hasn't been deleted or moved to another tenant
-
Update Credentials:
# Edit .env.prod with correct values nano .env.prod # Restart the application make dev-stop make dev
Azure Error: "unauthorized_client" or Authentication Failed This usually means:
- Client Secret is incorrect or expired (create a new one)
- API permissions not granted (grant admin consent)
- App registration doesn't have required permissions
- CloudFormation Template - StackSet deployment template
- Contributing Guidelines - Development and contribution guide
- Environment Variables - Configuration options
- Fork the repository
- Create a feature branch
- Run tests:
make check - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: This README and inline code documentation
Made with β€οΈ for Cloud Management - Simplifying multi-cloud resource management