cloud-mu 3.6.14 → 3.6.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 139c2a4c671720c20af33791916196e89711a9c32d3fe9434075991396859644
4
- data.tar.gz: 6bc11c7c21a784ad236699fc612a4cb6aaaa258d423b5788fc53f44dc961f4e5
3
+ metadata.gz: 0b1489c8d2a0d9433580896b96352694c49dfce6c4c9791166ad80b1abb8492b
4
+ data.tar.gz: 35dab58343bdd2cb33b7d97bccc4dc20a92d03de8d4506c7638b15906540e5ff
5
5
  SHA512:
6
- metadata.gz: d0494df226fb48f1e596b758a462e4b5ddc4aa186da1c2d8fe7a50f8aeb726b9b45a9321c32e2baf1c7d63d7ebd368aee6f39a705b0c4d7b32ae7d4118e0f794
7
- data.tar.gz: 7d10151c049c7a8cceb5da58299c2e9b7b1b92624673fce7913b95aef28b37a058e1d6ce5bde1acc07110defcd0abcec4c8bcb4146cd91c9d988250986ee3eaf
6
+ metadata.gz: 41612c92416e80c343158a5ceee10fd6b45cdd234e6bb6679e81de5842a7203a9f079af274c5638c7b27b090a2731e23712f082b46562c47f77c49ed34aa1eb5
7
+ data.tar.gz: a82e7e8b014149763cf2e2f37c99ff1902a0fb3f9c7683136b3da08eb785b119cfad6de35c7dba28e3c0d5ec54fc3a2209241742d4231386c9c952ea7a0b78b7
data/cloud-mu.gemspec CHANGED
@@ -17,8 +17,8 @@ end
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = 'cloud-mu'
20
- s.version = '3.6.14'
21
- s.date = '2025-04-27'
20
+ s.version = '3.6.15'
21
+ s.date = '2025-06-21'
22
22
  s.require_paths = ['modules']
23
23
  s.required_ruby_version = '>= 3'
24
24
  s.summary = "The eGTLabs Mu toolkit for unified cloud deployments"
@@ -56,9 +56,9 @@ if ::File.exist?("/etc/sudoers.d/waagent")
56
56
  }
57
57
  end
58
58
 
59
+ include_recipe 'mu-master::firewall-holes'
59
60
  include_recipe 'mu-master::init'
60
61
  include_recipe 'mu-master::basepackages'
61
- include_recipe 'mu-master::firewall-holes'
62
62
  include_recipe 'mu-master::ssl-certs'
63
63
  include_recipe 'mu-master::vault'
64
64
  include_recipe 'mu-tools::gcloud'
@@ -258,13 +258,13 @@ when 'amazon'
258
258
 
259
259
  when '2'
260
260
  basepackages.concat(['libX11', 'mariadb-devel', 'cryptsetup', 'ncurses-devel', 'ncurses-compat-libs', 'iptables-services'])
261
- removepackages = ['nagios', 'firewalld']
261
+ removepackages = ['nagios']
262
262
  elversion = '7'
263
263
 
264
264
  when '2023'
265
265
  basepackages.concat(['libX11', 'mariadb105-devel', 'cryptsetup', 'ncurses-devel', 'ncurses-compat-libs', 'iptables-services', 'libxcrypt-compat', 'ruby', 'nspr-devel', 'nss-devel >= 3.34', 'openldap-clients', 'openldap-devel', 'lmdb-devel', 'cyrus-sasl-devel', 'icu', 'libicu-devel', 'pcre2-devel', 'cracklib-devel', 'json-c-devel', 'libatomic', 'clang', 'compiler-rt', 'lld', 'gcc', 'gcc-c++', 'libasan', 'libtsan', 'libubsan', 'libdb-devel', 'net-snmp-devel', 'bzip2-devel', 'openssl-devel', 'pam-devel', 'systemd-units', 'systemd-devel', 'pkgconfig', 'krb5-devel', 'autoconf', 'automake', 'libtool', 'doxygen', 'libcmocka-devel', 'python3', 'python3-devel', 'python3-setuptools', 'python3-ldap', 'python3-pyasn1', 'python3-pyasn1-modules', 'python3-dateutil', 'python3-argcomplete', 'python3-policycoreutils', 'python3-libselinux', 'python3-cryptography', 'rsync', 'python3-pip'])
