sqreen 0.1.0.pre → 0.7.01461158029

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CODE_OF_CONDUCT.md +22 -0
  3. data/README.md +77 -0
  4. data/Rakefile +40 -0
  5. data/lib/sqreen.rb +67 -0
  6. data/lib/sqreen/binding_accessor.rb +184 -0
  7. data/lib/sqreen/ca.crt +72 -0
  8. data/lib/sqreen/callback_tree.rb +78 -0
  9. data/lib/sqreen/callbacks.rb +120 -0
  10. data/lib/sqreen/capped_queue.rb +23 -0
  11. data/lib/sqreen/condition_evaluator.rb +169 -0
  12. data/lib/sqreen/conditionable.rb +50 -0
  13. data/lib/sqreen/configuration.rb +151 -0
  14. data/lib/sqreen/context.rb +22 -0
  15. data/lib/sqreen/deliveries/batch.rb +80 -0
  16. data/lib/sqreen/deliveries/simple.rb +36 -0
  17. data/lib/sqreen/detect.rb +14 -0
  18. data/lib/sqreen/detect/shell_injection.rb +61 -0
  19. data/lib/sqreen/detect/sql_injection.rb +115 -0
  20. data/lib/sqreen/event.rb +16 -0
  21. data/lib/sqreen/events/attack.rb +60 -0
  22. data/lib/sqreen/events/remote_exception.rb +53 -0
  23. data/lib/sqreen/exception.rb +31 -0
  24. data/lib/sqreen/frameworks.rb +40 -0
  25. data/lib/sqreen/frameworks/generic.rb +243 -0
  26. data/lib/sqreen/frameworks/rails.rb +155 -0
  27. data/lib/sqreen/frameworks/rails3.rb +36 -0
  28. data/lib/sqreen/frameworks/sinatra.rb +34 -0
  29. data/lib/sqreen/frameworks/sqreen_test.rb +26 -0
  30. data/lib/sqreen/instrumentation.rb +504 -0
  31. data/lib/sqreen/log.rb +116 -0
  32. data/lib/sqreen/metrics.rb +6 -0
  33. data/lib/sqreen/metrics/average.rb +39 -0
  34. data/lib/sqreen/metrics/base.rb +41 -0
  35. data/lib/sqreen/metrics/collect.rb +22 -0
  36. data/lib/sqreen/metrics/sum.rb +20 -0
  37. data/lib/sqreen/metrics_store.rb +94 -0
  38. data/lib/sqreen/parsers/sql.rb +98 -0
  39. data/lib/sqreen/parsers/sql_tokenizer.rb +266 -0
  40. data/lib/sqreen/parsers/unix.rb +110 -0
  41. data/lib/sqreen/payload_creator.rb +132 -0
  42. data/lib/sqreen/performance_notifications.rb +86 -0
  43. data/lib/sqreen/performance_notifications/log.rb +36 -0
  44. data/lib/sqreen/performance_notifications/metrics.rb +36 -0
  45. data/lib/sqreen/performance_notifications/newrelic.rb +36 -0
  46. data/lib/sqreen/remote_command.rb +82 -0
  47. data/lib/sqreen/rule_attributes.rb +25 -0
  48. data/lib/sqreen/rule_callback.rb +97 -0
  49. data/lib/sqreen/rules.rb +116 -0
  50. data/lib/sqreen/rules_callbacks.rb +29 -0
  51. data/lib/sqreen/rules_callbacks/binding_accessor_metrics.rb +79 -0
  52. data/lib/sqreen/rules_callbacks/count_http_codes.rb +18 -0
  53. data/lib/sqreen/rules_callbacks/crawler_user_agent_matches.rb +24 -0
  54. data/lib/sqreen/rules_callbacks/crawler_user_agent_matches_metrics.rb +25 -0
  55. data/lib/sqreen/rules_callbacks/execjs.rb +136 -0
  56. data/lib/sqreen/rules_callbacks/headers_insert.rb +20 -0
  57. data/lib/sqreen/rules_callbacks/inspect_rule.rb +20 -0
  58. data/lib/sqreen/rules_callbacks/matcher_rule.rb +103 -0
  59. data/lib/sqreen/rules_callbacks/rails_parameters.rb +14 -0
  60. data/lib/sqreen/rules_callbacks/record_request_context.rb +23 -0
  61. data/lib/sqreen/rules_callbacks/reflected_xss.rb +40 -0
  62. data/lib/sqreen/rules_callbacks/regexp_rule.rb +36 -0
  63. data/lib/sqreen/rules_callbacks/shell.rb +33 -0
  64. data/lib/sqreen/rules_callbacks/shell_env.rb +32 -0
  65. data/lib/sqreen/rules_callbacks/sql.rb +41 -0
  66. data/lib/sqreen/rules_callbacks/system_shell.rb +25 -0
  67. data/lib/sqreen/rules_callbacks/url_matches.rb +25 -0
  68. data/lib/sqreen/rules_callbacks/user_agent_matches.rb +22 -0
  69. data/lib/sqreen/rules_signature.rb +142 -0
  70. data/lib/sqreen/runner.rb +312 -0
  71. data/lib/sqreen/runtime_infos.rb +127 -0
  72. data/lib/sqreen/session.rb +340 -0
  73. data/lib/sqreen/stats.rb +18 -0
  74. data/lib/sqreen/version.rb +6 -0
  75. metadata +95 -34
