Emmanuel BENOîT
91be691ea4
This is a Go program which can synchronize Graylog 4 roles and access privileges to dashboards and streams from a LDAP directory, based on a YAML configuration file that maps LDAP groups to Graylog privileges. The code is rather ugly, some features are half-baked (LDAP TLS support, impossible to disable HTTP TLS checks, bad error handling...) and some documentation needs to be added but it's a start.
35 lines
725 B
Text
35 lines
725 B
Text
ldap:
|
|
host: ldap.example.org
|
|
port: 636
|
|
tls: yes # or no / starttls
|
|
cachain: /path/to/ca/chain.pem
|
|
#bind_user:
|
|
#bind_password:
|
|
member_fields:
|
|
- member
|
|
- uniqueMember
|
|
- memberUid
|
|
graylog:
|
|
api_base: https://graylog.example.org/api
|
|
username: admin
|
|
password: drowssap
|
|
delete_accounts: false
|
|
mapping:
|
|
cn=g1,ou=groups,dc=example,dc=org:
|
|
roles:
|
|
- Reader
|
|
privileges:
|
|
- type: dashboard
|
|
id: 12345
|
|
level: read
|
|
- type: stream
|
|
id: 12345
|
|
level: read
|
|
cn=g2,ou=groups,dc=example,dc=org:
|
|
roles:
|
|
- Event Definition Creator
|
|
- Event Notification Creator
|
|
privileges:
|
|
- type: dashboard
|
|
id: 12345
|
|
level: write
|