pry-syslog 0.1.0 → 1.0.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 +4 -4
- data/README.md +25 -1
- data/lib/pry-syslog/version.rb +1 -1
- data/lib/pry-syslog.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c26780df8d5d63c6ad8782ed0a3963bd552a0c9
|
4
|
+
data.tar.gz: c230a4c04900c15074916371be94a059f27756b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6837aa8694dd31a3012cdd128f0d403900e8e7aae244bfc45b7cc1d1368216fe31f425778a66d1ca7d66120ae849a15c77688dd912a46dfcd232d68193ba9285
|
7
|
+
data.tar.gz: 439e20423e492207ea1e2f4ae4fbde7efaac3284bc3f8cfe5a452c2554040f0e487e37d2f12528a74a855ac9ce335a982885348547a04e58d64df7f2fa3e7a69
|
data/README.md
CHANGED
@@ -1,11 +1,23 @@
|
|
1
1
|
# PrySyslog
|
2
2
|
|
3
|
+
This Pry plugin was originally written to solve an auditing issue in production
|
4
|
+
instances. Using auditd we're able to log all commands executed, but that only
|
5
|
+
extends to the application that was executed (which for pry is ruby). Relying
|
6
|
+
exclusively on .pry_history files for auditing wasn't sufficient.
|
7
|
+
|
8
|
+
This gem will log all valid Ruby executed in a pry session to syslog at the
|
9
|
+
'info' message level on the 'local1' logging facility. Additionally the custom
|
10
|
+
app name of 'pry_history' will be used. This isn't currently configurable.
|
11
|
+
|
12
|
+
This plugin is non-invasive to anything pry related as it makes use of Pry's
|
13
|
+
native exposed hooks.
|
14
|
+
|
3
15
|
## Installation
|
4
16
|
|
5
17
|
Add this line to your application's Gemfile:
|
6
18
|
|
7
19
|
```ruby
|
8
|
-
gem '
|
20
|
+
gem 'pry-syslog'
|
9
21
|
```
|
10
22
|
|
11
23
|
And then execute:
|
@@ -18,6 +30,18 @@ Or install it yourself as:
|
|
18
30
|
|
19
31
|
## Usage
|
20
32
|
|
33
|
+
When this gem is installed anytime Pry gets executed from any context it will
|
34
|
+
automatically detect and load this plugin. When this happens you will see a
|
35
|
+
note like the following indicating the session is being logged:
|
36
|
+
|
37
|
+
```
|
38
|
+
[user@host ~/] $ pry
|
39
|
+
Please note: This interactive session has PrySyslog enabled. All
|
40
|
+
valid Ruby entered here will be sent to Syslog before being executed
|
41
|
+
for auditing purposes.
|
42
|
+
[1] pry(main)>
|
43
|
+
```
|
44
|
+
|
21
45
|
## Contributing
|
22
46
|
|
23
47
|
I welcome new ideas, bug fixes and comments from anyone and strive to take no
|
data/lib/pry-syslog/version.rb
CHANGED
data/lib/pry-syslog.rb
CHANGED
@@ -5,7 +5,9 @@ require 'syslog/logger'
|
|
5
5
|
# Parent namespace of the pry-syslog gem.
|
6
6
|
module PrySyslog
|
7
7
|
def self.announce_logging
|
8
|
-
puts '
|
8
|
+
puts 'Please note: This interactive session has PrySyslog enabled. All'
|
9
|
+
puts 'valid Ruby entered here will be sent to Syslog before being executed'
|
10
|
+
puts 'for auditing purposes.'
|
9
11
|
end
|
10
12
|
|
11
13
|
def self.log_code_execution(code)
|