fluent-plugin-ldap-client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +27 -5
- data/lib/fluent/plugin/filter_ldap_enrich.rb +3 -3
- data/lib/fluent/plugin/ldap_client/ldap_client.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '02008dd36f192c816c8119fde2a5e538ac6658c2d16d3218fa18a7db15a5b77b'
|
4
|
+
data.tar.gz: bfb8878bb5986b9f2c0f27277790375469fc002a842794552ab1da05aa57c9c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf9696b01bd689306df637c1b768135221a849151ef836cab83852a127a918129eb13422eb2e3ff3d5d265b10779a2be66c6304cb5f837a100c292f634597a3
|
7
|
+
data.tar.gz: e4e3b6ecd42aa88b59275cf40098821a0f48bb64a407fd59c55e8695a931a65c724b6451cbcd8fe36bba9e7005e71249d5cec5a33d7b1e5a50a2c268dfebe356
|
data/README.md
CHANGED
@@ -12,18 +12,40 @@ To do enrichment on events through ldap search.
|
|
12
12
|
|
13
13
|
Parameters are :
|
14
14
|
|
15
|
-
| parameters
|
16
|
-
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
| parameters | default | type | purpose |
|
16
|
+
|--------------------|-----------|----------|-------------------------------------------------------------------|
|
17
|
+
| ldap_host | localhost | string | ldap hostname |
|
18
|
+
| ldap_port | 389 | integer | ldap port |
|
19
|
+
| ldap_encryption | false | bool | use tls |
|
20
|
+
| ldap_base_dn | '' | string | ldap base DN for query |
|
21
|
+
| ldap_username | nil | string | username for ldap bind |
|
22
|
+
| ldap_password | nil | string | password for ldap bind |
|
23
|
+
| ldap_ca_cert | nil | string | path of CA cert for ldap connection |
|
24
|
+
| ldap_query | nil | string | query that will be interpolated against record, then sent to ldap |
|
25
|
+
| ldap_attributes | {} | hash | mapping of ldap attributes to inject in record |
|
26
|
+
| enable_cache | true | bool | enable cache to reduce query to ldap |
|
27
|
+
| cache_size | 1000 | interger | cache size in number of entries |
|
28
|
+
| cache_ttl_positive | 24 * 3600 | integer | ttl of positive entries (not nil) in seconds |
|
29
|
+
| cache_ttl_negative | 3600 | integer | ttl of negative entries (nil) in seconds |
|
20
30
|
|
21
31
|
### examples
|
22
32
|
|
23
33
|
``` text
|
34
|
+
<filter test>
|
35
|
+
@type ldap_enrich
|
24
36
|
|
37
|
+
ldap_base_dn "dc=test"
|
38
|
+
ldap_query "(uid=%{user})"
|
39
|
+
ldap_attributes uid:user_uid,mail:user_mail
|
40
|
+
|
41
|
+
cache_enable true
|
42
|
+
</filter>
|
25
43
|
```
|
26
44
|
|
45
|
+
* use "dc=test" as ldap search base DN
|
46
|
+
* ldap_query will be interpolated, with %{user} replaced by record['user'], then send the query to ldap
|
47
|
+
* ldap_attributes will inject uid attributes as user_uid in record, will inject mail attributes as user_mail in record
|
48
|
+
|
27
49
|
## Installation
|
28
50
|
|
29
51
|
Manual install, by executing:
|
@@ -49,8 +49,8 @@ module Fluent
|
|
49
49
|
desc 'ldap password'
|
50
50
|
config_param :ldap_password, :string, default: DEFAULT_LDAP_PASSWORD, secret: true
|
51
51
|
|
52
|
-
desc 'CA cert'
|
53
|
-
config_param :
|
52
|
+
desc 'ldap CA cert'
|
53
|
+
config_param :ldap_ca_cert, :string, default: nil
|
54
54
|
|
55
55
|
DEFAULT_LDAP_ATTRIBUTES = {}.freeze
|
56
56
|
|
@@ -92,7 +92,7 @@ module Fluent
|
|
92
92
|
username: ldap_username,
|
93
93
|
password: ldap_password,
|
94
94
|
encryption: ldap_encryption,
|
95
|
-
ca_cert:
|
95
|
+
ca_cert: ldap_ca_cert,
|
96
96
|
log: log
|
97
97
|
)
|
98
98
|
|
@@ -54,7 +54,7 @@ module Fluent
|
|
54
54
|
return unless encryption
|
55
55
|
|
56
56
|
{ method: :simple_tls,
|
57
|
-
tls_options: { ca_file:
|
57
|
+
tls_options: { ca_file: ca_cert } }
|
58
58
|
end
|
59
59
|
|
60
60
|
def search_query(query)
|
@@ -69,7 +69,7 @@ module Fluent
|
|
69
69
|
|
70
70
|
def search_filter(filter)
|
71
71
|
result = ldap.search(base: base_dn, filter: filter)
|
72
|
-
log&.debug "LDAP Client: No LDAP results for
|
72
|
+
log&.debug "LDAP Client: No LDAP results for filter \"#{filter}\"" if result.nil? || result.empty?
|
73
73
|
|
74
74
|
result&.first&.to_h
|
75
75
|
rescue StandardError => e
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-ldap-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Tych
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-24 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bump
|