cloud-mu 3.5.0 → 3.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. checksums.yaml +4 -4
  2. data/Berksfile +5 -2
  3. data/Berksfile.lock +135 -0
  4. data/ansible/roles/mu-base/README.md +33 -0
  5. data/ansible/roles/mu-base/defaults/main.yml +2 -0
  6. data/ansible/roles/mu-base/files/check_apm.cfg +1 -0
  7. data/ansible/roles/mu-base/files/check_apm.sh +18 -0
  8. data/ansible/roles/mu-base/files/check_disk.cfg +1 -0
  9. data/ansible/roles/mu-base/files/check_elastic_shards.cfg +1 -0
  10. data/ansible/roles/mu-base/files/check_elastic_shards.sh +12 -0
  11. data/ansible/roles/mu-base/files/check_logstash.cfg +1 -0
  12. data/ansible/roles/mu-base/files/check_logstash.sh +14 -0
  13. data/ansible/roles/mu-base/files/check_mem.cfg +1 -0
  14. data/ansible/roles/mu-base/files/check_updates.cfg +1 -0
  15. data/ansible/roles/mu-base/files/logrotate.conf +35 -0
  16. data/ansible/roles/mu-base/files/nrpe-apm-sudo +1 -0
  17. data/ansible/roles/mu-base/files/nrpe-elasticshards-sudo +2 -0
  18. data/ansible/roles/mu-base/handlers/main.yml +5 -0
  19. data/ansible/roles/mu-base/meta/main.yml +53 -0
  20. data/ansible/roles/mu-base/tasks/main.yml +113 -0
  21. data/ansible/roles/mu-base/templates/nrpe.cfg.j2 +231 -0
  22. data/ansible/roles/mu-base/tests/inventory +2 -0
  23. data/ansible/roles/mu-base/tests/test.yml +5 -0
  24. data/ansible/roles/mu-base/vars/main.yml +1 -0
  25. data/ansible/roles/mu-compliance/README.md +33 -0
  26. data/ansible/roles/mu-compliance/defaults/main.yml +2 -0
  27. data/ansible/roles/mu-compliance/files/U_MS_Windows_Server_2016_V2R1_STIG_SCAP_1-2_Benchmark.xml +15674 -0
  28. data/ansible/roles/mu-compliance/files/U_MS_Windows_Server_2019_V2R1_STIG_SCAP_1-2_Benchmark.xml +17553 -0
  29. data/ansible/roles/mu-compliance/handlers/main.yml +2 -0
  30. data/ansible/roles/mu-compliance/meta/main.yml +53 -0
  31. data/ansible/roles/mu-compliance/tasks/main.yml +45 -0
  32. data/ansible/roles/mu-compliance/tests/inventory +2 -0
  33. data/ansible/roles/mu-compliance/tests/test.yml +5 -0
  34. data/ansible/roles/mu-compliance/vars/main.yml +4 -0
  35. data/ansible/roles/mu-elastic/README.md +51 -0
  36. data/ansible/roles/mu-elastic/defaults/main.yml +2 -0
  37. data/ansible/roles/mu-elastic/files/jvm.options +93 -0
  38. data/ansible/roles/mu-elastic/handlers/main.yml +10 -0
  39. data/ansible/roles/mu-elastic/meta/main.yml +52 -0
  40. data/ansible/roles/mu-elastic/tasks/main.yml +186 -0
  41. data/ansible/roles/mu-elastic/templates/elasticsearch.yml.j2 +110 -0
  42. data/ansible/roles/mu-elastic/templates/kibana.yml.j2 +131 -0
  43. data/ansible/roles/mu-elastic/templates/password_set.expect.j2 +19 -0
  44. data/ansible/roles/mu-elastic/tests/inventory +2 -0
  45. data/ansible/roles/mu-elastic/tests/test.yml +5 -0
  46. data/ansible/roles/mu-elastic/vars/main.yml +2 -0
  47. data/ansible/roles/mu-logstash/README.md +51 -0
  48. data/ansible/roles/mu-logstash/defaults/main.yml +2 -0
  49. data/ansible/roles/mu-logstash/files/02-beats-input.conf +5 -0
  50. data/ansible/roles/mu-logstash/files/10-rails-filter.conf +16 -0
  51. data/ansible/roles/mu-logstash/files/jvm.options +84 -0
  52. data/ansible/roles/mu-logstash/files/logstash.yml +304 -0
  53. data/ansible/roles/mu-logstash/handlers/main.yml +20 -0
  54. data/ansible/roles/mu-logstash/meta/main.yml +52 -0
  55. data/ansible/roles/mu-logstash/tasks/main.yml +254 -0
  56. data/ansible/roles/mu-logstash/templates/20-cloudtrail.conf.j2 +28 -0
  57. data/ansible/roles/mu-logstash/templates/30-elasticsearch-output.conf.j2 +19 -0
  58. data/ansible/roles/mu-logstash/templates/apm-server.yml.j2 +33 -0
  59. data/ansible/roles/mu-logstash/templates/heartbeat.yml.j2 +29 -0
  60. data/ansible/roles/mu-logstash/templates/nginx/apm.conf.j2 +25 -0
  61. data/ansible/roles/mu-logstash/templates/nginx/default.conf.j2 +56 -0
  62. data/ansible/roles/mu-logstash/templates/nginx/elastic.conf.j2 +27 -0
  63. data/ansible/roles/mu-logstash/tests/inventory +2 -0
  64. data/ansible/roles/mu-logstash/tests/test.yml +5 -0
  65. data/ansible/roles/mu-logstash/vars/main.yml +2 -0
  66. data/ansible/roles/mu-rdp/README.md +33 -0
  67. data/ansible/roles/mu-rdp/meta/main.yml +53 -0
  68. data/ansible/roles/mu-rdp/tasks/main.yml +9 -0
  69. data/ansible/roles/mu-rdp/tests/inventory +2 -0
  70. data/ansible/roles/mu-rdp/tests/test.yml +5 -0
  71. data/ansible/roles/mu-windows/tasks/main.yml +3 -0
  72. data/bin/mu-ansible-secret +1 -1
  73. data/bin/mu-aws-setup +4 -3
  74. data/bin/mu-azure-setup +5 -5
  75. data/bin/mu-configure +25 -17
  76. data/bin/mu-firewall-allow-clients +1 -0
  77. data/bin/mu-gcp-setup +3 -3
  78. data/bin/mu-load-config.rb +1 -0
  79. data/bin/mu-node-manage +66 -33
  80. data/bin/mu-self-update +2 -2
  81. data/bin/mu-upload-chef-artifacts +6 -1
  82. data/bin/mu-user-manage +1 -1
  83. data/cloud-mu.gemspec +25 -23
  84. data/cookbooks/firewall/CHANGELOG.md +417 -224
  85. data/cookbooks/firewall/LICENSE +202 -0
  86. data/cookbooks/firewall/README.md +153 -126
  87. data/cookbooks/firewall/TODO.md +6 -0
  88. data/cookbooks/firewall/attributes/firewalld.rb +7 -0
  89. data/cookbooks/firewall/attributes/iptables.rb +3 -3
  90. data/cookbooks/firewall/chefignore +115 -0
  91. data/cookbooks/firewall/libraries/helpers.rb +5 -0
  92. data/cookbooks/firewall/libraries/helpers_firewalld.rb +1 -1
  93. data/cookbooks/firewall/libraries/helpers_firewalld_dbus.rb +72 -0
  94. data/cookbooks/firewall/libraries/helpers_iptables.rb +3 -3
  95. data/cookbooks/firewall/libraries/helpers_nftables.rb +170 -0
  96. data/cookbooks/firewall/libraries/helpers_ufw.rb +7 -0
  97. data/cookbooks/firewall/libraries/helpers_windows.rb +8 -9
  98. data/cookbooks/firewall/libraries/provider_firewall_firewalld.rb +9 -9
  99. data/cookbooks/firewall/libraries/provider_firewall_iptables.rb +7 -7
  100. data/cookbooks/firewall/libraries/provider_firewall_iptables_ubuntu.rb +12 -8
  101. data/cookbooks/firewall/libraries/provider_firewall_iptables_ubuntu1404.rb +13 -9
  102. data/cookbooks/firewall/libraries/provider_firewall_rule.rb +1 -1
  103. data/cookbooks/firewall/libraries/provider_firewall_ufw.rb +5 -5
  104. data/cookbooks/firewall/libraries/provider_firewall_windows.rb +4 -4
  105. data/cookbooks/firewall/libraries/resource_firewall_rule.rb +3 -3
  106. data/cookbooks/firewall/metadata.json +40 -1
  107. data/cookbooks/firewall/metadata.rb +15 -0
  108. data/cookbooks/firewall/recipes/default.rb +7 -7
  109. data/cookbooks/firewall/recipes/disable_firewall.rb +1 -1
  110. data/cookbooks/firewall/recipes/firewalld.rb +87 -0
  111. data/cookbooks/firewall/renovate.json +18 -0
  112. data/cookbooks/firewall/resources/firewalld.rb +28 -0
  113. data/cookbooks/firewall/resources/firewalld_config.rb +39 -0
  114. data/cookbooks/firewall/resources/firewalld_helpers.rb +106 -0
  115. data/cookbooks/firewall/resources/firewalld_icmptype.rb +88 -0
  116. data/cookbooks/firewall/resources/firewalld_ipset.rb +104 -0
  117. data/cookbooks/firewall/resources/firewalld_policy.rb +115 -0
  118. data/cookbooks/firewall/resources/firewalld_service.rb +98 -0
  119. data/cookbooks/firewall/resources/firewalld_zone.rb +118 -0
  120. data/cookbooks/firewall/resources/nftables.rb +71 -0
  121. data/cookbooks/firewall/resources/nftables_rule.rb +113 -0
  122. data/cookbooks/mu-activedirectory/Berksfile +1 -1
  123. data/cookbooks/mu-activedirectory/metadata.rb +1 -1
  124. data/cookbooks/mu-firewall/metadata.rb +2 -2
  125. data/cookbooks/mu-master/Berksfile +4 -3
  126. data/cookbooks/mu-master/attributes/default.rb +5 -2
  127. data/cookbooks/mu-master/files/default/check_elastic.sh +761 -0
  128. data/cookbooks/mu-master/files/default/check_kibana.rb +45 -0
  129. data/cookbooks/mu-master/libraries/mu.rb +24 -0
  130. data/cookbooks/mu-master/metadata.rb +5 -5
  131. data/cookbooks/mu-master/recipes/default.rb +31 -20
  132. data/cookbooks/mu-master/recipes/firewall-holes.rb +5 -0
  133. data/cookbooks/mu-master/recipes/init.rb +58 -19
  134. data/cookbooks/mu-master/recipes/update_nagios_only.rb +251 -178
  135. data/cookbooks/mu-master/templates/default/nagios.conf.erb +5 -11
  136. data/cookbooks/mu-master/templates/default/web_app.conf.erb +3 -0
  137. data/cookbooks/mu-php54/Berksfile +1 -1
  138. data/cookbooks/mu-php54/metadata.rb +2 -2
  139. data/cookbooks/mu-tools/Berksfile +2 -3
  140. data/cookbooks/mu-tools/attributes/default.rb +3 -4
  141. data/cookbooks/mu-tools/files/amazon/etc/bashrc +90 -0
  142. data/cookbooks/mu-tools/files/amazon/etc/login.defs +292 -0
  143. data/cookbooks/mu-tools/files/amazon/etc/profile +77 -0
  144. data/cookbooks/mu-tools/files/amazon/etc/security/limits.conf +63 -0
  145. data/cookbooks/mu-tools/files/amazon/etc/sysconfig/init +19 -0
  146. data/cookbooks/mu-tools/files/amazon/etc/sysctl.conf +82 -0
  147. data/cookbooks/mu-tools/files/amazon-2023/etc/login.defs +294 -0
  148. data/cookbooks/mu-tools/files/default/logrotate.conf +35 -0
  149. data/cookbooks/mu-tools/files/default/nrpe_conf_d.pp +0 -0
  150. data/cookbooks/mu-tools/libraries/helper.rb +21 -9
  151. data/cookbooks/mu-tools/metadata.rb +4 -4
  152. data/cookbooks/mu-tools/recipes/apply_security.rb +3 -2
  153. data/cookbooks/mu-tools/recipes/aws_api.rb +23 -5
  154. data/cookbooks/mu-tools/recipes/base_repositories.rb +4 -1
  155. data/cookbooks/mu-tools/recipes/gcloud.rb +56 -56
  156. data/cookbooks/mu-tools/recipes/nagios.rb +1 -1
  157. data/cookbooks/mu-tools/recipes/nrpe.rb +20 -2
  158. data/cookbooks/mu-tools/recipes/rsyslog.rb +12 -1
  159. data/cookbooks/mu-tools/recipes/set_local_fw.rb +1 -1
  160. data/data_bags/nagios_services/apm_backend_connect.json +5 -0
  161. data/data_bags/nagios_services/apm_listen.json +5 -0
  162. data/data_bags/nagios_services/elastic_shards.json +5 -0
  163. data/data_bags/nagios_services/logstash.json +5 -0
  164. data/data_bags/nagios_services/rhel7_updates.json +8 -0
  165. data/extras/image-generators/AWS/centos7.yaml +1 -0
  166. data/extras/image-generators/AWS/rhel7.yaml +21 -0
  167. data/extras/image-generators/AWS/win2k12r2.yaml +1 -0
  168. data/extras/image-generators/AWS/win2k16.yaml +1 -0
  169. data/extras/image-generators/AWS/win2k19.yaml +1 -0
  170. data/extras/list-stock-amis +0 -0
  171. data/extras/ruby_rpm/muby.spec +8 -5
  172. data/extras/vault_tools/export_vaults.sh +1 -1
  173. data/extras/vault_tools/recreate_vaults.sh +0 -0
  174. data/extras/vault_tools/test_vaults.sh +0 -0
  175. data/install/deprecated-bash-library.sh +1 -1
  176. data/install/installer +4 -2
  177. data/modules/mommacat.ru +3 -1
  178. data/modules/mu/adoption.rb +1 -1
  179. data/modules/mu/cloud/dnszone.rb +2 -2
  180. data/modules/mu/cloud/machine_images.rb +26 -25
  181. data/modules/mu/cloud/resource_base.rb +213 -182
  182. data/modules/mu/cloud/server_pool.rb +1 -1
  183. data/modules/mu/cloud/ssh_sessions.rb +7 -5
  184. data/modules/mu/cloud/wrappers.rb +2 -2
  185. data/modules/mu/cloud.rb +1 -1
  186. data/modules/mu/config/bucket.rb +1 -1
  187. data/modules/mu/config/function.rb +6 -1
  188. data/modules/mu/config/loadbalancer.rb +24 -2
  189. data/modules/mu/config/ref.rb +12 -0
  190. data/modules/mu/config/role.rb +1 -1
  191. data/modules/mu/config/schema_helpers.rb +42 -9
  192. data/modules/mu/config/server.rb +43 -27
  193. data/modules/mu/config/tail.rb +19 -10
  194. data/modules/mu/config.rb +6 -5
  195. data/modules/mu/defaults/AWS.yaml +78 -114
  196. data/modules/mu/deploy.rb +9 -2
  197. data/modules/mu/groomer.rb +12 -4
  198. data/modules/mu/groomers/ansible.rb +104 -20
  199. data/modules/mu/groomers/chef.rb +15 -6
  200. data/modules/mu/master.rb +9 -4
  201. data/modules/mu/mommacat/daemon.rb +4 -2
  202. data/modules/mu/mommacat/naming.rb +1 -2
  203. data/modules/mu/mommacat/storage.rb +7 -2
  204. data/modules/mu/mommacat.rb +33 -6
  205. data/modules/mu/providers/aws/database.rb +161 -8
  206. data/modules/mu/providers/aws/dnszone.rb +11 -6
  207. data/modules/mu/providers/aws/endpoint.rb +81 -6
  208. data/modules/mu/providers/aws/firewall_rule.rb +254 -172
  209. data/modules/mu/providers/aws/function.rb +65 -3
  210. data/modules/mu/providers/aws/loadbalancer.rb +39 -28
  211. data/modules/mu/providers/aws/log.rb +2 -1
  212. data/modules/mu/providers/aws/role.rb +25 -7
  213. data/modules/mu/providers/aws/server.rb +36 -12
  214. data/modules/mu/providers/aws/server_pool.rb +237 -127
  215. data/modules/mu/providers/aws/storage_pool.rb +7 -1
  216. data/modules/mu/providers/aws/user.rb +1 -1
  217. data/modules/mu/providers/aws/userdata/linux.erb +6 -2
  218. data/modules/mu/providers/aws/userdata/windows.erb +7 -5
  219. data/modules/mu/providers/aws/vpc.rb +49 -25
  220. data/modules/mu/providers/aws.rb +13 -8
  221. data/modules/mu/providers/azure/container_cluster.rb +1 -1
  222. data/modules/mu/providers/azure/loadbalancer.rb +2 -2
  223. data/modules/mu/providers/azure/server.rb +5 -2
  224. data/modules/mu/providers/azure/userdata/linux.erb +1 -1
  225. data/modules/mu/providers/azure.rb +11 -8
  226. data/modules/mu/providers/cloudformation/dnszone.rb +1 -1
  227. data/modules/mu/providers/google/container_cluster.rb +15 -2
  228. data/modules/mu/providers/google/folder.rb +2 -1
  229. data/modules/mu/providers/google/function.rb +130 -4
  230. data/modules/mu/providers/google/habitat.rb +2 -1
  231. data/modules/mu/providers/google/loadbalancer.rb +407 -160
  232. data/modules/mu/providers/google/role.rb +16 -3
  233. data/modules/mu/providers/google/server.rb +5 -1
  234. data/modules/mu/providers/google/user.rb +25 -18
  235. data/modules/mu/providers/google/userdata/linux.erb +1 -1
  236. data/modules/mu/providers/google/vpc.rb +53 -7
  237. data/modules/mu/providers/google.rb +39 -39
  238. data/modules/mu.rb +8 -8
  239. data/modules/tests/elk.yaml +46 -0
  240. data/test/mu-master-test/controls/all_in_one.rb +1 -1
  241. metadata +207 -112
  242. data/cookbooks/firewall/CONTRIBUTING.md +0 -2
  243. data/cookbooks/firewall/MAINTAINERS.md +0 -19
  244. data/cookbooks/firewall/libraries/matchers.rb +0 -30
  245. data/extras/image-generators/AWS/rhel71.yaml +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 210514240124518b016fcafc33868f4efcbd890764614b535a3460fd7736961e
