security-gem 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a26fb66b43cfdd016ff96a3a4ed93ae3d081415b64b18e71d54af3f34d56846
4
- data.tar.gz: 6bee7e2b0bcb7f26af85231acb44ebdce7aeab9341b2ab356de1b42dd699b346
3
+ metadata.gz: 1e19b4ce5337fef141ece0c5db7d4b76031f6171065a9fee2ff1444692b3c2de
4
+ data.tar.gz: 85b6afc1258a32aa7ce7c61a8b465384630bb0838122b6d2d19e2cd2a270c5ae
5
5
  SHA512:
6
- metadata.gz: 95874177dc445745fb5568d61cd2a3e82c4eab9c84b7d37a9493ce0536f2e9d3ccb6375887110045c2858c317175e98d247116d58648bd4674490f0362a2685c
7
- data.tar.gz: d261adc97b689f58ad7014a3008dcee56dea8afd432cf1076962f8c256e3f0799221166cea1739985cfb4c42051d07e68031ebcbf55553abda6b623a8b166c6d
6
+ metadata.gz: b3f5b0d39f1b9f2a88f8a573881dad6e2cc265706e2fad78501c2d338f3cd431c9886f5ac60c8fd70af55aca6fc28aff5ac5c458d86512f2b3c6ba053ca003c8
7
+ data.tar.gz: 1a8a91cc11c917bf651c8675f90a16db7c5833ce9830eb8424647ea67095ce6f7089dd631cf7c6e0239be8f470a42dd8ce7072ebb31becb7e6cb47bf173558f1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- security-gem (0.1.2)
4
+ security-gem (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -10,8 +10,8 @@ module SecurityLogger
10
10
 
11
11
  #Create logs used for SQL Injection detections
12
12
  class Sql_Injection
13
- def initialize
14
-
13
+ def initialize (ip_origin:)
14
+ @ip_origin = ip_origin
15
15
  end
16
16
 
17
17
  def log(input)
@@ -25,7 +25,7 @@ module SecurityLogger
25
25
  }.to_json + $/
26
26
  end
27
27
 
28
- error = {:input => input, :ip_origin => request.ip}
28
+ error = {:input => input, :ip_origin => @ip_origin}
29
29
  logger.warn(JSON.parse(error.to_json))
30
30
  end
31
31
 
@@ -38,7 +38,7 @@ module SecurityLogger
38
38
  self.log(input.strip)
39
39
  break
40
40
  end
41
- end
41
+ end
42
42
 
43
43
  end
44
44
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Security
4
4
  module Gem
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/security/test.rb CHANGED
@@ -4,4 +4,4 @@ require_relative "gem/builder"
4
4
  input = "or 1=1"
5
5
 
6
6
  # Using the gem to log injection attempts
7
- SecurityLogger::Sql_Injection.new().check_input(input)
7
+ SecurityLogger::Sql_Injection.new(ip_origin: "123.123.123.1").check_input(input)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: security-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tuckerweibell