266
266
  basepackages.delete('curl')
267
- removepackages = ['nagios', 'firewalld']
267
+ removepackages = ['nagios']
268
268
  elversion = '7'
269
269
 
270
270
  else
@@ -262,30 +262,46 @@ module MU
262
262
  { name: "resource-id", values: [@cloud_id] }
263
263
  ]
264
264
  )
265
- # XXX a smarter guard would filter with more specificity
266
- if !ext or ext.flow_logs.empty?
267
- loggroup = if @config['log_group_name']
268
- @config['log_group_name']
265
+ logrole = @deploy.findLitterMate(name: @config['name']+"logrole", type: "roles")
266
+ log_cfg = {
267
+ resource_ids: [@cloud_id],
268
+ resource_type: "VPC",
269
+ traffic_type: "ALL",
270
+ tag_specifications: [
271
+ {
272
+ resource_type: "vpc-flow-log",
273
+ tags: @tags.each_key.map { |k| { :key => k, :value => @tags[k] } }
274
+ }
275
+ ]
276
+ }
277
+
278
+ if @config['log_bucket_arn']
279
+ log_cfg[:log_destination] = @config['log_bucket_arn']
280
+ log_cfg[:log_destination_type] = "s3"
281
+ else
282
+ log_cfg[:log_destination_type] = "cloud-watch-logs"
283
+ log_cfg[:deliver_logs_permission_arn] = logrole.cloudobj.arn,
284
+ if @config['log_group_name']
285
+ log_cfg[:log_group_name] = @config['log_group_name']
269
286
  else
270
- @deploy.findLitterMate(name: @config['name']+"loggroup", type: "logs").mu_name
287
+ log_cfg[:log_group_name] = @deploy.findLitterMate(name: @config['name']+"loggroup", type: "logs").mu_name
271
288
  end
272
- logrole = @deploy.findLitterMate(name: @config['name']+"logrole", type: "roles")
289
+ end
290
+
291
+ have_match = false
292
+ if ext and ext.flow_logs
293
+ ext.flow_logs.each { |fl|
294
+ next if fl.log_destination_type != log_cfg[:log_destination_type]
295
+ next if fl.log_destination_type == "s3" and fl.log_destination != log_cfg[:log_destination]
296
+ next if fl.log_destination_type == "cloud-watch-logs" and fl.log_group_name != log_cfg[:log_group_name]
297
+ have_match = true
298
+ }
299
+ end
273
300
 
274
301
 
275
- MU.log "Enabling traffic logging on VPC #{@mu_name} to log group #{loggroup}"
276
- MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).create_flow_logs(
277
- resource_ids: [@cloud_id],
278
- resource_type: "VPC",
279
- traffic_type: "ALL",
280
- log_group_name: loggroup,
281
- deliver_logs_permission_arn: logrole.cloudobj.arn,
282
- tag_specifications: [
283
- {
284
- resource_type: "vpc-flow-log",
285
- tags: @tags.each_key.map { |k| { :key => k, :value => @tags[k] } }
286
- }
287
- ]
288
- )
302
+ if !have_match
303
+ MU.log "Enabling traffic logging on VPC #{@mu_name} to #{log_cfg[:log_destination] || log_cfg[:log_group_name]}"
304
+ MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).create_flow_logs(log_cfg)
289
305
  end
290
306
  end
291
307
 
@@ -935,6 +951,10 @@ module MU
935
951
  "type" => "string",
936
952
  "description" => "An existing CloudWachLogs log group the traffic will be logged to. If not provided, a new one will be created"
937
953
  },
954
+ "log_bucket_arn" => {
955
+ "type" => "string",
956
+ "description" => "An S3 bucket into which to deposit flow logs"
957
+ },
938
958
  "enable_traffic_logging" => {
939
959
  "type" => "boolean",
940
960
  "description" => "If traffic logging is enabled or disabled. Will be enabled on all subnets and network interfaces if set to true on a VPC",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud-mu
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.14
4
+ version: 3.6.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Stange
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2025-04-27 00:00:00.000000000 Z
14
+ date: 2025-06-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable