Initial commit (history cleared)
CI / test (3.4.1) (push) Has been cancelled

This commit is contained in:
2026-04-29 11:21:39 +01:00
commit 298610b5f6
277 changed files with 30877 additions and 0 deletions
View File
+37
View File
@@ -0,0 +1,37 @@
# frozen_string_literal: true
module Encryption
# Added a re-usable encryption routine, shouldn't be an issue!
def self.encrypt_sensitive_value(val = "")
aes = OpenSSL::Cipher.new(cipher_type)
aes.encrypt
aes.key = key[0..31]
aes.iv = iv[0..15] if iv != nil
new_val = aes.update("#{val}") + aes.final
Base64.strict_encode64(new_val).encode("utf-8")
end
def self.decrypt_sensitive_value(val = "")
aes = OpenSSL::Cipher.new(cipher_type)
aes.decrypt
aes.key = key[0..31]
aes.iv = iv[0..15] if iv != nil
decoded = Base64.strict_decode64("#{val}")
aes.update("#{decoded}") + aes.final
end
# Should be able to just re-use the same key we already have!
def self.key
raise "Key Missing. Add one in initializers/key.rb" if !(KEY)
KEY
end
def self.iv
RG_IV
end
def self.cipher_type
"aes-256-cbc"
end
end
+23
View File
@@ -0,0 +1,23 @@
# frozen_string_literal: true
namespace :server do
desc "Start Rails"
task :start do
pid_file = "tmp/pids/server.pid"
if !(File.exist?(pid_file))
sh("rails s -d")
else
puts "[+] Server is already running"
end
end
desc "Stop Rails"
task :stop do
pid_file = "tmp/pids/server.pid"
if File.exist?(pid_file)
Process.kill("INT", File.read(pid_file).to_i)
else
puts "[-] Server isn't running"
end
end
end
+5
View File
@@ -0,0 +1,5 @@
# frozen_string_literal: true
desc "run training tests"
task :training do
Rake::Task["spec:vulnerabilities"].invoke
end