s3_sec 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 64499aecac5964b720d63f79831f3e04abcbef51d27e342b39806109cb8112b3
4
+ data.tar.gz: 81c25d6302ebbd51d41f93deda519b52f7d1e3c4cfc43faa7c44c6b392d8bada
5
+ SHA512:
6
+ metadata.gz: 6d2ca0c5695e048cbfc8fd1dbcd9d22bfc78a61ed8d72a6d5427a16bc72a63c67bcf4d5a7582573ccd386a3c9d8818b55eeb9a0a1b17b3e4220a7545a896b65f
7
+ data.tar.gz: fab83ee3e83d83a00e12b655641f91ae7640db6c2e547856c539fc817eb441687843d8c1f3210d8fb3c911746bbefa12a0685cb73263b5855d98509017d94750
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .DS_Store
10
+ config.yml
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.s3sec.yml ADDED
@@ -0,0 +1,3 @@
1
+ ---
2
+ AWS_ACCESS_KEY_ID: '1'
3
+ AWS_SECRET_ACCESS_KEY: '1'
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.0
7
+ before_install: gem install bundler -v 1.17.3
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at btolarz@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in s3sec.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,11 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+
5
+ PLATFORMS
6
+ ruby
7
+
8
+ DEPENDENCIES
9
+
10
+ BUNDLED WITH
11
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 btolarz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # S3sec
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/s3sec`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 's3sec'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install Also you can do gem install username-projectname -s http://gems.github.com
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/s3sec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## Code of Conduct
38
+
39
+ Everyone interacting in the S3sec project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/s3sec/blob/master/CODE_OF_CONDUCT.md).
40
+
41
+ ## Copyright
42
+
43
+ Copyright (c) 2019 btolarz. See [MIT License](LICENSE.txt) for further details.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "s3sec"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/s3sec ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ lib_path = File.expand_path('../lib', __dir__)
5
+ $:.unshift(lib_path) if !$:.include?(lib_path)
6
+ require 's3sec/cli'
7
+
8
+ Signal.trap('INT') do
9
+ warn("\n#{caller.join("\n")}: interrupted")
10
+ exit(1)
11
+ end
12
+
13
+ begin
14
+ S3sec::CLI.start
15
+ rescue S3sec::CLI::Error => err
16
+ puts "ERROR: #{err.message}"
17
+ exit 1
18
+ end
data/lib/s3sec.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "s3sec/version"
2
+
3
+ module S3sec
4
+ end
data/lib/s3sec/cli.rb ADDED
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+
5
+ module S3sec
6
+ # Handle the application command line parsing
7
+ # and the dispatch to various command objects
8
+ #
9
+ # @api public
10
+ class CLI < Thor
11
+ # Error raised by this runner
12
+ Error = Class.new(StandardError)
13
+
14
+ desc 'version', 's3sec version'
15
+ def version
16
+ require_relative 'version'
17
+ puts "v#{S3sec::VERSION}"
18
+ end
19
+ map %w(--version -v) => :version
20
+
21
+ desc 'check', 'Check open buckets and public files'
22
+ method_option :help, aliases: '-h', type: :boolean,
23
+ desc: 'Display usage information'
24
+ def check(*)
25
+ if options[:help]
26
+ invoke :help, ['check']
27
+ else
28
+ require_relative 'commands/check'
29
+ S3sec::Commands::Check.new(options).execute
30
+ end
31
+ end
32
+
33
+ desc 'config', 'Configure aws credentials'
34
+ method_option :help, aliases: '-h', type: :boolean,
35
+ desc: 'Display usage information'
36
+ def config(*)
37
+ if options[:help]
38
+ invoke :help, ['config']
39
+ else
40
+ require_relative 'commands/config'
41
+ S3sec::Commands::Config.new(options).execute
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+ require "tty-config"
5
+
6
+ module S3sec
7
+ class Command
8
+ extend Forwardable
9
+
10
+ def_delegators :command, :run
11
+
12
+ # Execute this command
13
+ #
14
+ # @api public
15
+ def execute(*)
16
+ raise(
17
+ NotImplementedError,
18
+ "#{self.class}##{__method__} must be implemented"
19
+ )
20
+ end
21
+
22
+ # The external commands runner
23
+ #
24
+ # @see http://www.rubydoc.info/gems/tty-command
25
+ #
26
+ # @api public
27
+ def command(**options)
28
+ require 'tty-command'
29
+ TTY::Command.new(options)
30
+ end
31
+
32
+ # The cursor movement
33
+ #
34
+ # @see http://www.rubydoc.info/gems/tty-cursor
35
+ #
36
+ # @api public
37
+ def cursor
38
+ require 'tty-cursor'
39
+ TTY::Cursor
40
+ end
41
+
42
+ # Open a file or text in the user's preferred editor
43
+ #
44
+ # @see http://www.rubydoc.info/gems/tty-editor
45
+ #
46
+ # @api public
47
+ def editor
48
+ require 'tty-editor'
49
+ TTY::Editor
50
+ end
51
+
52
+ # File manipulation utility methods
53
+ #
54
+ # @see http://www.rubydoc.info/gems/tty-file
55
+ #
56
+ # @api public
57
+ def generator
58
+ require 'tty-file'
59
+ TTY::File
60
+ end
61
+
62
+ # Terminal output paging
63
+ #
64
+ # @see http://www.rubydoc.info/gems/tty-pager
65
+ #
66
+ # @api public
67
+ def pager(**options)
68
+ require 'tty-pager'
69
+ TTY::Pager.new(options)
70
+ end
71
+
72
+ # Terminal platform and OS properties
73
+ #
74
+ # @see http://www.rubydoc.info/gems/tty-pager
75
+ #
76
+ # @api public
77
+ def platform
78
+ require 'tty-platform'
79
+ TTY::Platform.new
80
+ end
81
+
82
+ # The interactive pastel
83
+ #
84
+ # @see http://www.rubydoc.info/gems/pastel
85
+ #
86
+ # @api public
87
+ def pastel(**options)
88
+ require 'pastel'
89
+ Pastel.new(options)
90
+ end
91
+
92
+
93
+ # The interactive prompt
94
+ #
95
+ # @see http://www.rubydoc.info/gems/tty-prompt
96
+ #
97
+ # @api public
98
+ def prompt(**options)
99
+ require 'tty-prompt'
100
+ TTY::Prompt.new(options)
101
+ end
102
+
103
+ # Get terminal screen properties
104
+ #
105
+ # @see http://www.rubydoc.info/gems/tty-screen
106
+ #
107
+ # @api public
108
+ def screen
109
+ require 'tty-screen'
110
+ TTY::Screen
111
+ end
112
+
113
+ # The unix which utility
114
+ #
115
+ # @see http://www.rubydoc.info/gems/tty-which
116
+ #
117
+ # @api public
118
+ def which(*args)
119
+ require 'tty-which'
120
+ TTY::Which.which(*args)
121
+ end
122
+
123
+ # Check if executable exists
124
+ #
125
+ # @see http://www.rubydoc.info/gems/tty-which
126
+ #
127
+ # @api public
128
+ def exec_exist?(*args)
129
+ require 'tty-which'
130
+ TTY::Which.exist?(*args)
131
+ end
132
+
133
+ # Read configuration
134
+ #
135
+ # @see http://www.rubydoc.info/gems/tty-config
136
+ #
137
+ # @api public
138
+ def config
139
+ return @config if @config
140
+ @config = TTY::Config.new
141
+ @config.filename = 'config'
142
+ @config.extname = '.yml'
143
+ @config.append_path Dir.pwd
144
+ @config.read if @config.exist?
145
+ @config
146
+ end
147
+ end
148
+ end
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../command'
4
+ require_relative '../services/open_buckets'
5
+ require_relative '../services/public_files'
6
+ require 'tty-spinner'
7
+ require 'tty-tree'
8
+ require 'tty-progressbar'
9
+
10
+ module S3sec
11
+ module Commands
12
+ class Check < S3sec::Command
13
+ def initialize(options)
14
+ @options = options
15
+ end
16
+
17
+ def execute(input: $stdin, output: $stdout)
18
+ output.puts 'Wrong credentials' && return unless validate_credentials
19
+
20
+ extentions = choose_extentions
21
+ buckets = get_buckets
22
+ tree, data = prepare_data(buckets, get_files(buckets, extentions))
23
+
24
+ render_results(output, tree, data)
25
+ end
26
+
27
+ private
28
+
29
+ def validate_credentials
30
+ ![config.fetch(:AWS_ACCESS_KEY_ID), config.fetch(:AWS_SECRET_ACCESS_KEY)].any?(&:nil?)
31
+ end
32
+
33
+ def choose_extentions
34
+ prompt.multi_select("Extentions") do |menu|
35
+ menu.default 1, 2, 3, 4
36
+ %w(csv xls xlsx dump pdf jpg txt).each do |e|
37
+ menu.choice e
38
+ end
39
+ end
40
+ end
41
+
42
+ def get_buckets
43
+ spinner = TTY::Spinner.new("[:spinner] Looking for buckets ...", format: :pulse_2)
44
+ spinner.auto_spin
45
+
46
+ buckets = OpenBuckets.call(
47
+ access_key: config.fetch(:AWS_ACCESS_KEY_ID),
48
+ secret: config.fetch(:AWS_SECRET_ACCESS_KEY)
49
+ )
50
+
51
+ spinner.stop('Done!')
52
+ buckets
53
+ end
54
+
55
+ def get_files(buckets, extentions)
56
+ bars = TTY::ProgressBar::Multi.new("[:bar] Looking for public files ...")
57
+
58
+ buckets.reduce([]) do |arr, bucket|
59
+ state = bucket.public ? pastel.yellow('public') : pastel.green('private')
60
+ bar = bars.register "[:bar] #{bucket.name} #{state}", total: bucket.keys.size
61
+
62
+ if bucket.keys.any?
63
+ files = PublicFiles.call(bucket, extentions, -> { bar.advance })
64
+ arr.concat(files)
65
+ end
66
+
67
+ arr
68
+ end
69
+ end
70
+
71
+ def prepare_data(buckets, files)
72
+ data = files.each_with_object({}) do |f, hash|
73
+ hash[f.bucket.name] ||= []
74
+ hash[f.bucket.name] << f.key
75
+ end
76
+
77
+ buckets.each do |b|
78
+ data[b.name] ||= [] if b.public
79
+ end
80
+
81
+ tree = TTY::Tree.new(data)
82
+ return tree, data
83
+ end
84
+
85
+ def render_results(output, tree, data)
86
+ output.puts
87
+
88
+ if data.keys.any?
89
+ output.puts pastel.red('Found public objects!')
90
+ output.puts
91
+ output.puts(tree.render)
92
+ else
93
+ output.puts pastel.green('Success! You are safe')
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../command'
4
+ require 'aws-sdk'
5
+
6
+ module S3sec
7
+ module Commands
8
+ class Config < S3sec::Command
9
+ def initialize(options)
10
+ @options = options
11
+ end
12
+
13
+ def execute(input: $stdin, output: $stdout)
14
+ id, key = nil, nil
15
+
16
+ id = config.fetch(:AWS_ACCESS_KEY_ID) if config.exist?
17
+ key = config.fetch(:AWS_SECRET_ACCESS_KEY) if config.exist?
18
+
19
+ result = prompt.collect do
20
+ key(:AWS_ACCESS_KEY_ID).ask("AWS_ACCESS_KEY_ID #{id}:", default: ENV['AWS_ACCESS_KEY_ID'])
21
+ key(:AWS_SECRET_ACCESS_KEY).ask("AWS_SECRET_ACCESS_KEY #{key}:", default: ENV['AWS_SECRET_ACCESS_KEY'])
22
+ end
23
+
24
+ config.set(:AWS_ACCESS_KEY_ID, value: result[:AWS_ACCESS_KEY_ID]) if !result[:AWS_ACCESS_KEY_ID].nil?
25
+ config.set(:AWS_SECRET_ACCESS_KEY, value: result[:AWS_SECRET_ACCESS_KEY]) if !result[:AWS_SECRET_ACCESS_KEY].nil?
26
+
27
+ client = Aws::S3::Client.new(
28
+ credentials: Aws::Credentials.new(config.fetch(:AWS_ACCESS_KEY_ID), config.fetch(:AWS_SECRET_ACCESS_KEY)),
29
+ region: 'eu-central-1'
30
+ )
31
+
32
+ begin
33
+ output.puts 'Testing ...'
34
+ client.list_buckets
35
+ config.write(force: true)
36
+ output.puts pastel.green('Done!')
37
+ rescue => e
38
+ output.puts pastel.red(e)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,12 @@
1
+ class Service
2
+ def self.call(*args)
3
+ new.call(*args)
4
+ end
5
+
6
+ def call
7
+ raise(
8
+ NotImplementedError,
9
+ "#{self.class}##{__method__} must be implemented"
10
+ )
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ require_relative '../service'
2
+ class CheckAcl < Service
3
+ def call(obj_acl)
4
+ obj_acl.grants.any? do |grant|
5
+ !!grant.grantee.uri.to_s.match(/AllUsers/)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,41 @@
1
+ require 'aws-sdk'
2
+ require_relative '../service'
3
+ require_relative '../services/check_acl'
4
+
5
+ class OpenBuckets < Service
6
+ def call(access_key:, secret:)
7
+ @access_key, @secret = access_key, secret
8
+ collect_data
9
+ rescue => e
10
+ puts e
11
+ []
12
+ end
13
+
14
+ def client
15
+ @client ||= Aws::S3::Resource.new(
16
+ credentials: Aws::Credentials.new(@access_key, @secret),
17
+ region: 'eu-central-1'
18
+ )
19
+ end
20
+
21
+ def collect_data
22
+ buckets = client.buckets.map do |b|
23
+ region = client.client.get_bucket_location(bucket: b.name).location_constraint
24
+ s3tempclient = Aws::S3::Resource.new(
25
+ credentials: Aws::Credentials.new(@access_key, @secret),
26
+ region: region
27
+ )
28
+ status = CheckAcl.call(s3tempclient.client.get_bucket_acl({bucket: b.name}))
29
+
30
+ bucket = Bucket.new(b.name, region, status, s3tempclient.client, [])
31
+
32
+ s3tempclient.bucket(b.name).objects.each do |obj|
33
+ bucket.keys << obj.key
34
+ end
35
+
36
+ bucket
37
+ end
38
+ end
39
+
40
+ Bucket = Struct.new(:name, :region, :public, :client, :keys)
41
+ end
@@ -0,0 +1,18 @@
1
+ require_relative '../service'
2
+ require_relative '../services/check_acl'
3
+
4
+ class PublicFiles < Service
5
+ def call(bucket, extentions, tick = nil)
6
+ bucket.keys.reduce([]) do |arr, key|
7
+ tick.call if tick
8
+ arr << File.new(key, bucket) if extentions.include?(key.split('.').last) &&
9
+ CheckAcl.call(bucket.client.get_object_acl({bucket: bucket.name, key: key}))
10
+ arr
11
+ end
12
+ rescue => e
13
+ puts e
14
+ []
15
+ end
16
+
17
+ File = Struct.new(:key, :bucket)
18
+ end
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1,3 @@
1
+ module S3sec
2
+ VERSION = "0.1.0"
3
+ end
data/s3sec.gemspec ADDED
@@ -0,0 +1,63 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "s3sec/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "s3_sec"
8
+ spec.license = "MIT"
9
+ spec.version = S3sec::VERSION
10
+ spec.authors = ["btolarz"]
11
+ spec.email = ["btolarz@gmail.com"]
12
+
13
+ spec.summary = %q{Write a short summary, because RubyGems requires one.}
14
+ spec.description = %q{Write a longer description or delete this line.}
15
+ spec.homepage = "https://github.com/btolarz/s3sec"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["homepage_uri"] = spec.homepage
21
+ spec.metadata["source_code_uri"] = "https://github.com/btolarz/s3sec"
22
+ spec.metadata["changelog_uri"] = "https://github.com/btolarz/s3sec/releases"
23
+ else
24
+ raise "RubyGems 2.0 or newer is required to protect against " \
25
+ "public gem pushes."
26
+ end
27
+
28
+ # Specify which files should be added to the gem when it is released.
29
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
+ end
33
+ spec.bindir = "exe"
34
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ["lib"]
36
+
37
+ spec.add_dependency "tty-box", "~> 0.4.1"
38
+ spec.add_dependency "tty-color", "~> 0.5"
39
+ spec.add_dependency "tty-command", "~> 0.9.0"
40
+ spec.add_dependency "tty-config", "~> 0.3.2"
41
+ spec.add_dependency "tty-cursor", "~> 0.7"
42
+ spec.add_dependency "tty-editor", "~> 0.5"
43
+ spec.add_dependency "tty-file", "~> 0.8.0"
44
+ spec.add_dependency "tty-font", "~> 0.4.0"
45
+ spec.add_dependency "tty-logger", "~> 0.2.0"
46
+ spec.add_dependency "tty-markdown", "~> 0.6.0"
47
+ spec.add_dependency "tty-pager", "~> 0.12"
48
+ spec.add_dependency "tty-pie", "~> 0.3.0"
49
+ spec.add_dependency "tty-platform", "~> 0.2"
50
+ spec.add_dependency "tty-progressbar", "~> 0.17"
51
+ spec.add_dependency "tty-prompt", "~> 0.19"
52
+ spec.add_dependency "tty-screen", "~> 0.7"
53
+ spec.add_dependency "tty-spinner", "~> 0.9"
54
+ spec.add_dependency "tty-table", "~> 0.11.0"
55
+ spec.add_dependency "tty-tree", "~> 0.3"
56
+ spec.add_dependency "tty-which", "~> 0.4"
57
+ spec.add_dependency "pastel", "~> 0.7.2"
58
+ spec.add_dependency "thor", "~> 0.20.0"
59
+
60
+ spec.add_development_dependency "bundler", "~> 1.17"
61
+ spec.add_development_dependency "rake", "~> 10.0"
62
+ spec.add_development_dependency "rspec", "~> 3.0"
63
+ end
metadata ADDED
@@ -0,0 +1,425 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: s3_sec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - btolarz
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-12-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tty-box
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.4.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.4.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: tty-color
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: tty-command
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.9.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.9.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: tty-config
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.3.2
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.3.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: tty-cursor
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.7'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: tty-editor
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.5'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.5'
97
+ - !ruby/object:Gem::Dependency
98
+ name: tty-file
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.8.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.8.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: tty-font
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.4.0
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.4.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: tty-logger
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.2.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.2.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: tty-markdown
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.6.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.6.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: tty-pager
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.12'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '0.12'
167
+ - !ruby/object:Gem::Dependency
168
+ name: tty-pie
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.3.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.3.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: tty-platform
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.2'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.2'
195
+ - !ruby/object:Gem::Dependency
196
+ name: tty-progressbar
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.17'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.17'
209
+ - !ruby/object:Gem::Dependency
210
+ name: tty-prompt
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.19'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.19'
223
+ - !ruby/object:Gem::Dependency
224
+ name: tty-screen
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '0.7'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '0.7'
237
+ - !ruby/object:Gem::Dependency
238
+ name: tty-spinner
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '0.9'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '0.9'
251
+ - !ruby/object:Gem::Dependency
252
+ name: tty-table
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: 0.11.0
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: 0.11.0
265
+ - !ruby/object:Gem::Dependency
266
+ name: tty-tree
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '0.3'
272
+ type: :runtime
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '0.3'
279
+ - !ruby/object:Gem::Dependency
280
+ name: tty-which
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - "~>"
284
+ - !ruby/object:Gem::Version
285
+ version: '0.4'
286
+ type: :runtime
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: '0.4'
293
+ - !ruby/object:Gem::Dependency
294
+ name: pastel
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: 0.7.2
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - "~>"
305
+ - !ruby/object:Gem::Version
306
+ version: 0.7.2
307
+ - !ruby/object:Gem::Dependency
308
+ name: thor
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - "~>"
312
+ - !ruby/object:Gem::Version
313
+ version: 0.20.0
314
+ type: :runtime
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - "~>"
319
+ - !ruby/object:Gem::Version
320
+ version: 0.20.0
321
+ - !ruby/object:Gem::Dependency
322
+ name: bundler
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - "~>"
326
+ - !ruby/object:Gem::Version
327
+ version: '1.17'
328
+ type: :development
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - "~>"
333
+ - !ruby/object:Gem::Version
334
+ version: '1.17'
335
+ - !ruby/object:Gem::Dependency
336
+ name: rake
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - "~>"
340
+ - !ruby/object:Gem::Version
341
+ version: '10.0'
342
+ type: :development
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - "~>"
347
+ - !ruby/object:Gem::Version
348
+ version: '10.0'
349
+ - !ruby/object:Gem::Dependency
350
+ name: rspec
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - "~>"
354
+ - !ruby/object:Gem::Version
355
+ version: '3.0'
356
+ type: :development
357
+ prerelease: false
358
+ version_requirements: !ruby/object:Gem::Requirement
359
+ requirements:
360
+ - - "~>"
361
+ - !ruby/object:Gem::Version
362
+ version: '3.0'
363
+ description: Write a longer description or delete this line.
364
+ email:
365
+ - btolarz@gmail.com
366
+ executables:
367
+ - s3sec
368
+ extensions: []
369
+ extra_rdoc_files: []
370
+ files:
371
+ - ".gitignore"
372
+ - ".rspec"
373
+ - ".s3sec.yml"
374
+ - ".travis.yml"
375
+ - CODE_OF_CONDUCT.md
376
+ - Gemfile
377
+ - Gemfile.lock
378
+ - LICENSE.txt
379
+ - README.md
380
+ - Rakefile
381
+ - bin/console
382
+ - bin/setup
383
+ - exe/s3sec
384
+ - lib/s3sec.rb
385
+ - lib/s3sec/cli.rb
386
+ - lib/s3sec/command.rb
387
+ - lib/s3sec/commands/.gitkeep
388
+ - lib/s3sec/commands/check.rb
389
+ - lib/s3sec/commands/config.rb
390
+ - lib/s3sec/service.rb
391
+ - lib/s3sec/services/check_acl.rb
392
+ - lib/s3sec/services/open_buckets.rb
393
+ - lib/s3sec/services/public_files.rb
394
+ - lib/s3sec/templates/.gitkeep
395
+ - lib/s3sec/templates/check/.gitkeep
396
+ - lib/s3sec/templates/config/.gitkeep
397
+ - lib/s3sec/version.rb
398
+ - s3sec.gemspec
399
+ homepage: https://github.com/btolarz/s3sec
400
+ licenses:
401
+ - MIT
402
+ metadata:
403
+ homepage_uri: https://github.com/btolarz/s3sec
404
+ source_code_uri: https://github.com/btolarz/s3sec
405
+ changelog_uri: https://github.com/btolarz/s3sec/releases
406
+ post_install_message:
407
+ rdoc_options: []
408
+ require_paths:
409
+ - lib
410
+ required_ruby_version: !ruby/object:Gem::Requirement
411
+ requirements:
412
+ - - ">="
413
+ - !ruby/object:Gem::Version
414
+ version: '0'
415
+ required_rubygems_version: !ruby/object:Gem::Requirement
416
+ requirements:
417
+ - - ">="
418
+ - !ruby/object:Gem::Version
419
+ version: '0'
420
+ requirements: []
421
+ rubygems_version: 3.0.4
422
+ signing_key:
423
+ specification_version: 4
424
+ summary: Write a short summary, because RubyGems requires one.
425
+ test_files: []