Module: Msf::Auxiliary::Prometheus
- Includes:
- Report
- Defined in:
- lib/msf/core/auxiliary/prometheus.rb
Overview
This module provides methods for working with Prometheus node exporter
Instance Method Summary collapse
- #credential_data ⇒ Object
-
#process_authorization(auth) ⇒ Object
returns username, password.
- #process_azure_sd_configs(job_name, azure_sd_configs) ⇒ Object
- #process_consul_sd_configs(job_name, consul_sd_configs) ⇒ Object
- #process_digitalocean_sd_configs(job_name, digitalocean_sd_configs) ⇒ Object
- #process_dns_sd_configs(job_name, dns_sd_configs) ⇒ Object
- #process_ec2_sd_configs(job_name, ec2_sd_configs) ⇒ Object
-
#process_embedded_uri(uri, job_name, config_name) ⇒ Object
processes a generic URI for creds.
- #process_eureka_sd_configs(job_name, eureka_sd_configs) ⇒ Object
- #process_hetzner_sd_configs(job_name, hetzner_sd_configs) ⇒ Object
- #process_http_sd_configs(job_name, http_sd_configs) ⇒ Object
- #process_ionos_sd_configs(job_name, ionos_sd_configs) ⇒ Object
- #process_kubernetes_sd_configs(job_name, kubernetes_sd_configs) ⇒ Object
- #process_kuma_sd_configs(job_name, targets) ⇒ Object
- #process_lightsail_sd_configs(job_name, lightsail_sd_configs) ⇒ Object
- #process_linode_sd_configs(job_name, linode_sd_configs) ⇒ Object
- #process_marathon_sd_configs(job_name, marathon_sd_configs) ⇒ Object
- #process_nomad_sd_configs(job_name, targets) ⇒ Object
- #process_ovhcloud_sd_configs(job_name, ovhcloud_sd_configs) ⇒ Object
- #process_results_page(page) ⇒ Object
- #process_scaleway_sd_configs(job_name, scaleway_sd_configs) ⇒ Object
- #process_uyuni_sd_configs(job_name, uyuni_sd_configs) ⇒ Object
- #process_vultr_sd_configs(job_name, vultr_sd_configs) ⇒ Object
- #prometheus_config_eater(yamlconf) ⇒ Object
Methods included from Report
#active_db?, #create_cracked_credential, #create_credential, #create_credential_and_login, #create_credential_login, #db, #db_warning_given?, #get_client, #get_host, #inside_workspace_boundary?, #invalidate_login, #mytask, #myworkspace, #myworkspace_id, #report_auth_info, #report_client, #report_exploit, #report_host, #report_loot, #report_note, #report_service, #report_vuln, #report_web_form, #report_web_page, #report_web_site, #report_web_vuln, #store_cred, #store_local, #store_loot
Methods included from Metasploit::Framework::Require
optionally, optionally_active_record_railtie, optionally_include_metasploit_credential_creation, #optionally_include_metasploit_credential_creation, optionally_require_metasploit_db_gem_engines
Instance Method Details
#credential_data ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 45 def credential_data { # these 4 need to be changed every time # address: thost, # port: tport, # username: username # private_data: hash protocol: 'tcp', workspace_id: myworkspace_id, origin_type: :service, private_type: :password, service_name: '', module_fullname: fullname, status: Metasploit::Model::Login::Status::UNTRIED } end |
#process_authorization(auth) ⇒ Object
returns username, password
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 13 def (auth) if auth['credentials'] # credential foobar return '', auth['credentials'] elsif auth['credentials_file'] # type: Bearer # credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token return auth['type'], auth['credentials_file'] end end |
#process_azure_sd_configs(job_name, azure_sd_configs) ⇒ Object
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 205 def process_azure_sd_configs(job_name, azure_sd_configs) cred = credential_data cred[:port] = azure_sd_configs['port'] cred[:address] = '' cred[:username] = azure_sd_configs['client_id'] cred[:private_data] = azure_sd_configs['client_secret'] cred[:service_name] = azure_sd_configs['authentication_method'] create_credential_and_login(cred) @table_creds << [ job_name, 'azure_sd_configs', '', azure_sd_configs['port'], azure_sd_configs['client_id'], azure_sd_configs['client_secret'], "Environment: #{azure_sd_configs['environment']}, Subscription ID: #{azure_sd_configs['subscription_id']}, Resource Group: #{azure_sd_configs['resource_group']}, Tenant ID: #{azure_sd_configs['tenant_id']}" ] end |
#process_consul_sd_configs(job_name, consul_sd_configs) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 87 def process_consul_sd_configs(job_name, consul_sd_configs) uri = URI("#{consul_sd_configs['scheme']}://#{consul_sd_configs['server']}") cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = '' cred[:private_data] = consul_sd_configs['token'] cred[:service_name] = consul_sd_configs['scheme'] create_credential_and_login(cred) @table_creds << [ job_name, 'consul_sd_configs', uri.host, uri.port, '', consul_sd_configs['token'], "Path Prefix: #{consul_sd_configs['path_prefix']}" ] end |
#process_digitalocean_sd_configs(job_name, digitalocean_sd_configs) ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 231 def process_digitalocean_sd_configs(job_name, digitalocean_sd_configs) username, password = (digitalocean_sd_configs['authorization']) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = username cred[:private_data] = password create_credential_and_login(cred) @table_creds << [ job_name, 'digitalocean_sd_configs', '', '', username, password, '' ] end |
#process_dns_sd_configs(job_name, dns_sd_configs) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 62 def process_dns_sd_configs(job_name, dns_sd_configs) dns_sd_configs['names']&.each do |name| username = dns_sd_configs.dig('basic_auth', 'username') password = dns_sd_configs.dig('basic_auth', 'password') password = dns_sd_configs.dig('basic_auth', 'password_file') if dns_sd_configs.dig('basic_auth', 'password_file') uri = URI("#{dns_sd_configs['scheme']}://#{name}") cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = dns_sd_configs.dig('basic_auth', 'username') cred[:private_data] = password cred[:service_name] = dns_sd_configs['scheme'] create_credential_and_login(cred) @table_creds << [ job_name, 'dns_sd_configs', uri.host, uri.port, username, password, '' ] end end |
#process_ec2_sd_configs(job_name, ec2_sd_configs) ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 167 def process_ec2_sd_configs(job_name, ec2_sd_configs) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = ec2_sd_configs['access_key'] cred[:private_data] = ec2_sd_configs['secret_key'] cred[:service_name] = '' create_credential_and_login(cred) @table_creds << [ job_name, 'ec2_sd_configs', '', '', ec2_sd_configs['access_key'], ec2_sd_configs['secret_key'], "Region: #{ec2_sd_configs['region']}, Profile: #{ec2_sd_configs['profile']}" ] end |
#process_embedded_uri(uri, job_name, config_name) ⇒ Object
processes a generic URI for creds
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 25 def (uri, job_name, config_name) uri = URI(uri) cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = uri.user cred[:private_data] = uri.password cred[:service_name] = uri.scheme create_credential_and_login(cred) @table_creds << [ job_name, config_name, uri.host, uri.port, uri.user, uri.password, '' ] end |
#process_eureka_sd_configs(job_name, eureka_sd_configs) ⇒ Object
273 274 275 276 277 278 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 273 def process_eureka_sd_configs(job_name, eureka_sd_configs) return if eureka_sd_configs['server'].nil? return unless eureka_sd_configs['server'].include? '@' (eureka_sd_configs['server'], job_name, 'eureka_sd_configs') end |
#process_hetzner_sd_configs(job_name, hetzner_sd_configs) ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 250 def process_hetzner_sd_configs(job_name, hetzner_sd_configs) username = hetzner_sd_configs.dig('basic_auth', 'username') password = hetzner_sd_configs.dig('basic_auth', 'password') username, password = (hetzner_sd_configs['authorization']) if hetzner_sd_configs.dig('authorization', 'credentials') cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = username cred[:private_data] = password create_credential_and_login(cred) @table_creds << [ job_name, 'hetzner_sd_configs', '', '', username, password, hetzner_sd_configs['role'] ] end |
#process_http_sd_configs(job_name, http_sd_configs) ⇒ Object
224 225 226 227 228 229 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 224 def process_http_sd_configs(job_name, http_sd_configs) return if http_sd_configs['url'].nil? return unless http_sd_configs['url'].include? '@' (http_sd_configs['url'], job_name, 'http_sd_configs') end |
#process_ionos_sd_configs(job_name, ionos_sd_configs) ⇒ Object
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 357 def process_ionos_sd_configs(job_name, ionos_sd_configs) _username, password = (ionos_sd_configs['authorization']) # we may hit an issue here where we have a type stored in username, but use datacenter_id # as the username cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = ionos_sd_configs['datacenter_id'] cred[:private_data] = password create_credential_and_login(cred) @table_creds << [ job_name, 'ionos_sd_configs', '', '', ionos_sd_configs['datacenter_id'], password, '' ] end |
#process_kubernetes_sd_configs(job_name, kubernetes_sd_configs) ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 107 def process_kubernetes_sd_configs(job_name, kubernetes_sd_configs) username = kubernetes_sd_configs.dig('basic_auth', 'username') password = kubernetes_sd_configs.dig('basic_auth', 'password') password = kubernetes_sd_configs.dig('basic_auth', 'password_file') if kubernetes_sd_configs.dig('basic_auth', 'password_file') uri = URI(kubernetes_sd_configs['api_server']) cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = username cred[:private_data] = password cred[:service_name] = uri.scheme create_credential_and_login(cred) @table_creds << [ job_name, 'kubernetes_sd_configs', uri.host, uri.port, username, password, "Role: #{kubernetes_sd_configs['role']}" ] end |
#process_kuma_sd_configs(job_name, targets) ⇒ Object
131 132 133 134 135 136 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 131 def process_kuma_sd_configs(job_name, targets) return if targets['server'].nil? return unless targets['server'].include? '@' (targets['server'], job_name, 'kuma_sd_configs') end |
#process_lightsail_sd_configs(job_name, lightsail_sd_configs) ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 186 def process_lightsail_sd_configs(job_name, lightsail_sd_configs) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = lightsail_sd_configs['access_key'] cred[:private_data] = lightsail_sd_configs['secret_key'] cred[:service_name] = '' create_credential_and_login(cred) @table_creds << [ job_name, 'lightsail_sd_configs', '', '', lightsail_sd_configs['access_key'], lightsail_sd_configs['secret_key'], "Region: #{lightsail_sd_configs['region']}, Profile: #{lightsail_sd_configs['profile']}" ] end |
#process_linode_sd_configs(job_name, linode_sd_configs) ⇒ Object
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 318 def process_linode_sd_configs(job_name, linode_sd_configs) username, password = (linode_sd_configs['authorization']) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = username cred[:private_data] = password create_credential_and_login(cred) @table_creds << [ job_name, 'linode_sd_configs', '', '', username, password, '' ] end |
#process_marathon_sd_configs(job_name, marathon_sd_configs) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 138 def process_marathon_sd_configs(job_name, marathon_sd_configs) marathon_sd_configs['servers']&.each do |servers| uri = URI(servers) cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = '' cred[:private_data] = marathon_sd_configs['auth_token'] cred[:service_name] = uri.scheme create_credential_and_login(cred) @table_creds << [ job_name, 'marathon_sd_configs', uri.host, uri.port, '', marathon_sd_configs['auth_token'], '' ] end end |
#process_nomad_sd_configs(job_name, targets) ⇒ Object
160 161 162 163 164 165 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 160 def process_nomad_sd_configs(job_name, targets) return if targets['server'].nil? return unless targets['server'].include? '@' (targets['server'], job_name, 'nomad_sd_configs') end |
#process_ovhcloud_sd_configs(job_name, ovhcloud_sd_configs) ⇒ Object
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 280 def process_ovhcloud_sd_configs(job_name, ovhcloud_sd_configs) cred = credential_data cred[:port] = '' cred[:address] = ovhcloud_sd_configs['endpoint'] cred[:username] = ovhcloud_sd_configs['application_key'] cred[:private_data] = ovhcloud_sd_configs['application_secret'] cred[:service_name] = ovhcloud_sd_configs['service'] create_credential_and_login(cred) @table_creds << [ job_name, 'ovhcloud_sd_configs', ovhcloud_sd_configs['endpoint'], '', ovhcloud_sd_configs['application_key'], ovhcloud_sd_configs['application_secret'], "Consumer Key: #{ovhcloud_sd_configs['consumer_key']}, Service: #{ovhcloud_sd_configs['service']}" ] end |
#process_results_page(page) ⇒ Object
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 561 def process_results_page(page) # data is in a strange 'label{optional_kv_hash-ish} value' format. return nil if page.nil? results = [] page.scan(/^(?<name>\w+)(?:{(?<labels>[^}]+)})? (?<value>[\w.+-]+)/).each do |hit| result = {} value = { 'value' => hit[2], 'labels' => {} } if hit[1] hit[1].scan(/(?<key>[^=]+?)="(?<value>[^"]*)",?/).each do |label| value['labels'][label[0]] = label[1] end end result[hit[0]] = value results.append(result) end return results end |
#process_scaleway_sd_configs(job_name, scaleway_sd_configs) ⇒ Object
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 299 def process_scaleway_sd_configs(job_name, scaleway_sd_configs) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = scaleway_sd_configs['access_key'] cred[:private_data] = scaleway_sd_configs['secret_key'] cred[:service_name] = scaleway_sd_configs['role'] create_credential_and_login(cred) @table_creds << [ job_name, 'scaleway_sd_configs', '', '', scaleway_sd_configs['access_key'], scaleway_sd_configs['secret_key'], "Project ID: #{scaleway_sd_configs['project_id']}, Role: #{scaleway_sd_configs['role']}" ] end |
#process_uyuni_sd_configs(job_name, uyuni_sd_configs) ⇒ Object
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 337 def process_uyuni_sd_configs(job_name, uyuni_sd_configs) uri = URI(uyuni_sd_configs['server']) cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = uyuni_sd_configs['username'] cred[:private_data] = uyuni_sd_configs['password'] cred[:service_name] = uri.scheme create_credential_and_login(cred) @table_creds << [ job_name, 'uyuni_sd_configs', uri.host, uri.port, uyuni_sd_configs['username'], uyuni_sd_configs['password'], '' ] end |
#process_vultr_sd_configs(job_name, vultr_sd_configs) ⇒ Object
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 378 def process_vultr_sd_configs(job_name, vultr_sd_configs) username, password = (vultr_sd_configs['authorization']) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = username cred[:private_data] = password create_credential_and_login(cred) @table_creds << [ job_name, 'vultr_sd_configs', '', '', username, password, '' ] end |
#prometheus_config_eater(yamlconf) ⇒ Object
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/msf/core/auxiliary/prometheus.rb', line 397 def prometheus_config_eater(yamlconf) @table_creds = Rex::Text::Table.new( 'Header' => 'Credentials', 'Indent' => 2, 'Columns' => [ 'Name', 'Config', 'Host', 'Port', 'Public/Username', 'Private/Password/Token', 'Notes' ] ) yamlconf['scrape_configs']&.each do |scrape| # check for targets which have creds built in to the URL if scrape['static_configs'] scrape['static_configs']&.each do |static| static['targets']&.each do |target| if target.include? '@' uri = URI(target) cred = credential_data cred[:port] = uri.port cred[:address] = uri.host cred[:username] = uri.user cred[:private_data] = uri.password cred[:service_name] = uri.scheme create_credential_and_login(cred) @table_creds << [ scrape['job_name'], 'static_configs Target', uri.host, uri.port, uri.user, uri.password, '' ] end end end elsif scrape['dns_sd_configs'] scrape['dns_sd_configs']&.each do |dns_sd_configs| # pass in basic_auth from the level above if dns_sd_configs['basic_auth'].nil? && scrape['basic_auth'] dns_sd_configs['basic_auth'] = {} dns_sd_configs['basic_auth']['username'] = scrape.dig('basic_auth', 'username') if scrape.dig('basic_auth', 'username') dns_sd_configs['basic_auth']['password'] = scrape.dig('basic_auth', 'password') if scrape.dig('basic_auth', 'password') dns_sd_configs['basic_auth']['password_file'] = scrape.dig('basic_auth', 'password_file') if scrape.dig('basic_auth', 'password_file') end # pass in the 'scheme' from a level above to properly build the URI if dns_sd_configs['scheme'].nil? && scrape['scheme'] dns_sd_configs['scheme'] = scrape['scheme'] end process_dns_sd_configs(scrape['job_name'], dns_sd_configs) end elsif scrape['consul_sd_configs'] scrape['consul_sd_configs']&.each do |consul_sd_configs| process_consul_sd_configs(scrape['job_name'], consul_sd_configs) end elsif scrape['authorization'] username, password = (scrape['authorization']) cred = credential_data cred[:port] = '' cred[:address] = '' cred[:username] = username cred[:private_data] = password create_credential_and_login(cred) @table_creds << [ scrape['job_name'], 'authorization', '', '', username, password, '' ] elsif scrape['kubernetes_sd_configs'] scrape['kubernetes_sd_configs']&.each do |kubernetes_sd_configs| next unless kubernetes_sd_configs['api_server'] # if scrape has basic auth, but the individual config doesn't # add it to the individual config if kubernetes_sd_configs['basic_auth'].nil? && scrape['basic_auth'] kubernetes_sd_configs['basic_auth'] = {} kubernetes_sd_configs['basic_auth']['username'] = scrape.dig('basic_auth', 'username') if scrape.dig('basic_auth', 'username') kubernetes_sd_configs['basic_auth']['password'] = scrape.dig('basic_auth', 'password') if scrape.dig('basic_auth', 'password') kubernetes_sd_configs['basic_auth']['password'] = scrape.dig('basic_auth', 'password_file') if scrape.dig('basic_auth', 'password_file') end process_kubernetes_sd_configs(scrape['job_name'], kubernetes_sd_configs) end elsif scrape['kuma_sd_configs'] scrape['kuma_sd_configs']&.each do |targets| process_kuma_sd_configs(scrape['job_name'], targets) end elsif scrape['marathon_sd_configs'] scrape['marathon_sd_configs']&.each do |marathon_sd_configs| process_marathon_sd_configs(scrape['job_name'], marathon_sd_configs) end elsif scrape['nomad_sd_configs'] scrape['nomad_sd_configs']&.each do |targets| process_nomad_sd_configs(scrape['job_name'], targets) end elsif scrape['ec2_sd_configs'] scrape['ec2_sd_configs']&.each do |ec2_sd_configs| process_ec2_sd_configs(scrape['job_name'], ec2_sd_configs) end elsif scrape['lightsail_sd_configs'] scrape['lightsail_sd_configs']&.each do |lightsail_sd_configs| process_lightsail_sd_configs(scrape['job_name'], lightsail_sd_configs) end elsif scrape['azure_sd_configs'] scrape['azure_sd_configs']&.each do |azure_sd_configs| process_azure_sd_configs(scrape['job_name'], azure_sd_configs) end elsif scrape['http_sd_configs'] scrape['http_sd_configs']&.each do |http_sd_configs| process_http_sd_configs(scrape['job_name'], http_sd_configs) end elsif scrape['digitalocean_sd_configs'] scrape['digitalocean_sd_configs']&.each do |digitalocean_sd_configs| process_digitalocean_sd_configs(scrape['job_name'], digitalocean_sd_configs) end elsif scrape['hetzner_sd_configs'] scrape['hetzner_sd_configs']&.each do |hetzner_sd_configs| process_hetzner_sd_configs(scrape['job_name'], hetzner_sd_configs) end elsif scrape['eureka_sd_configs'] scrape['eureka_sd_configs']&.each do |eureka_sd_configs| process_eureka_sd_configs(scrape['job_name'], eureka_sd_configs) end elsif scrape['ovhcloud_sd_configs'] scrape['ovhcloud_sd_configs']&.each do |ovhcloud_sd_configs| process_ovhcloud_sd_configs(scrape['job_name'], ovhcloud_sd_configs) end elsif scrape['scaleway_sd_configs'] scrape['scaleway_sd_configs']&.each do |scaleway_sd_configs| process_scaleway_sd_configs(scrape['job_name'], scaleway_sd_configs) end elsif scrape['linode_sd_configs'] scrape['linode_sd_configs']&.each do |linode_sd_configs| process_linode_sd_configs(scrape['job_name'], linode_sd_configs) end elsif scrape['uyuni_sd_configs'] scrape['uyuni_sd_configs']&.each do |uyuni_sd_configs| process_uyuni_sd_configs(scrape['job_name'], uyuni_sd_configs) end elsif scrape['ionos_sd_configs'] scrape['ionos_sd_configs']&.each do |ionos_sd_configs| process_ionos_sd_configs(scrape['job_name'], ionos_sd_configs) end elsif scrape['vultr_sd_configs'] scrape['vultr_sd_configs']&.each do |vultr_sd_configs| process_vultr_sd_configs(scrape['job_name'], vultr_sd_configs) end end end print_good(@table_creds.to_s) if !@table_creds.rows.empty? end |