seccomp 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: e357ef596cd3a5acca5b7b322a663d705ef45b620418b9b28fac3e48fb0c3bff
4
+ data.tar.gz: 89490d1b2102566ba81b88ec052a0c77e3936dbb775908a05db32a8e087d29f7
5
+ SHA512:
6
+ metadata.gz: 2435c5b48451a44619720a87282ecbfc86bd51ba368102ca55bb4b26dc0e4296810ff4d1ffff98744d6026fedd1598e36fdbfd5aaff7cdbcaa5f626f64a8af31
7
+ data.tar.gz: 8498a82837c076d3d0eea84b474a2250d3437b306bc50f81b4df8de39c9201b7055b97bce58bb520365bf7ca76282aedf9c8cc13724c31b5b7f66a05688a9b12
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 mo khan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Seccomp
2
+
3
+ Run's `strace` on a program to record all systemcalls then produces a report of all system calls that were made.
4
+ This program can also be used to create a seccomp profile for use with Docker.
5
+
6
+ Inspired by:
7
+
8
+ * https://docs.docker.com/engine/security/seccomp/#pass-a-profile-for-a-container
9
+ * https://www.fit.vut.cz/study/thesis-file/21219/21219.pdf
10
+
11
+ ## Installation
12
+
13
+ Execute:
14
+
15
+ $ gem install seccomp
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ $ seccomp help
21
+ ```
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies.
26
+ Then, run `bin/test` to run the tests.
27
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To release a new version, update the version number in `version.rb`, and then
30
+ run `bin/shipit`, which will create a git tag for the version,
31
+ push git commits and the created tag, 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/xlgmokha/seccomp.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/exe/seccomp ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "seccomp/cli"
5
+
6
+ Signal.trap("INT") do
7
+ exit(1)
8
+ end
9
+
10
+ begin
11
+ Seccomp::CLI::Application.start
12
+ rescue StandardError => boom
13
+ warn (["ERROR (#{boom.class}): #{boom.message}"] + boom.backtrace).join("\n")
14
+ exit 1
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+
5
+ module Seccomp
6
+ module CLI
7
+ class Application < Thor
8
+ desc "trace COMMAND", "Create a seccomp profile suitable for the COMMAND"
9
+ def trace(command)
10
+ system "strace -s 0 -xx -o seccomp -ff #{command}"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seccomp
4
+ VERSION = "0.1.0"
5
+ end
data/lib/seccomp.rb ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "seccomp/version"
4
+
5
+ module Seccomp
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ end
data/seccomp.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/seccomp/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.authors = ["mo khan"]
7
+ spec.bindir = "exe"
8
+ spec.description = "Helps build a seccomp profile for running Docker containers"
9
+ spec.email = ["mo@mokhan.ca"]
10
+ spec.executables = ["seccomp"]
11
+ spec.files = Dir.glob([
12
+ "*.gemspec",
13
+ "LICENSE.txt",
14
+ "README.md",
15
+ "exe/*",
16
+ "lib/**/*.erb",
17
+ "lib/**/*.rb",
18
+ ])
19
+ spec.homepage = "https://github.com/xlgmokha/seccomp"
20
+ spec.license = "MIT"
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["rubygems_mfa_required"] = "true"
23
+ spec.name = "seccomp"
24
+ spec.require_paths = ["lib"]
25
+ spec.required_ruby_version = ">= 3.0.0"
26
+ spec.summary = spec.description
27
+ spec.version = Seccomp::VERSION
28
+ spec.add_dependency "thor", "~> 1.2"
29
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: seccomp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mo khan
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ description: Helps build a seccomp profile for running Docker containers
28
+ email:
29
+ - mo@mokhan.ca
30
+ executables:
31
+ - seccomp
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - LICENSE.txt
36
+ - README.md
37
+ - exe/seccomp
38
+ - lib/seccomp.rb
39
+ - lib/seccomp/cli.rb
40
+ - lib/seccomp/version.rb
41
+ - seccomp.gemspec
42
+ homepage: https://github.com/xlgmokha/seccomp
43
+ licenses:
44
+ - MIT
45
+ metadata:
46
+ homepage_uri: https://github.com/xlgmokha/seccomp
47
+ rubygems_mfa_required: 'true'
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 3.0.0
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubygems_version: 3.2.32
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Helps build a seccomp profile for running Docker containers
67
+ test_files: []