acl: Add ACL support to http and ari

Add uri prefix based acl support to the built in http server.
This allows an acl to be added per uri prefix (ie '/metrics'
or '/ws') to restrict access.

Add user based acl support for ARI. This adds new acl options
to the user section of ari.conf to restrict access on a per
user basis.

resolves: #1799

UserNote: A new section, type=restriction has been added to http.conf
to allow an uri prefix based acl to be configured. See
http.conf.sample for examples and more information.
The user section of ari.conf can now contain an acl configuration
to restrict users access. See ari.conf.sample for examples and more
information
This commit is contained in:
Mike Bradeen
2026-03-05 12:52:43 +00:00
committed by github-actions[bot]
parent 31666e4039
commit 46292c9a45
8 changed files with 271 additions and 6 deletions
+38
View File
@@ -130,3 +130,41 @@ bindaddr=127.0.0.1
; POST URL: /asterisk/uploads will put files in /var/lib/asterisk/uploads/.
;uploads = /var/lib/asterisk/uploads/
;
;[uripath]
;
;type = restriction ; Specifies acl configuration
;
; The following options (permit, deny, acl) allow for an acl to be configured
; on a per uri prefix basis. The first character should be an '/'
;
; The format follows the rules as documented in acl.conf.sample
;
; If no restriction is defined for a given prefix, legacy behavior will apply.
;
; If multiple restrictions apply, any restriction that denies will supersede
; any another restrictions that permit. For example if an /ari restriction
; results in a deny, but an /ari/channels restriction would permit, the
; attempt would still be denied.
;
;deny = ; Deny the subnet access for the given user
;permit = ; Permit the subnet(s) access for the given user
;acl = ; Optional name for the acl.
;
;Examples:
;
; Only allow ari connections from localhost:
;
;[/ari]
;type = restriction
;deny = 0.0.0.0/0
;permit = 127.0.0.1
;acl = localarionly
;
; Only allow metrics to be gathered by 10.0.0.23
;
;[/metrics]
;type = restriction
;deny = 0.0.0.0/0
;permit = 10.0.0.23
;