Skip to content

[ AutoFiC ] Security Patch 2025-07-30 #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions callautomation-live-transcription/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { config } from 'dotenv';
import express, { Application } from 'express';
import http from 'http';
import helmet from 'helmet'; // Import helmet for security headers
import { PhoneNumberIdentifier, createIdentifierFromRawId } from "@azure/communication-common";
import {
CallAutomationClient, CallConnection, AnswerCallOptions, CallMedia,
Expand All @@ -21,6 +22,7 @@ config();
const PORT = process.env.PORT;
const app: Application = express();
app.use(express.json());
app.use(helmet()); // Use helmet to secure Express app by setting various HTTP headers

// Create common server for app and websocket
const server = http.createServer(app);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

require('dotenv').config({path: __dirname + '/.env' })
const { CommunicationIdentityClient } = require('@azure/communication-identity');
const { PublicClientApplication, CryptoProvider } = require('@azure/msal-node');
Expand Down Expand Up @@ -80,8 +79,8 @@ app.get('/redirect', async (req, res) => {
res.sendStatus(200);
}).catch((error) => {
console.log(error);
res.status(500).send(error);
res.status(500).send('An error occurred while processing your request.');
});
});

app.listen(SERVER_PORT, () => console.log(`Communication access token application started on ${SERVER_PORT}!`))
app.listen(SERVER_PORT, () => console.log(`Communication access token application started on ${SERVER_PORT}!`))
10 changes: 10 additions & 0 deletions tpe-token-and-access-management/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@ const cors = require('cors');
const path = require('path');
const config = require('./config');
const TeamsExtensionAccessManager = require('./teams-extension-access-manager');
const helmet = require('helmet'); // Added Helmet for security headers
const rateLimit = require('express-rate-limit'); // Added rate limiting

const app = express();
const PORT = config.server.port;

// Middleware
app.use(helmet()); // Use Helmet to secure the app by setting various HTTP headers
app.use(cors());
app.use(express.json());
app.use(express.static(path.join(__dirname, '..', 'dist')));

// Rate limiting middleware
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100 // Limit each IP to 100 requests per windowMs
});
app.use(limiter); // Apply rate limiting to all requests

// Initialize manager
const accessManager = new TeamsExtensionAccessManager();

Expand Down