Compare commits

...

5 commits
master ... logs

Author SHA1 Message Date
761df9d0b3 Add opendistro_common for OpenDistro repository
Some checks failed
continuous-integration/drone/push Build is failing
2021-03-03 21:45:56 +01:00
d9fe57481a Add elastic_common role for Elastic repository 2021-03-03 21:45:17 +01:00
bd5b2e1fbe Add apt_common role for third party repositories 2021-03-03 21:44:37 +01:00
84b3407b34 Add elastic.adm.auro.re 2021-03-03 21:43:23 +01:00
7ada2fe769 WIP: add a role for ulogd2
Some checks failed
continuous-integration/drone/push Build is failing
2021-03-03 03:02:53 +01:00
12 changed files with 232 additions and 0 deletions

1
hosts
View file

@ -38,6 +38,7 @@ prometheus-aurore.adm.auro.re
portail.adm.auro.re
jitsi-aurore.adm.auro.re
log.adm.auro.re
elastic.adm.auro.re
[aurore_testing_vm]
pendragon.adm.auro.re

View file

@ -0,0 +1,19 @@
---
- name: Install GnuPG (to manage the APT keystore)
become: true
apt:
name: gnupg2
state: latest
- name: Install common CA certificates
become: true
apt:
name: ca-certificates
state: latest
- name: Ensure that APT can use HTTPS repositories
become: true
apt:
name: apt-transport-https
state: latest
...

View file

@ -0,0 +1,31 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux)
mQENBFI3HsoBCADXDtbNJnxbPqB1vDNtCsqhe49vFYsZN9IOZsZXgp7aHjh6CJBD
A+bGFOwyhbd7at35jQjWAw1O3cfYsKAmFy+Ar3LHCMkV3oZspJACTIgCrwnkic/9
CUliQe324qvObU2QRtP4Fl0zWcfb/S8UYzWXWIFuJqMvE9MaRY1bwUBvzoqavLGZ
j3SF1SPO+TB5QrHkrQHBsmX+Jda6d4Ylt8/t6CvMwgQNlrlzIO9WT+YN6zS+sqHd
1YK/aY5qhoLNhp9G/HxhcSVCkLq8SStj1ZZ1S9juBPoXV1ZWNbxFNGwOh/NYGldD
2kmBf3YgCqeLzHahsAEpvAm8TBa7Q9W21C8vABEBAAG0RUVsYXN0aWNzZWFyY2gg
KEVsYXN0aWNz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EyUJ8SKsaHh4jV9wp9KmC8C+9CwMukL7
vM5w8cgvJoAwsp3Fn59AxWthN3XJYcnMfStkIuWgR7U2r+a210W6vnUxU4oN0PmM
cursYPyeV0NX/KQeUeNMwGTFB6QHS/anRaGQewijkrYYoTNtfllxIu9XYmiBERQ/
qPDlGRlOgVTd9xUfHFkzB52c70E=
=92oX
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -0,0 +1,4 @@
---
dependencies:
- role: apt_common
...

View file

@ -0,0 +1,20 @@
---
- name: Trust Elastic GPG key
become: true
apt_key:
data: "{{ lookup('file', 'elastic.gpg') }}"
state: present
- name: Install Elastic OSS repository
become: true
apt_repository:
repo: deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main
state: present
filename: elastic-oss-7
- name: Install default JRE
become: true
apt:
name: default-jre-headless
state: latest
...

View file