@@ -0,0 +1,18 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
+
4
+ module Sqreen
5
+ @@stats = nil
6
+
7
+ def self::stats
8
+ @@stats ||= Stats.new
9
+ end
10
+
11
+ class Stats
12
+ attr_accessor :callbacks_calls
13
+
14
+ def initialize
15
+ @callbacks_calls = 0
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,6 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
+ # Warning This file is auto generated! DO NOT edit.
4
+ module Sqreen
5
+ VERSION = "0.7.01461158029".freeze
6
+ end
metadata CHANGED
@@ -1,65 +1,126 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre
4
+ version: 0.7.01461158029
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-18 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: execjs
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
20
- type: :development
19
+ version: 0.3.0
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: 0.3.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: therubyracer
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
33
+ version: '0'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  description: Sqreen agent to protect Ruby applications
42
- email:
43
- - contact@sqreen.io
42
+ email: contact@sqreen.io
44
43
  executables: []
45
44
  extensions: []
46
45
  extra_rdoc_files: []
47
- files: []
46
+ files:
47
+ - CODE_OF_CONDUCT.md
48
+ - README.md
49
+ - Rakefile
50
+ - lib/sqreen.rb
51
+ - lib/sqreen/binding_accessor.rb
52
+ - lib/sqreen/ca.crt
53
+ - lib/sqreen/callback_tree.rb
54
+ - lib/sqreen/callbacks.rb
55
+ - lib/sqreen/capped_queue.rb
56
+ - lib/sqreen/condition_evaluator.rb
57
+ - lib/sqreen/conditionable.rb
58
+ - lib/sqreen/configuration.rb
59
+ - lib/sqreen/context.rb
60
+ - lib/sqreen/deliveries/batch.rb
61
+ - lib/sqreen/deliveries/simple.rb
62
+ - lib/sqreen/detect.rb
63
+ - lib/sqreen/detect/shell_injection.rb
64
+ - lib/sqreen/detect/sql_injection.rb
65
+ - lib/sqreen/event.rb
66
+ - lib/sqreen/events/attack.rb
67
+ - lib/sqreen/events/remote_exception.rb
68
+ - lib/sqreen/exception.rb
69
+ - lib/sqreen/frameworks.rb
70
+ - lib/sqreen/frameworks/generic.rb
71
+ - lib/sqreen/frameworks/rails.rb
72
+ - lib/sqreen/frameworks/rails3.rb
73
+ - lib/sqreen/frameworks/sinatra.rb
74
+ - lib/sqreen/frameworks/sqreen_test.rb
75
+ - lib/sqreen/instrumentation.rb
76
+ - lib/sqreen/log.rb
77
+ - lib/sqreen/metrics.rb
78
+ - lib/sqreen/metrics/average.rb
79
+ - lib/sqreen/metrics/base.rb
80
+ - lib/sqreen/metrics/collect.rb
81
+ - lib/sqreen/metrics/sum.rb
82
+ - lib/sqreen/metrics_store.rb
83
+ - lib/sqreen/parsers/sql.rb
84
+ - lib/sqreen/parsers/sql_tokenizer.rb
85
+ - lib/sqreen/parsers/unix.rb
86
+ - lib/sqreen/payload_creator.rb
87
+ - lib/sqreen/performance_notifications.rb
88
+ - lib/sqreen/performance_notifications/log.rb
89
+ - lib/sqreen/performance_notifications/metrics.rb
90
+ - lib/sqreen/performance_notifications/newrelic.rb
91
+ - lib/sqreen/remote_command.rb
92
+ - lib/sqreen/rule_attributes.rb
93
+ - lib/sqreen/rule_callback.rb
94
+ - lib/sqreen/rules.rb
95
+ - lib/sqreen/rules_callbacks.rb
96
+ - lib/sqreen/rules_callbacks/binding_accessor_metrics.rb
97
+ - lib/sqreen/rules_callbacks/count_http_codes.rb
98
+ - lib/sqreen/rules_callbacks/crawler_user_agent_matches.rb
99
+ - lib/sqreen/rules_callbacks/crawler_user_agent_matches_metrics.rb
100
+ - lib/sqreen/rules_callbacks/execjs.rb
101
+ - lib/sqreen/rules_callbacks/headers_insert.rb
102
+ - lib/sqreen/rules_callbacks/inspect_rule.rb
103
+ - lib/sqreen/rules_callbacks/matcher_rule.rb
104
+ - lib/sqreen/rules_callbacks/rails_parameters.rb
105
+ - lib/sqreen/rules_callbacks/record_request_context.rb
106
+ - lib/sqreen/rules_callbacks/reflected_xss.rb
107
+ - lib/sqreen/rules_callbacks/regexp_rule.rb
108
+ - lib/sqreen/rules_callbacks/shell.rb
109
+ - lib/sqreen/rules_callbacks/shell_env.rb
110
+ - lib/sqreen/rules_callbacks/sql.rb
111
+ - lib/sqreen/rules_callbacks/system_shell.rb
112
+ - lib/sqreen/rules_callbacks/url_matches.rb
113
+ - lib/sqreen/rules_callbacks/user_agent_matches.rb
114
+ - lib/sqreen/rules_signature.rb
115
+ - lib/sqreen/runner.rb
116
+ - lib/sqreen/runtime_infos.rb
117
+ - lib/sqreen/session.rb
118
+ - lib/sqreen/stats.rb
119
+ - lib/sqreen/version.rb
48
120
  homepage: https://www.sqreen.io/
49
121
  licenses: []
50
- metadata:
51
- allowed_push_host: https://rubygems.org
52
- post_install_message: |+
53
- This is a placeholder for the upcoming Sqreen gem.
54
-
55
- If you are one of our beta users, please refer to the invitation email you
56
- received to setup Sqreen, or contact us (support@sqreen.io).
57
-
58
- If you would like to receive an access to the Sqreen beta program, please
59
- contact us (contact@sqreen.io).
60
-
61
- https://www.sqreen.io/
62
-
122
+ metadata: {}
123
+ post_install_message:
63
124
  rdoc_options: []
64
125
  require_paths:
65
126
  - lib
@@ -70,12 +131,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
131
  version: '0'
71
132
  required_rubygems_version: !ruby/object:Gem::Requirement
72
133
  requirements:
73
- - - ">"
134
+ - - ">="
74
135
  - !ruby/object:Gem::Version
75
- version: 1.3.1
136
+ version: '0'
76
137
  requirements: []
77
138
  rubyforge_project:
78
- rubygems_version: 2.4.5
139
+ rubygems_version: 2.6.2
79
140
  signing_key:
80
141
  specification_version: 4
81
142
  summary: Sqreen Ruby agent