appdefender 0.4.0
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 +7 -0
- data/Gemfile +7 -0
- data/LICENSE +1 -0
- data/README.md +63 -0
- data/Rakefile +4 -0
- data/appdefender.gemspec +26 -0
- data/lib/appdefender/version.rb +5 -0
- data/lib/appdefender/version.rb.in +5 -0
- data/lib/appdefender.rb +45 -0
- data/lib/libcore.aarch64.gnu.so +0 -0
- data/lib/libcore.aarch64.musl.so +0 -0
- data/lib/libcore.x86_64.gnu.so +0 -0
- data/lib/libcore.x86_64.musl.so +0 -0
- metadata +71 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 88a6cdc262aa7c7161a6f1b8dc58cf895580bf03f4c27d8cf3f91189e5850892
|
4
|
+
data.tar.gz: 0b1baf553d4898f3f6c8bd532a91c9f5007f0e4cfeb23d1895c4b1ca8bdb8b73
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f1a123edde99bd9322c13bbf57815736605fba82df225ef7897999d112bec4fd34de1732e7e136d600c9105f0a33744ef327962fab47ae729e3306f1ea7566c7
|
7
|
+
data.tar.gz: a2cadbba456573f047f23dd47cfe03750f9e5f9a4b4b1f8cdc61cd40ccc1c3d87c599e9f03315c5428cc3543cb3942861f10041503aceaddafe3446ee36f477a
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Copyright (c) 2023 Extrinsec LLC. All Rights Reserved
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
<a href="https://www.extrinsec.com">
|
2
|
+
<picture>
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.extrinsec.com/images/logos/logo-exsec-dark.png#gh-dark-mod-only">
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://cdn.extrinsec.com/images/logos/logo-exsec-light.png#gh-light-mode-only">
|
5
|
+
<img alt="Learn more about how Extrinsec secures and protects your Ruby applications"/>
|
6
|
+
</picture>
|
7
|
+
</a>
|
8
|
+
|
9
|
+
Real time serverless security platform for [Ruby](https://www.ruby-lang.org).
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
# set required environment variable ES_POLICY_GROUP_NAME as provided or configured in your app, e.g.
|
13
|
+
# ENV["ES_POLICY_GROUP_NAME"] = "observeAll.ability";
|
14
|
+
|
15
|
+
# load the appdefender module
|
16
|
+
require 'appdefender'
|
17
|
+
```
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
Add this line to your application's Gemfile:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'appdefender'
|
25
|
+
```
|
26
|
+
|
27
|
+
And then execute:
|
28
|
+
|
29
|
+
```console
|
30
|
+
$ bundle install
|
31
|
+
```
|
32
|
+
|
33
|
+
Or install it yourself as:
|
34
|
+
|
35
|
+
```console
|
36
|
+
$ gem install appDefender
|
37
|
+
```
|
38
|
+
|
39
|
+
It is recommended that you register an account on https://app.extrinsec.com/ and configure your own policy rules for the best protection.
|
40
|
+
|
41
|
+
## Features
|
42
|
+
|
43
|
+
- Quick and simple setup
|
44
|
+
- **Observe**, **Deny** or **Grant** any combination of the following
|
45
|
+
- outbound network data
|
46
|
+
- read/write tmp or app directories
|
47
|
+
- create/spawn child processes
|
48
|
+
- Option to terminate process for policy violations
|
49
|
+
- Ability to whitelist domains
|
50
|
+
- Fast & Reliable, no wrapping or monkey-patching of your code
|
51
|
+
- Easy collaboration between dev and ops teams with role based access
|
52
|
+
- View all events centrally in the web application
|
53
|
+
|
54
|
+
## Docs & Community
|
55
|
+
|
56
|
+
- [Website](https://www.extrinsec.com/)
|
57
|
+
- [App](https://app.extrinsec.com/)
|
58
|
+
- [FAQ](https://www.extrinsec.com/faq)
|
59
|
+
- Community Support
|
60
|
+
|
61
|
+
## License
|
62
|
+
|
63
|
+
© Copyright 2023 Extrinsec LLC, all rights reserved.
|
data/Rakefile
ADDED
data/appdefender.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/appdefender/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "appdefender"
|
7
|
+
spec.version = AppDefender::VERSION
|
8
|
+
spec.authors = ["Extrinsec LLC"]
|
9
|
+
spec.email = ["support@extrinsec.com"]
|
10
|
+
|
11
|
+
spec.summary = "Real time serverless protection"
|
12
|
+
spec.description = "see README.md"
|
13
|
+
spec.homepage = "https://www.extrinsec.com"
|
14
|
+
spec.license = "Nonstandard"
|
15
|
+
spec.required_ruby_version = ">= 2.4.0"
|
16
|
+
|
17
|
+
# spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
+
spec.metadata["github_repo"] = "ssh://github.com/extrinsec/mono"
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
|
22
|
+
spec.files = Dir['lib/**/*'] + %w(appdefender.gemspec Gemfile LICENSE Rakefile README.md)
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_dependency "ffi", "1.15.5"
|
26
|
+
end
|
data/lib/appdefender.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ffi'
|
4
|
+
require 'json'
|
5
|
+
require 'rbconfig'
|
6
|
+
|
7
|
+
require_relative 'appdefender/version'
|
8
|
+
|
9
|
+
module AppDefenderCLib
|
10
|
+
extend FFI::Library
|
11
|
+
|
12
|
+
# set environment variables
|
13
|
+
ENV['ES_RUNTIME_LANGUAGE'] = 'RUBY'
|
14
|
+
ENV['ES_RUNTIME_LANGUAGE_VERSION'] = RUBY_VERSION
|
15
|
+
ENV['ES_APP_DIR'] = Dir.pwd
|
16
|
+
ENV['ES_SDK_VERSION'] = AppDefender::VERSION
|
17
|
+
|
18
|
+
arch = RbConfig::CONFIG['host_cpu']
|
19
|
+
libc = RbConfig::CONFIG['host_os'] == 'linux-musl' ? 'musl' : 'gnu'
|
20
|
+
puts("[INFO] [appDefender] Ruby SDK loading: #{__dir__}/libcore.#{arch}.#{libc}.so")
|
21
|
+
ffi_lib (__dir__ + "/libcore.#{arch}.#{libc}.so")
|
22
|
+
end
|
23
|
+
|
24
|
+
module AppDefender
|
25
|
+
def self.supported()
|
26
|
+
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")
|
27
|
+
provider_envs = [
|
28
|
+
'AWS_EXECUTION_ENV', # AWS Lambda
|
29
|
+
'K_SERVICE', # Google Cloud Functions
|
30
|
+
'FUNCTION_TARGET', # Google Cloud Functions
|
31
|
+
'FUNCTIONS_WORKER_RUNTIME', # Azure
|
32
|
+
]
|
33
|
+
archs = ["x86_64", "arm64", "aarch64" ]
|
34
|
+
RbConfig::CONFIG['host_os'] =~ /linux/ && archs.include?(RbConfig::CONFIG['host_cpu']) && provider_envs.any? {|env| !ENV[env].nil? && !ENV[env].empty? }
|
35
|
+
end
|
36
|
+
|
37
|
+
if !supported()
|
38
|
+
err_msg = '"[ERROR] [appDefender] only Linux x64/arm64 systems on AWS Lambdas, Google Cloud Functions, or Azure Functions are supported."'
|
39
|
+
puts(err_msg)
|
40
|
+
raise err_msg
|
41
|
+
else
|
42
|
+
puts("[INFO] [appDefender] Ruby SDK version: " + AppDefender::VERSION)
|
43
|
+
include AppDefenderCLib;
|
44
|
+
end
|
45
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: appdefender
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Extrinsec LLC
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-02-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ffi
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.15.5
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.15.5
|
27
|
+
description: see README.md
|
28
|
+
email:
|
29
|
+
- support@extrinsec.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- Gemfile
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
38
|
+
- appdefender.gemspec
|
39
|
+
- lib/appdefender.rb
|
40
|
+
- lib/appdefender/version.rb
|
41
|
+
- lib/appdefender/version.rb.in
|
42
|
+
- lib/libcore.aarch64.gnu.so
|
43
|
+
- lib/libcore.aarch64.musl.so
|
44
|
+
- lib/libcore.x86_64.gnu.so
|
45
|
+
- lib/libcore.x86_64.musl.so
|
46
|
+
homepage: https://www.extrinsec.com
|
47
|
+
licenses:
|
48
|
+
- Nonstandard
|
49
|
+
metadata:
|
50
|
+
github_repo: ssh://github.com/extrinsec/mono
|
51
|
+
homepage_uri: https://www.extrinsec.com
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 2.4.0
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubygems_version: 3.1.6
|
68
|
+
signing_key:
|
69
|
+
specification_version: 4
|
70
|
+
summary: Real time serverless protection
|
71
|
+
test_files: []
|