@ -0,0 +1,53 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFxxbjoBEACzaNq4JNShPtxbESNK4Ihtj83FOJFPxZmr4v3OQY7YRxGeIuyT
KeC1Epx5qOgWZ+H8EBpRp+QBZ80cQq5nbDmrEXHYSJzek8w4PxMlD1lQ2foarHOz
tJ0DzsJyZHvHgpyKSV8K6Hp/Wt3ceL328TSxKZfKf55YS82oMofSqTDF+77NhB8o
S90XQCJc8QSJnVyXExeL+h0c2VC+QUoYlgVGU+lLyBxVvPGU1Va21u1uuOqBnoY3
ZsH2c8v5/GMDKnuXfiLfHrPS00e1x7H45m0EEr6T4cFzkylMlf+QhtPhvmK7XjQJ
YMHlj801ORUyjukb8mrgiP56HvNoYILSzukppb7aZrqAaONC0el74AAvCygj0OZf
Hnro2im0wFGrZ1cl+qO05M5yqxhMUX1SiVTlPum53NHADs5w2F+Bl+AiOPxJdq3I
w7B+bHKE9pJTP6H8elbiEmjJ4ITPrk3j+nqqpOH9wPFUhLUu2V70/QtgrmJrseR3
mxG+t8rXC0/0V4Gekf7+S28TpQfGg+ktmacSiIs76RnamUs8Iy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gRUkCNwMVjm+Qo5vbETjTx
20h52a+vJs9RhSmUndJYdFAEw5dIo3vsPplU1iWE9TDXIIYwwEufYHoAGTAgoZId
0PR2Y+KrvwxhjvjVObrydFbSeWUQzuibp7ipKiCy/jFKxglfiEb7lIWYBC0YbKnL
xJpBNEUBBe4ZkpX9pmBmdFfhONUtLRKe730izWiuPWPbzPR2QHjUScywVWdUt9HF
Nje2jUkK4Djt4dDlvqInFDSP+7fM5AOpvyry3XWtsEVcOOYV35RA20PQQ5pG7Tys
qfEtsS5L0Btq1VY2i0v9ozPnraMLJQeC8Hdm1MP+5v7PKksREakEyLRyPUB13zva
gPbaYazA6I5xRQgkPrHhMJLVllXUQC5CldKOHUUUhiBn6eEzBldiznarng92tmnd
=l21b
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -0,0 +1,4 @@
---
dependencies:
- role: apt_common
...

View file

@ -0,0 +1,20 @@
---
- name: Trust OpenDistro GPG key
become: true
apt_key:
data: "{{ lookup('file', 'opendistro.gpg') }}"
state: present
- name: Install OpenDistro repository
become: true
apt_repository:
repo: deb https://d3g5vo6xdbdb9a.cloudfront.net/apt stable main
state: present
filename: opendistro
- name: Install default JRE
become: true
apt:
name: default-jre-headless
state: latest
...

View file

@ -0,0 +1,3 @@
---
ulogd2_plugins_dir: /usr/lib/x86_64-linux-gnu/ulogd
...

View file

@ -0,0 +1,6 @@
---
- name: Restart ulogd2
systemd:
name: ulogd.service
state: reloaded
...

View file

@ -0,0 +1,24 @@
---
- name: Install ulogd2
become: true
apt:
name: ulogd2
state: latest
- name: Configure ulogd2
become: true
template:
src: ulogd.conf.j2
dest: /etc/ulogd.conf
owner: root
group: root
mode: u=rw,g=r,o=
notify: Restart ulogd2
- name: Enable ulogd2
become: true
systemd:
name: ulogd.service
enabled: true
state: started
...

View file

@ -0,0 +1,47 @@
{{ ansible_managed | comment }}
# HWADDR, PRINTFLOW, MARK, NFACCT (pour ct) ?
{%
set plugins = [
"ulogd2_inppkt_NFLOG.so",
"ulogd2_filter_IFINDEX.so",
"ulogd2_filter_IP2STR.so",
"ulogd2_filter_PRINTPKT.so",
"ulogd2_filter_PRINTPKT.so",
"ulogd2_output_SYSLOG.so",
"ulogd2_raw2packet_BASE.so",
]
%}
[global]
logfile="syslog"
loglevel=3
{% for plugin in plugins %}
plugin="{{ ulogd2_plugins_dir }}/{{ plugin }}"
{% endfor %}
stack=log1:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,sys1:SYSLOG
#stack=ct1:NFCT,ip2str1:IP2STR,nacct1:NACCT
[ct1]
#netlink_socket_buffer_size=217088
#netlink_socket_buffer_maxsize=1085440
#netlink_resync_timeout=60 # seconds to wait to perform resynchronization
#pollinterval=10 # use poll-based logging instead of event-driven
# If pollinterval is not set, NFCT plugin will work in event mode
# In this case, you can use the following filters on events:
#accept_src_filter=192.168.1.0/24,1:2::/64 # source ip of connection must belong to these networks
#accept_dst_filter=192.168.1.0/24 # destination ip of connection must belong to these networks
#accept_proto_filter=tcp,sctp # layer 4 proto of connections
[log1]
group=10
#netlink_socket_buffer_size=217088
#netlink_socket_buffer_maxsize=1085440
#netlink_qthreshold=1
# set the delay before flushing packet in the queue inside kernel (in 10ms)
#netlink_qtimeout=100
[sys1]
facility=LOG_LOCAL2