4
- data.tar.gz: 22982dbf157d8c94ecb38c9ca7ee9209dcdef516158ecd1835461da255b7a3df
3
+ metadata.gz: a92d3b1488019b813ca9af472de5f0f39b3527ccdd8f3b616b98928946eb09e3
4
+ data.tar.gz: a3c3a759a745f248cf5c07d1e7680341d05666ad9bde68f56ec204cdf5196486
5
5
  SHA512:
6
- metadata.gz: 412580d1d702cf61dcd3671bee157b787c0a4ffd79b2c57d845b29bb93cf71da092910209b1ba0a7ff7f98d5a37b21f0b542a99cc31e479b8d4a45b1fa778622
7
- data.tar.gz: 55fe915449c29467c2731736b357c35a5aef4af243b1c57e06a986273e27eed1726769ce0982d0e6202888161df0664fd10b8179697b13b73c90b3e02f4bcf45
6
+ metadata.gz: 455d3559ecfeea1d63a013fd526e524b48f95c56571d16e5c7cab2e4cdb40a7c615194adf90f3ebbe07d753c38aa3acce3b3355ce7176f046e06f983ba6f2915
7
+ data.tar.gz: 91e2b8811aa2e3e81da0a675c11add903d5e8403d9ac2b13e7fa503d19c5221b6f15b5c2a52be7c9c0b07c6dea83cdd322d5e3fc052adf9ab613f06d05969ee5
data/Berksfile CHANGED
@@ -1,5 +1,5 @@
1
- source chef_repo: "cookbooks/"
2
1
  source "https://supermarket.chef.io"
