This gem is a collection of useful tools for auditing data and performing security checks.
$ gem install security_guard
As part of your application
Add this line to your application's Gemfile:
And then execute:
There is an
sguard command if you intend to use security_guard as a command line tool. Please refer to the help option for its usage.
You can pass in setters during initialisation, for example:
country_ips = SecurityGuard::CountryIps.new country_ips.countries = ['Australia', 'United Kingdom'] country_ips.ips = ['184.108.40.206', '220.127.116.11', '18.104.22.168'] # the above is equivalent to: country_ips = SecurityGuard::CountryIps.new( :countries => ['Australia', 'United Kingdom'], :ips => ['22.214.171.124', '126.96.36.199', '188.8.131.52'] )
Returns a list of the IPs from given country and IP dictionaries. Useful for auditing IPs from higher risk nations.
SecurityGuard::CountryIps.new( :countries => ['Australia'], :ips => ['184.108.40.206', '220.127.116.11', '18.104.22.168'] ).result # => ['22.214.171.124']
You may also pass country and IP data as a line-delimited file by appending
_from_file at the end of the attributes:
country_ips.countries_from_file = '/path/to/the/file' country_ips.ips_from_file = '/path/to/the/file'
Deduplicates line-delimited content contained within a list of files. Useful for deduplicating email newsletter subscription lists.
SecurityGuard::Deduplication.new( :input_folder => '/path/to/the/input/folder', :output_folder => '/path/to/the/output/folder' ).process
Prepends line-delimited content with a comma-delimited sequence column (1, 2, 3...) for counting.
SecurityGuard::Sequences.new( :input_folder => '/path/to/the/input/folder', :output_folder => '/path/to/the/output/folder' ).process
- Output file names are now automatically mapped from the input file names
- Fixed the file ordering issue on some OSes like Linux
- Fixed the non-existing
specs/tmpdirectory that causes specs to fail
- Added IP address sanity check
- Coloured test output
- Added changelog
- First release, implemented
- Fork it
- Make sure you add documentation to README.md
- Make sure you test all your code
- Do your magic!
- Create a new Pull Request
Brought to you by SitePoint.