Module: AppDefender

Includes:
AppDefenderCLib
Defined in:
lib/appdefender.rb,
lib/appdefender/version.rb

Constant Summary collapse

VERSION =
"0.4.3"

Class Method Summary collapse

Class Method Details

.supportedObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/appdefender.rb', line 25

def self.supported()
  raise '"[ERROR] appDefender SDK cannot be used together with the appDefender AWS Lambda extension."' if ENV['AWS_LAMBDA_EXEC_WRAPPER'] && ENV['AWS_LAMBDA_EXEC_WRAPPER'].include?("extrinsec-appdefender")
  provider_envs = [
    'AWS_EXECUTION_ENV',        # AWS Lambda
    'K_SERVICE',                # Google Cloud Functions
    'FUNCTION_TARGET',          # Google Cloud Functions
    'FUNCTIONS_WORKER_RUNTIME', # Azure
    'CATALYST_RESOURCE_ID',     # Zoho
    '__OW_ACTION_NAME',         # DigitalOcean/OpenWhisk
    'ES_APP_NAME',
  ]
  archs = ["x86_64", "arm64", "aarch64" ]
  RbConfig::CONFIG['host_os'] =~ /linux/ && archs.include?(RbConfig::CONFIG['host_cpu']) && provider_envs.any? {|env| !ENV[env].nil? && !ENV[env].empty? }
end