2
+ source chef_repo: "/opt/mu/lib/cookbooks/"
3
3
 
4
4
  # Mu Platform Cookbooks
5
5
  cookbook 'awscli'
@@ -12,6 +12,9 @@ cookbook 'mu-mongo'
12
12
  cookbook 'mu-openvpn'
13
13
  cookbook 'mu-tools'
14
14
  cookbook 'mu-utility'
15
- cookbook 'mu-nagios' , '~> 8.2.0', git: "https://github.com/cloudamatic/mu-nagios.git"
15
+ cookbook 'nagios', '~> 11.2.2'
16
+ #cookbook 'mu-nagios' , '~> 8.2.0', git: "https://github.com/cloudamatic/mu-nagios.git"
16
17
  cookbook 'firewall', path: 'cookbooks/firewall'
17
18
  cookbook 'chocolatey'
19
+ cookbook 'seven_zip', '< 4.0'
20
+ cookbook 'nginx', '< 12'
data/Berksfile.lock ADDED
@@ -0,0 +1,135 @@
1
+ DEPENDENCIES
2
+ awscli
3
+ chocolatey
4
+ firewall
5
+ path: cookbooks/firewall
6
+ mu-activedirectory
7
+ mu-firewall
8
+ mu-glusterfs
9
+ mu-master
10
+ mu-mongo
11
+ mu-openvpn
12
+ mu-splunk
13
+ mu-tools
14
+ mu-utility
15
+ nagios (~> 11.2.2)
16
+ nginx (< 12.0.0)
17
+ seven_zip (< 4.0.0)
18
+
19
+ GRAPH
20
+ apache2 (9.0.6)
21
+ yum-epel (>= 0.0.0)
22
+ apt (7.5.23)
23
+ awscli (1.1.2)
24
+ python (~> 1.4)
25
+ bind (2.2.1)
26
+ bind9-ng (0.1.0)
27
+ build-essential (8.2.1)
28
+ mingw (>= 1.1)
29
+ seven_zip (>= 0.0.0)
30
+ chef-sugar (5.1.12)
31
+ chef-vault (3.1.2)
32
+ chocolatey (3.0.0)
33
+ cpan (0.1.0)
34
+ database (6.1.1)
35
+ postgresql (>= 1.0.0)
36
+ firewall (6.3.7)
37
+ homebrew (5.4.9)
38
+ hostsfile (3.0.1)
39
+ java (2.2.1)
40
+ homebrew (>= 0.0.0)
41
+ windows (>= 0.0.0)
42
+ mingw (4.0.3)
43
+ seven_zip (>= 0.0.0)
44
+ mongodb (0.16.2)
45
+ apt (>= 1.8.2)
46
+ python (>= 0.0.0)
47
+ runit (>= 1.5.0)
48
+ yum (>= 3.0)
49
+ mu-activedirectory (0.2.0)
50
+ chef-vault (~> 3.1.1)
51
+ windows (~> 5.1.1)
52
+ yum-epel (~> 5.0.8)
53
+ mu-firewall (0.1.3)
54
+ firewall (~> 6.3.7)
55
+ mu-glusterfs (0.1.0)
56
+ mu-firewall (>= 0.0.0)
57
+ yum (~> 5.1.0)
58
+ mu-master (0.9.9)
59
+ apache2 (~> 9.0.3)
60
+ bind (~> 2.2.0)
61
+ bind9-ng (~> 0.1.0)
62
+ chef-sugar (>= 0.0.0)
63
+ chef-vault (~> 3.1.1)
64
+ hostsfile (~> 3.0.1)
65
+ mu-activedirectory (>= 0.0.0)
66
+ mu-firewall (>= 0.0.0)
67
+ mu-tools (>= 0.0.0)
68
+ mu-utility (>= 0.0.0)
69
+ nagios (>= 0.0.0)
70
+ nrpe (~> 2.0.3)
71
+ postfix (~> 5.3.1)
72
+ s3fs (>= 0.0.0)
73
+ mu-mongo (0.5.0)
74
+ chef-vault (~> 3.1.1)
75
+ mongodb (~> 0.16.2)
76
+ mu-openvpn (0.1.0)
77
+ chef-vault (~> 3.1.1)
78
+ mu-firewall (>= 0.0.0)
79
+ mu-utility (>= 0.0.0)
80
+ mu-splunk (1.3.0)
81
+ chef-vault (>= 1.0.4)
82
+ mu-tools (1.1.1)
83
+ chef-vault (~> 3.1.1)
84
+ chocolatey (>= 0.0.0)
85
+ database (~> 6.1.1)
86
+ firewall (>= 0.0.0)
87
+ java (~> 2.2.0)
88
+ mu-activedirectory (>= 0.0.0)
89
+ mu-firewall (>= 0.0.0)
90
+ mu-splunk (>= 0.0.0)
91
+ mu-utility (>= 0.0.0)
92
+ nagios (>= 0.0.0)
93
+ oracle-instantclient (~> 1.1.0)
94
+ postgresql (~> 7.1.0)
95
+ selinux (~> 3.0.0)
96
+ windows (~> 5.1.1)
97
+ yum-epel (~> 5.0.8)
98
+ mu-utility (0.6.0)
99
+ mu-firewall (>= 0.0.0)
100
+ windows (~> 5.1.1)
101
+ nagios (11.2.9)
102
+ apache2 (>= 9.0)
103
+ nginx (>= 11.2)
104
+ nrpe (>= 0.0.0)
105
+ php (>= 7.2)
106
+ yum-epel (>= 0.0.0)
107
+ zap (>= 0.6.0)
108
+ nginx (11.5.3)
109
+ ohai (~> 5.2)
110
+ nrpe (2.0.5)
111
+ build-essential (>= 0.0.0)
112
+ yum-epel (>= 0.0.0)
113
+ ohai (5.3.1)
114
+ oracle-instantclient (1.1.0)
115
+ build-essential (>= 0.0.0)
116
+ cpan (>= 0.0.0)
117
+ php (>= 0.0.0)
118
+ packagecloud (2.0.8)
119
+ php (10.2.3)
120
+ postfix (5.3.1)
121
+ postgresql (7.1.9)
122
+ python (1.4.6)
123
+ build-essential (>= 0.0.0)
124
+ yum-epel (>= 0.0.0)
125
+ runit (5.1.7)
126
+ packagecloud (>= 0.0.0)
127
+ yum-epel (>= 0.0.0)
128
+ s3fs (3.0.1)
129
+ selinux (3.0.2)
130
+ seven_zip (3.2.0)
131
+ windows (>= 0.0.0)
132
+ windows (5.1.6)
133
+ yum (5.1.0)
134
+ yum-epel (5.0.8)
135
+ zap (2.3.0)
@@ -0,0 +1,33 @@
1
+ Role Name
2
+ =========
3
+
4
+ Hardening
5
+
6
+ Requirements
7
+ ------------
8
+
9
+ Windows host with internet connectivity and no other major services running.
10
+
11
+ License
12
+ -------
13
+
14
+ Copyright:: Copyright (c) 2021 eGlobalTech, Inc., all rights reserved
15
+
16
+ Licensed under the BSD-3 license (the "License");
17
+ you may not use this file except in compliance with the License.
18
+ You may obtain a copy of the License in the root of the project or at
19
+
20
+ http://egt-labs.com/mu/LICENSE.html
21
+
22
+ Unless required by applicable law or agreed to in writing, software
23
+ distributed under the License is distributed on an "AS IS" BASIS,
24
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
+ See the License for the specific language governing permissions and
26
+ limitations under the License.
27
+
28
+ Author Information
29
+ ------------------
30
+
31
+ Current developers: John Stange
32
+
33
+ egt-labs-admins@egt-labs.com
@@ -0,0 +1,2 @@
1
+ ---
2
+ # defaults file for mu-base
@@ -0,0 +1 @@
1
+ command[check_apm]=/usr/lib64/nagios/plugins/check_apm
@@ -0,0 +1,18 @@
1
+ #!/bin/sh
2
+
3
+ errs=`/bin/sudo /bin/apm-server test output | grep "ERROR"`
4
+ warns=`/bin/sudo /bin/apm-server test output | grep -v " server's certificate chain verification is disabled" | grep WARN` # XXX might be nice to care about this
5
+ oks=`/bin/sudo /bin/apm-server test output | grep OK`
6
+
7
+ if [ "$errs" != "" ];then
8
+ echo $errs
9
+ exit 2
10
+ elif [ "$warns" != "" ];then
11
+ echo $warns
12
+ exit 1
13
+ elif [ "$oks" != "" ];then
14
+ /bin/sudo /bin/apm-server test output
15
+ exit 0
16
+ else
17
+ exit 3
18
+ fi
@@ -0,0 +1 @@
1
+ command[check_disk]=/usr/lib64/nagios/plugins/check_disk -w 15% -c 5%
@@ -0,0 +1 @@
1
+ command[check_elastic_shards]=/usr/lib64/nagios/plugins/check_elastic_shards
@@ -0,0 +1,12 @@
1
+ #!/bin/sh
2
+
3
+ errs=`/bin/sudo /bin/tail -100 /var/log/elasticsearch/elasticsearch.log | grep "maximum normal shards open"`
4
+ code=$?
5
+
6
+ if [ "$errs" != "" ];then
7
+ echo $errs
8
+ exit 2
9
+ else
10
+ /bin/sudo /bin/grep shards /var/log/elasticsearch/elasticsearch.log | tail -1
11
+ exit 0
12
+ fi
@@ -0,0 +1 @@
1
+ command[check_logstash]=/usr/lib64/nagios/plugins/check_logstash
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+
3
+ status=`curl -XGET 'localhost:9600/_node/stats/pipelines?pretty' | grep '^ "status" :' | cut -d: -f2 | cut -d\" -f2`
4
+
5
+ echo $status
6
+ if [ "$status" == "green" ];then
7
+ exit 0
8
+ elif [ "$status" == "yellow" ];then
9
+ exit 1
10
+ elif [ "$status" == "red" ];then
11
+ exit 2
12
+ else
13
+ exit 3
14
+ fi
@@ -0,0 +1 @@
1
+ command[check_mem]=/usr/lib64/nagios/plugins/check_mem -w 80 -c 95
@@ -0,0 +1 @@
1
+ command[check_updates]=/usr/lib64/nagios/plugins/check_updates --security-only
@@ -0,0 +1,35 @@
1
+ # see "man logrotate" for details
2
+ # rotate log files weekly
3
+ daily
4
+
5
+ # keep 4 weeks worth of backlogs
6
+ rotate 4
7
+
8
+ # create new (empty) log files after rotating old ones
9
+ create
10
+
11
+ # use date as a suffix of the rotated file
12
+ dateext
13
+
14
+ # uncomment this if you want your log files compressed
15
+ compress
16
+
17
+ # RPM packages drop log rotation information into this directory
18
+ include /etc/logrotate.d
19
+
20
+ # no packages own wtmp and btmp -- we'll rotate them here
21
+ /var/log/wtmp {
22
+ monthly
23
+ create 0664 root utmp
24
+ minsize 1M
25
+ rotate 1
26
+ }
27
+
28
+ /var/log/btmp {
29
+ missingok
30
+ monthly
31
+ create 0600 root utmp
32
+ rotate 1
33
+ }
34
+
35
+ # system-specific logs may be also be configured here.
@@ -0,0 +1 @@
1
+ nrpe ALL=(ALL) NOPASSWD: /bin/apm-server test output
@@ -0,0 +1,2 @@
1
+ nrpe ALL=(ALL) NOPASSWD: /bin/tail -100 /var/log/elasticsearch/elasticsearch.log
2
+ nrpe ALL=(ALL) NOPASSWD: /bin/grep shards /var/log/elasticsearch/elasticsearch.log
@@ -0,0 +1,5 @@
1
+ ---
2
+ - name: Restart NRPE
3
+ service:
4
+ name: nrpe
5
+ state: restarted
@@ -0,0 +1,53 @@
1
+ galaxy_info:
2
+ author: your name
3
+ description: your description
4
+ company: your company (optional)
5
+
6
+ # If the issue tracker for your role is not on github, uncomment the
7
+ # next line and provide a value
8
+ # issue_tracker_url: http://example.com/issue/tracker
9
+
10
+ # Choose a valid license ID from https://spdx.org - some suggested licenses:
11
+ # - BSD-3-Clause (default)
12
+ # - MIT
13
+ # - GPL-2.0-or-later
14
+ # - GPL-3.0-only
15
+ # - Apache-2.0
16
+ # - CC-BY-4.0
17
+ license: license (GPL-2.0-or-later, MIT, etc)
18
+
19
+ min_ansible_version: 2.4
20
+
21
+ # If this a Container Enabled role, provide the minimum Ansible Container version.
22
+ # min_ansible_container_version:
23
+
24
+ #
25
+ # Provide a list of supported platforms, and for each platform a list of versions.
26
+ # If you don't wish to enumerate all versions for a particular platform, use 'all'.
27
+ # To view available platforms and versions (or releases), visit:
28
+ # https://galaxy.ansible.com/api/v1/platforms/
29
+ #
30
+ # platforms:
31
+ # - name: Fedora
32
+ # versions:
33
+ # - all
34
+ # - 25
35
+ # - name: SomePlatform
36
+ # versions:
37
+ # - all
38
+ # - 1.0
39
+ # - 7
40
+ # - 99.99
41
+
42
+ galaxy_tags: []
43
+ # List tags for your role here, one per line. A tag is a keyword that describes
44
+ # and categorizes the role. Users find roles by searching for tags. Be sure to
45
+ # remove the '[]' above, if you add tags to this list.
46
+ #
47
+ # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
48
+ # Maximum 20 tags per role.
49
+
50
+ dependencies: []
51
+ # List your role dependencies here, one per line. Be sure to remove the '[]' above,
52
+ # if you add dependencies to this list.
53
+
@@ -0,0 +1,113 @@
1
+ ---
2
+ - name: Set hostname
3
+ hostname:
4
+ name: "{{ mu_name }}"
5
+
6
+ - name: install basic things
7
+ package:
8
+ name: "{{ item }}"
9
+ state: present
10
+ with_items:
11
+ - nrpe
12
+ - rsyslog
13
+ - rsyslog-gnutls
14
+ - policycoreutils-python
15
+ - nagios-plugins-disk
16
+ - nagios-plugins-check-updates
17
+
18
+ - name: /etc/logrotate.conf
19
+ copy:
20
+ src: logrotate.conf
21
+ dest: /etc/logrotate.conf
22
+ mode: 0644
23
+ owner: root
24
+ group: root
25
+ become: yes
26
+
27
+ - name: /etc/nagios/nrpe.cfg
28
+ template:
29
+ src: nrpe.cfg.j2
30
+ dest: /etc/nagios/nrpe.cfg
31
+ mode: 0644
32
+ owner: root
33
+ group: root
34
+ become: yes
35
+ notify:
36
+ - Restart NRPE
37
+
38
+ - name: add NRPE checks
39
+ copy:
40
+ dest: "/etc/nagios/nrpe.d/{{ item }}"
41
+ src: "{{ item }}"
42
+ mode: 0644
43
+ owner: nrpe
44
+ group: nrpe
45
+ become: yes
46
+ with_items:
47
+ - check_disk.cfg
48
+ - check_mem.cfg
49
+ - check_updates.cfg
50
+ - check_logstash.cfg
51
+ - check_apm.cfg
52
+ - check_elastic_shards.cfg
53
+ notify:
54
+ - Restart NRPE
55
+
56
+ - name: Copy NRPE plugins
57
+ copy:
58
+ dest: "/usr/lib64/nagios/plugins/{{ item }}"
59
+ src: "{{ item }}.sh"
60
+ mode: 0755
61
+ become: yes
62
+ with_items:
63
+ - check_logstash
64
+ - check_apm
65
+ - check_elastic_shards
66
+
67
+ - name: Add sudo line for nrpe -> apm-server
68
+ copy:
69
+ dest: /etc/sudoers.d/91-nrpe-apm
70
+ src: "nrpe-apm-sudo"
71
+ mode: 0440
72
+ become: yes
73
+
74
+ - name: Add sudo lines for nrpe -> elastic shard limit
75
+ copy:
76
+ dest: /etc/sudoers.d/92-nrpe-elasticshards
77
+ src: "nrpe-elasticshards-sudo"
78
+ mode: 0440
79
+ become: yes
80
+
81
+ - name: Copy SELinux modules for NRPE
82
+ copy:
83
+ dest: "/root/{{ item }}.pp"
84
+ src: "/opt/mu/lib/cookbooks/mu-tools/files/default/{{ item }}.pp"
85
+ with_items:
86
+ - nrpe_file
87
+ - nrpe_check_disk
88
+ - nrpe_conf_d
89
+
90
+ # XXX a proper guard would be nice
91
+ - name: Install SELinux modules for NRPE
92
+ shell: "( /usr/sbin/semodule -l | grep '^{{ item }} ' ) || /usr/sbin/semodule -i /root/{{ item }}.pp"
93
+ with_items:
94
+ - nrpe_file
95
+ - nrpe_check_disk
96
+ - nrpe_conf_d
97
+ notify:
98
+ - Restart NRPE
99
+
100
+ - name: allow inbound for NRPE
101
+ iptables:
102
+ chain: INPUT
103
+ source: "0.0.0.0/0"
104
+ destination_port: "5666"
105
+ protocol: tcp
106
+ jump: ACCEPT
107
+ loop: "{{ mu_deployment['mu_all_ips'] }}"
108
+
109
+ - name: Install Amazon SSM Agent
110
+ yum:
111
+ name: "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/linux_amd64/amazon-ssm-agent.rpm"
112
+ state: present
113
+ when: cloudprovider == "AWS"