Skip to content

Commit

Permalink
Add config option details to README. Bump version to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elonen committed Feb 22, 2023
1 parent 3696d22 commit 370145b
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ldap_authz_proxy"
version = "0.2.1"
version = "0.3.0"
edition = "2021"

description = "LDAP authorization proxy for authenticated HTTP users"
Expand Down
121 changes: 121 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,127 @@ The VM running Nginx (and ldap_authz_proxy) was joined to AD domain like this:
Script(s) for building Nginx Kerberos (SPNEGO) module for Debian:
https://github.com/elonen/debian-nginx-spnego

## Config option details

Configuration options (generated by `ldap_authz_proxy --help-config`):

```
http_path [default: '']
Regular expression to match the HTTP path against (e.g. '^/api/v1/.*').
Never matched if empty. If you need to match all paths, use '^'.
If multiple sections match, the first one is used.
username_http_header [default: 'X-Ldap-Authz-Username']
HTTP header to use for the username
ldap_server_url [REQUIRED]
URL of the LDAP server (e.g. 'ldaps://ldap.example.com:636')
ldap_conn_timeout [default: '10.0']
LDAP connection timeout in seconds
ldap_bind_dn [REQUIRED]
DN of the LDAP user to bind as (e.g. 'CN=proxyuser,OU=users,DC=example,DC=com')
ldap_bind_password [REQUIRED]
Password of the LDAP user to bind as
ldap_search_base [REQUIRED]
LDAP base DN to search in (e.g. 'OU=users,DC=example,DC=com')
ldap_scope [default: 'subtree']
LDAP search scope. Must be 'subtree', 'onelevel' or 'base')
ldap_query [REQUIRED]
LDAP query to use. May contain '%USERNAME%', which will be quoted and replaced.
Example: '(&(objectClass=person)(sAMAccountName=%USERNAME%))
ldap_attribs [default: 'CN']
LDAP attributes to return (e.g. 'displayName, givenName, sn, mail'). Must not be empty.
query_vars [default: '']
Extra variables to use in the query, in addition to %USERNAME%.
You can use these to avoid repeating long query strings in different sections.
Example: 'MY_GROUP_NAME=group1, MY_USER_ATTRIB=sAMAccountName'
...would turn '(&(objectClass=person)(%MY_USER_ATTRIB%=%USERNAME%)(memberOf=%MY_GROUP_NAME%))'
into '(&(objectClass=person)(sAMAccountName=%USERNAME%)(memberOf=group1))'
cache_size [default: '512']
Maximum number of entries to cache (per section)
cache_time [default: '30.0']
Maximum age of entries in the cache (in seconds)
attrib_delimiter [default: ';']
Delimiter to use when concatenating multiple values of an attribute
deduplicate_attribs [default: 'true']
Whether to deduplicate attribute values.
Example: 'someAttr=foo,bar,foo,foo' becomes 'someAttr=foo,bar')
set_attribs_on_success [default: '']
Attributes to set manually if the main query succeeds.
If empty, only the attributes returned by LDAP queries are set.
Format: 'attribute=value1, attribute=value2, attribute2= ...'
sub_queries [default: '']
Section names of optional sub-queries.'.
Sub-queries can check for additional conditions and/or set additional attributes.
See also 'sub_query_join for details.
Recursions and duplicates are removed.
Sub-queries are cached in the same way as the main query, and
caching is hierarchical: if main query is cached, sub-queries are not executed.
Format: 'extra_section_1, extra_section_2'
sub_query_join [default: 'Main']
How sub-queries affect authorization.
Regardless of this, if any sub-query throws an LDAP error, the request is NOT authorized.
Possible values:
- 'Any': If main query or any sub-queries returns non-empty, request is authorized.
- 'All': All sub-queries must return non-empty, otherwise request is NOT authorized.
- 'Main': If main query authorizes, use sub-requests to add attributes.
```

## Development

Probably the easiest way to develop this is to:
Expand Down
15 changes: 15 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
ldap_authz_proxy (0.3.0-1) unstable; urgency=low

* Rename some config options for clarity, add a few new ones
* Security: redact bind passwords from logs
* New features:
- Support for LDAP sub-queries
- Support for custom variables in LDAP queries (for shorter config)
- Support for adding static attributes per section
- Built-in help for config options
- Config file dump option for debugging
- Support quoting in config file
- Configurable attribute delimiter in response headers

-- Jarno Elonen <[email protected]> Tue, 22 Feb 2023 23:14:00 +0000

ldap_authz_proxy (0.2.1-1) unstable; urgency=low

* Slightly optimize RAM use
Expand Down

0 comments on commit 370145b

Please sign in to comment.