Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
# syntax=docker/dockerfile:1
FROM node:lts-alpine
WORKDIR /app

# Copy package files and install production dependencies
COPY src/mcp/package.json src/mcp/package-lock.json ./
RUN npm install --production --ignore-scripts

# Copy built server files
COPY src/mcp/build ./build

# Ensure executable permissions
RUN chmod +x build/main.js

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For enhanced security, it's a best practice to run applications inside Docker containers as a non-root user. This can help mitigate potential vulnerabilities if the application process is compromised.

Could we consider creating a dedicated, unprivileged user for running the application? This typically involves:

  1. Adding a new group and user.
  2. Changing ownership of the application files to this new user.
  3. Switching to this user with the USER instruction before the ENTRYPOINT or CMD.

What are your thoughts on incorporating this approach?

# Create a non-root user and group
RUN addgroup -S appgroup && adduser -S -G appgroup appuser

# Change ownership of the app directory to the new user
# This ensures the non-root user can read/execute necessary files.
RUN chown -R appuser:appgroup /app

# Switch to the non-root user
USER appuser

# Default command
ENTRYPOINT ["node", "build/main.js"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Lokka

[![smithery badge](https://smithery.io/badge/@merill/lokka)](https://smithery.io/protocol/@merill/lokka)
[![npm version](https://badge.fury.io/js/@merill%2Flokka.svg)](https://badge.fury.io/js/@merill%2Flokka)

Lokka is a model-context-protocol server for the Microsoft Graph and Azure RM APIs that allows you to query and managing your Azure and Microsoft 365 tenants with AI.
Expand Down
29 changes: 29 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Smithery configuration file: https://smithery.ai/docs/build/project-config

startCommand:
type: stdio
commandFunction:
# A JS function that produces the CLI command based on the given config to start the MCP on stdio.
|-
(config) => ({command: 'node', args: ['build/main.js'], env: {TENANT_ID: config.tenantId, CLIENT_ID: config.clientId, CLIENT_SECRET: config.clientSecret}})
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- tenantId
- clientId
- clientSecret
properties:
tenantId:
type: string
description: The ID of the Microsoft Entra tenant.
clientId:
type: string
description: The ID of the application registered in Microsoft Entra.
clientSecret:
type: string
description: The client secret of the application registered in Microsoft Entra.
exampleConfig:
tenantId: 00000000-0000-0000-0000-000000000000
clientId: 11111111-1111-1111-1111-111111111111
clientSecret: your-client-secret