Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(prosody-plugins): document HTTP endpoints, require system key server

damencho20e41a142ed7
diff --git a/resources/prosody-plugins/mod_muc_census.lua b/resources/prosody-plugins/mod_muc_census.lua
index af113fa987..12e77c30b1 100644
--- a/resources/prosody-plugins/mod_muc_census.lua
+++ b/resources/prosody-plugins/mod_muc_census.lua
@@ -1,3 +1,11 @@
+-- USAGE / DEPLOYMENT
+-- This endpoint has no authentication. It is meant to be used only by
+-- server admins and trusted internal services (e.g. monitoring) over a
+-- controlled network path. It is NOT safe to make it publicly accessible:
+-- do not proxy it from the public web server (nginx) and do not expose
+-- Prosody's HTTP ports (5280/5281) to the internet. Restrict access at the
+-- web server or with network filters.
+--
-- provides an http endpoint at /room-census that reports list of rooms with the
-- number of members and created date in this JSON format:
--
diff --git a/resources/prosody-plugins/mod_muc_end_meeting.lua b/resources/prosody-plugins/mod_muc_end_meeting.lua
index e0325e9e18..14a97e60fe 100644
--- a/resources/prosody-plugins/mod_muc_end_meeting.lua
+++ b/resources/prosody-plugins/mod_muc_end_meeting.lua
@@ -1,3 +1,18 @@
+-- USAGE / DEPLOYMENT
+-- This is a server-to-server endpoint. It is meant to be called only by
+-- trusted backend services over a controlled network path (e.g. Prosody's
+-- HTTP port reachable only from internal hosts). It is NOT safe to make it
+-- publicly accessible: do not proxy it from the public web server (nginx)
+-- and do not expose Prosody's HTTP ports (5280/5281) to the internet.
+--
+-- The Bearer token is a system token signed with a dedicated key pair whose
+-- public keys are served from prosody_password_public_key_repo_url. That
+-- option must be set; the private key must only be available to the calling
+-- services. A valid system token authorizes the caller for every room on
+-- the deployment. It is intentionally not bound to a room: there is no
+-- room claim / room ownership check, the calling service is responsible
+-- for deciding which room it acts on.
+--
-- Global HTTP module that exposes a POST /end-meeting endpoint for terminating
-- MUC rooms via an authenticated API call. Intended for internal system use
-- (e.g. by a backend service), not for end-user clients.
@@ -41,6 +56,10 @@ local muc_domain_prefix = module:get_option_string('muc_mapper_domain_prefix', '
local muc_domain = muc_domain_prefix..'.'..muc_domain_base;
local asapKeyServer = module:get_option_string("prosody_password_public_key_repo_url", "");
+if asapKeyServer == "" then
+ module:log("warn", "No 'prosody_password_public_key_repo_url' option set, disabling end-meeting endpoint.");
+ return;
+end
local event_count = module:measure("muc_end_meeting_rate", "rate")
local event_count_success = module:measure("muc_end_meeting_success", "rate")
@@ -122,10 +141,8 @@ function module.add_host(host_module)
token_util = module:require "token/util".new(host_module);
- if asapKeyServer ~= "" then
- -- init token util with our asap keyserver
- token_util:set_asap_key_server(asapKeyServer)
- end
+ -- init token util with our asap keyserver
+ token_util:set_asap_key_server(asapKeyServer)
module:log("info", "Adding http handler for /end-meeting on %s", host_module.host);
host_module:depends("http");
diff --git a/resources/prosody-plugins/mod_muc_jigasi_invite.lua b/resources/prosody-plugins/mod_muc_jigasi_invite.lua
index 0c008b337e..9043fcc302 100644
--- a/resources/prosody-plugins/mod_muc_jigasi_invite.lua
+++ b/resources/prosody-plugins/mod_muc_jigasi_invite.lua
@@ -1,3 +1,18 @@
+-- USAGE / DEPLOYMENT
+-- This is a server-to-server endpoint. It is meant to be called only by
+-- trusted backend services over a controlled network path (e.g. Prosody's
+-- HTTP port reachable only from internal hosts). It is NOT safe to make it
+-- publicly accessible: do not proxy it from the public web server (nginx)
+-- and do not expose Prosody's HTTP ports (5280/5281) to the internet.
+--
+-- The Bearer token is a system token signed with a dedicated key pair whose
+-- public keys are served from prosody_password_public_key_repo_url. That
+-- option must be set; the private key must only be available to the calling
+-- services. A valid system token authorizes the caller for every room on
+-- the deployment. It is intentionally not bound to a room: there is no
+-- room claim / room ownership check, the calling service is responsible
+-- for deciding which room it acts on.
+--
-- HTTP module that exposes a POST /invite-jigasi endpoint for inviting a Jigasi
-- SIP gateway instance to dial out to a phone number and connect it to a
-- conference. Intended for internal system use (e.g. by a backend service),
@@ -55,10 +70,12 @@ local event_count = module:measure("muc_invite_jigasi_rate", "rate")
local event_count_success = module:measure("muc_invite_jigasi_success", "rate")
local ASAP_KEY_SERVER = module:get_option_string("prosody_password_public_key_repo_url", "");
local token_util = module:require "token/util".new(module);
-if ASAP_KEY_SERVER then
- -- init token util with our asap keyserver
- token_util:set_asap_key_server(ASAP_KEY_SERVER)
+if ASAP_KEY_SERVER == "" then
+ module:log("warn", "No 'prosody_password_public_key_repo_url' option set, disabling invite-jigasi endpoint.");
+ return;
end
+-- init token util with our asap keyserver
+token_util:set_asap_key_server(ASAP_KEY_SERVER)
local function invite_jigasi(conference, phone_no)
local jigasi_brewery_room = main_muc_service.get_room_from_jid(jigasi_brewery_room_jid);
diff --git a/resources/prosody-plugins/mod_muc_kick_participant.lua b/resources/prosody-plugins/mod_muc_kick_participant.lua
index e4c3b665e2..0638ce4c2b 100644
--- a/resources/prosody-plugins/mod_muc_kick_participant.lua
+++ b/resources/prosody-plugins/mod_muc_kick_participant.lua
@@ -1,3 +1,18 @@
+-- USAGE / DEPLOYMENT
+-- This is a server-to-server endpoint. It is meant to be called only by
+-- trusted backend services over a controlled network path (e.g. Prosody's
+-- HTTP port reachable only from internal hosts). It is NOT safe to make it
+-- publicly accessible: do not proxy it from the public web server (nginx)
+-- and do not expose Prosody's HTTP ports (5280/5281) to the internet.
+--
+-- The Bearer token is a system token signed with a dedicated key pair whose
+-- public keys are served from prosody_password_public_key_repo_url. That
+-- option must be set; the private key must only be available to the calling
+-- services. A valid system token authorizes the caller for every room on
+-- the deployment. It is intentionally not bound to a room: there is no
+-- room claim / room ownership check, the calling service is responsible
+-- for deciding which room it acts on.
+--
-- HTTP module that exposes a PUT /kick-participant endpoint for removing a
-- specific participant from a MUC room via an authenticated API call.
-- Intended for internal system use (e.g. by a backend service), not for
diff --git a/resources/prosody-plugins/mod_muc_password_check.lua b/resources/prosody-plugins/mod_muc_password_check.lua
index 70db88a84d..17587ac005 100644
--- a/resources/prosody-plugins/mod_muc_password_check.lua
+++ b/resources/prosody-plugins/mod_muc_password_check.lua
@@ -1,3 +1,24 @@
+-- USAGE / DEPLOYMENT
+-- This is a server-to-server endpoint used by the Jigasi dial-in IVR
+-- (dialplan) to check whether a room is passcode protected and to validate
+-- the passcode entered by the caller. The dialplan runs outside the shard,
+-- so the endpoint is reachable through the web server (/_api/room-info in
+-- the example nginx config), which routes the request to the shard hosting
+-- the room.
+--
+-- The module must be enabled on a dedicated VirtualHost with its own token
+-- configuration, not on the main virtual host, see jaas.cfg.lua
+-- (VirtualHost "jigasi.meet.jitsi"): tokens are verified with that host's
+-- asap_key_server / asap_accepted_issuers / asap_accepted_audiences, so
+-- login tokens of the main virtual host are not accepted. Only the dial-in
+-- service holds the private key for those tokens. A valid token authorizes
+-- the caller for every room on the deployment. It is intentionally not
+-- bound to a room: there is no room claim check.
+--
+-- Enabling the module on the main virtual host, or disabling
+-- enable_password_token_verification, makes the endpoint accept any
+-- login token (or no token), so it must not then be publicly accessible.
+--
-- HTTP module that exposes GET and PUT endpoints at /room-info for querying
-- and validating MUC room password information.
--
diff --git a/resources/prosody-plugins/mod_muc_size.lua b/resources/prosody-plugins/mod_muc_size.lua
index 1bbdcd4f6b..0c90bc9a11 100644
--- a/resources/prosody-plugins/mod_muc_size.lua
+++ b/resources/prosody-plugins/mod_muc_size.lua
@@ -1,3 +1,17 @@
+-- USAGE / DEPLOYMENT
+-- These endpoints are meant to be used by trusted internal services (e.g.
+-- monitoring, backend services checking room occupancy) over a controlled
+-- network path. By default (enable_roomsize_token_verification = false)
+-- they have no authentication, and GET /sessions never has any. In that
+-- configuration it is NOT safe to make them publicly accessible: do not
+-- proxy them from the public web server (nginx) and do not expose Prosody's
+-- HTTP ports (5280/5281) to the internet. Restrict access at the web server
+-- or with network filters.
+--
+-- When enable_roomsize_token_verification is true, /room-size and /room
+-- require a token issued by this deployment (the virtual host token
+-- configuration) that is valid for the requested room.
+--
-- Prosody IM
-- Copyright (C) 2021-present 8x8, Inc.
--
diff --git a/resources/prosody-plugins/mod_system_chat_message.lua b/resources/prosody-plugins/mod_system_chat_message.lua
index 8734331e62..2fb4d5bb56 100644
--- a/resources/prosody-plugins/mod_system_chat_message.lua
+++ b/resources/prosody-plugins/mod_system_chat_message.lua
@@ -1,3 +1,18 @@
+-- USAGE / DEPLOYMENT
+-- This is a server-to-server endpoint. It is meant to be called only by
+-- trusted backend services over a controlled network path (e.g. Prosody's
+-- HTTP port reachable only from internal hosts). It is NOT safe to make it
+-- publicly accessible: do not proxy it from the public web server (nginx)
+-- and do not expose Prosody's HTTP ports (5280/5281) to the internet.
+--
+-- The Bearer token is a system token signed with a dedicated key pair whose
+-- public keys are served from prosody_password_public_key_repo_url. That
+-- option must be set; the private key must only be available to the calling
+-- services. A valid system token authorizes the caller for every room on
+-- the deployment. It is intentionally not bound to a room: there is no
+-- room claim / room ownership check, the calling service is responsible
+-- for deciding which room it acts on.
+--
-- HTTP module that exposes a POST /send-system-chat-message endpoint for
-- delivering private system chat messages to specific participants in a MUC
-- room. Intended for internal system use (e.g. by a backend service), not for
@@ -45,10 +60,12 @@ local json = require "cjson.safe";
local asapKeyServer = module:get_option_string("prosody_password_public_key_repo_url", "");
-if asapKeyServer then
- -- init token util with our asap keyserver
- token_util:set_asap_key_server(asapKeyServer)
+if asapKeyServer == "" then
+ module:log("warn", "No 'prosody_password_public_key_repo_url' option set, disabling send-system-chat-message endpoint.");
+ return;
end
+-- init token util with our asap keyserver
+token_util:set_asap_key_server(asapKeyServer)
function verify_token(token)
if token == nil then
diff --git a/resources/prosody-plugins/mod_turncredentials_http.lua b/resources/prosody-plugins/mod_turncredentials_http.lua
index 1aaef2ec45..bb40953829 100644
--- a/resources/prosody-plugins/mod_turncredentials_http.lua
+++ b/resources/prosody-plugins/mod_turncredentials_http.lua
@@ -1,3 +1,11 @@
+-- USAGE / DEPLOYMENT
+-- This endpoint has no authentication and returns the TURN credentials
+-- configured in external_services. It is meant to be used only by trusted
+-- internal services over a controlled network path. It is NOT safe to make
+-- it publicly accessible: do not proxy it from the public web server
+-- (nginx) and do not expose Prosody's HTTP ports (5280/5281) to the
+-- internet. Restrict access at the web server or with network filters.
+--
-- http endpoint to expose turn credentials for other services
-- Copyright (C) 2023-present 8x8, Inc.