security-gem 0.1.1 → 0.1.4

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.
data/xss_payloads.txt ADDED
@@ -0,0 +1 @@
1
+ <script>alert(0)</script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: security-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - tuckerweibell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -28,9 +28,12 @@ files:
28
28
  - bin/setup
29
29
  - file.json
30
30
  - lib/security/gem.rb
31
- - lib/security/gem/builder.rb
31
+ - lib/security/gem/security.rb
32
32
  - lib/security/gem/version.rb
33
+ - lib/security/test.rb
33
34
  - security-gem.gemspec
35
+ - sql_payloads.txt
36
+ - xss_payloads.txt
34
37
  homepage: https://github.com/tuckerweibell/security-gem
35
38
  licenses:
36
39
  - MIT
@@ -1,45 +0,0 @@
1
- require 'json'
2
- require 'logger'
3
- require 'logger/formatter'
4
- require 'net/http'
5
- require 'open-uri'
6
-
7
-
8
-
9
- module SecurityLogger
10
-
11
- #Create logs used for SQL Injection detections
12
- class Sql_Injection
13
- def initialize
14
-
15
- end
16
-
17
- def log(input)
18
- logger = Logger.new(STDOUT)
19
- logger.formatter = proc do |severity, datetime, progname, msg|
20
- {
21
- severity: severity,
22
- timestamp: datetime.to_s,
23
- app: progname,
24
- message: msg
25
- }.to_json + $/
26
- end
27
-
28
- error = {:input => input}
29
- logger.warn(JSON.parse(error.to_json))
30
- end
31
-
32
- def check_input(input)
33
- uri = "https://raw.githubusercontent.com/tuckerweibell/security-gem/main/payloads.txt"
34
- uri = URI(uri)
35
- file = Net::HTTP.get(uri)
36
- file.each_line do |file|
37
- if file.strip == input.strip
38
- self.log(input.strip)
39
- break
40
- end
41
- end
42
-
43
- end
44
- end
45
- end