<commit_before>#!/usr/bin/env ruby
# frozen_string_literal: true

script_path = File.absolute_path(__FILE__).sub!(Dir.pwd + "/", "")
File.open(File.expand_path("~/.paas-script-usage"), "a") { |f| f.puts script_path }

require_relative "upload_secrets.rb"

credhub_namespaces = [
  "/concourse/main/create-cloudfoundry",
]

csls_kinesis_destination_arn = `pass "cyber/${MAKEFILE_ENV_TARGET}/csls_kinesis_destination_arn"`

upload_secrets(
  credhub_namespaces,
  "cyber_csls_kinesis_destination_arn" => csls_kinesis_destination_arn,
)<commit_msg>Upload Splunk -> CSLS broker secrets<commit_after>#!/usr/bin/env ruby
# frozen_string_literal: true

script_path = File.absolute_path(__FILE__).sub!(Dir.pwd + "/", "")
File.open(File.expand_path("~/.paas-script-usage"), "a") { |f| f.puts script_path }

require_relative "upload_secrets.rb"

credhub_namespaces = [
  "/concourse/main/create-cloudfoundry",
]

secrets = {}

csls_kinesis_destination_arn = `pass "cyber/${MAKEFILE_ENV_TARGET}/csls_kinesis_destination_arn"`
secrets["cyber_csls_kinesis_destination_arn"] = csls_kinesis_destination_arn

if ENV["MAKEFILE_ENV_TARGET"].start_with?("prod")
  csls_splunk_broker_url = `pass "cyber/${MAKEFILE_ENV_TARGET}/csls_broker_url"`
  csls_splunk_broker_username = `pass "cyber/${MAKEFILE_ENV_TARGET}/csls_broker_username"`
  csls_splunk_broker_password = `pass "cyber/${MAKEFILE_ENV_TARGET}/csls_broker_password"`

  secrets["csls_splunk_broker_url"] = csls_splunk_broker_url
  secrets["csls_splunk_broker_username"] = csls_splunk_broker_username
  secrets["csls_splunk_broker_password"] = <PASSWORD>
else
  puts "Skipping CSLS -> Splunk broker credentials because the environment \"#{ENV['MAKEFILE_ENV_TARGET']}\" does not start with \"prod\""
end

upload_secrets(
  credhub_namespaces,
  secrets,
)
{'fraction_non_alphanumeric': 0.1328125, 'fraction_numerical': 0.0, 'mean_word_length': 7.417840375586854, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5705745', 'n_tokens_mistral': 706, 'n_tokens_neox': 696, 'n_words': 84}