xanthus 0.1.3 → 0.2.3

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: 3b32bb667df960d2a565943f27d57c28462cfc37e6ffd8e56f1fddb817afa828
4
- data.tar.gz: 772ac67b093aae2ee190481888405b97f08639494a86266c4017750b0da89fcb
3
+ metadata.gz: e7aa10a2e6a9087d8a41216de0002855833168b87b3597a4c65aadcba770ebcc
4
+ data.tar.gz: 6a38774240d4c3634de9fb9146e65a890867a748a7e88e90e86c50fb3a898dd0
5
5
  SHA512:
6
- metadata.gz: d2f02645f8141275b74adf7b1b70c3a36609fc9172be148a949ed1b0c1acb18bec134eb13e9ed7717cf098f6fda40289a82b38066f650d49c0c2abcaac56a924
7
- data.tar.gz: 379c8d188ac86ee7abf532ef43f05458f541033abe4d97a4087c5026a72c01dd1c0db5da1b03bffbe0822cc9315b624db7e3dae30f654c12746851eac7c3ca6d
6
+ metadata.gz: 81c35a68c080c5375612a4a8f88478ee14fa7c8bf9fa0d0357d5cf38201f40d86c40739517cf8eb7bf6cbf2fcfcb454238db17e3e049f9b717120693e5ad03ce
7
+ data.tar.gz: 0de1c69ccd12ed193f32de812683c494ccb648ca1c099f333eda0b6fccf1eb69447da5469799789a31d0ace76586b5d2c8a23e38517f4cf7e2636f788c15fbf7
data/README.md CHANGED
@@ -181,12 +181,6 @@ The user must provide such a script.
181
181
  In our case, we automatically generate attack scripts using `wget-attack-script-gen.py`.
182
182
  `Xanthus` allows users to provide logic to generate scripts or simply provide scripts to run during the experiment.
183
183
 
184
- ## Xanthus
185
-
186
- 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/xanthus`. To experiment with that code, run `bin/console` for an interactive prompt.
187
-
188
- TODO: Delete this and the text above, and describe your gem
189
-
190
184
  ### Installation
191
185
 
192
186
  Add this line to your application's Gemfile:
@@ -205,18 +199,89 @@ Or install it yourself as:
205
199
 
206
200
  ### Usage
207
201
 
208
- TODO: Write usage instructions here
202
+ ```
203
+ xanthus version | return Xanthus version number.
204
+ xanthus dependencies | installation instructions for system dependencies.
205
+ xanthus init <project name> | initialize a new project.
206
+ xanthus run | run .xanthus file in the current folder.
207
+ ```
209
208
 
210
209
  ### Development
211
210
 
212
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
213
-
214
- 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).
211
+ To add more features in `Xanthus`,
212
+ clone this repository
213
+ ```
214
+ git clone https://github.com/tfjmp/xanthus
215
+ cd xanthus
216
+ ```
217
+ and build the gem by running
218
+ ```
219
+ gem build xanthus
220
+ ```
221
+ To install this gem locally on your machine, you can also run
222
+ ```
223
+ gem install xanthus
224
+ ```
225
+ After you add a new feature (and test it yourself), you can release a new version of `Xanthus`.
226
+ First, please update the version number in `lib/xanthus/version.rb`, tag the repository `git tag -a x.x.x -m 'x.x.x'`, and push the tag `git push --tags`.
227
+ Then you can run
228
+ ```
229
+ gem push xanthus-x.x.x.gem
230
+ ```
231
+ This last step publishes the gem at [https://rubygems.org/gems/xanthus](https://rubygems.org/gems/xanthus).
215
232
 
216
- ### Contributing
233
+ ### Contribution
217
234
 
218
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/xanthus.
235
+ We welcome bug reports and pull requests on GitHub at https://github.com/[USERNAME]/xanthus.
219
236
 
220
237
  ### License
221
238
 
222
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
239
+ This gem is available as an open source project under the [MIT License](https://opensource.org/licenses/MIT).
240
+
241
+ ### Issues and Solutions with VirtualBox
242
+ VirtualBox Guest Additions is not as well designed as we may hope. If you encountered the following error:
243
+ ```
244
+ Vagrant was unable to mount VirtualBox shared folders. This is usually
245
+ because the filesystem "vboxsf" is not available. This filesystem is
246
+ made available via the VirtualBox Guest Additions and kernel module.
247
+ Please verify that these guest additions are properly installed in the
248
+ guest. This is not a bug in Vagrant and is usually caused by a faulty
249
+ Vagrant box. For context, the command attempted was:
250
+
251
+ mount -t vboxsf -o uid=900,gid=900 vagrant /vagrant
252
+
253
+ The error output from the command was:
254
+
255
+ /sbin/mount.vboxsf: mounting failed with the error: No such device
256
+ ```
257
+ It is most likely the fault of incompatible GA between the VM and the host. Even though the script might have stop, the VM is still booted. You can `vagrant ssh` into the VM and manually input the following two commands:
258
+ ```
259
+ sudo apt-get -y install dkms build-essential linux-headers-$(uname -r) virtualbox-guest-additions-iso
260
+ sudo /opt/VBoxGuestAdditions*/init/vboxadd setup
261
+ ```
262
+ After this, you may encounter this error:
263
+ ```
264
+ ...
265
+ ==> default: Machine booted and ready!
266
+ [default] GuestAdditions seems to be installed (6.0.20) correctly, but not running.
267
+ bash: line 4: setup: command not found
268
+ ==> default: Checking for guest additions in VM...
269
+ The following SSH command responded with a non-zero exit status.
270
+ Vagrant assumes that this means the command failed!
271
+
272
+ setup
273
+
274
+ Stdout from the command:
275
+
276
+
277
+
278
+ Stderr from the command:
279
+
280
+ bash: line 4: setup: command not found
281
+ ```
282
+ Please add the following into the Vagrant script:
283
+ ```
284
+ if Vagrant.has_plugin?("vagrant-vbguest")
285
+ config.vbguest.auto_update = false
286
+ end
287
+ ```
data/bin/xanthus CHANGED
@@ -7,17 +7,17 @@ param1 = ARGV[1]
7
7
 
8
8
  if (instruction == 'version')
9
9
  Xanthus.version
10
- elsif (instruction == 'init')
10
+ elsif (instruction == 'init' && !param1.nil?)
11
11
  Xanthus::Init.init param1
12
12
  elsif (instruction == 'run')
13
13
  load('./.xanthus')
14
14
  elsif (instruction == 'help')
15
- puts 'xanthus version | return version number.'
16
- puts 'xanthus depencies | installation instruction for system dependencies.'
17
- puts 'xanthus init <project name> | inialise a new project.'
18
- puts 'xanthus run | run .xanthus file contained in the current folder.'
15
+ puts 'xanthus version | return Xanthus version number.'
16
+ puts 'xanthus dependencies | installation instructions for system dependencies.'
17
+ puts 'xanthus init <project name> | initialize a new project.'
18
+ puts 'xanthus run | run .xanthus file in the current folder.'
19
19
  elsif (instruction == 'dependencies')
20
- puts 'You need to install the following software on your system for xanthus to run:'
20
+ puts 'You need to install the following software on your system for Xanthus to run:'
21
21
  puts 'git (see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)'
22
22
  puts 'git lfs (see https://help.github.com/en/articles/installing-git-large-file-storage)'
23
23
  puts 'virtualbox (see https://www.virtualbox.org/wiki/Downloads)'
data/lib/xanthus.rb CHANGED
@@ -4,7 +4,9 @@ require "xanthus/script"
4
4
  require "xanthus/virtual_machine"
5
5
  require "xanthus/job"
6
6
  require "xanthus/default"
7
+ require "xanthus/repository"
7
8
  require "xanthus/github"
9
+ require "xanthus/dataverse"
8
10
  require "xanthus/configuration"
9
11
 
10
12
  module Xanthus
@@ -2,6 +2,8 @@ module Xanthus
2
2
  class Configuration
3
3
  attr_accessor :name
4
4
  attr_accessor :authors
5
+ attr_accessor :affiliation
6
+ attr_accessor :email
5
7
  attr_accessor :description
6
8
  attr_accessor :seed
7
9
  attr_accessor :params
@@ -9,6 +11,7 @@ module Xanthus
9
11
  attr_accessor :scripts
10
12
  attr_accessor :jobs
11
13
  attr_accessor :github_conf
14
+ attr_accessor :dataverse_conf
12
15
 
13
16
  def initialize
14
17
  @params = Hash.new
@@ -41,13 +44,21 @@ module Xanthus
41
44
  @github_conf = github
42
45
  end
43
46
 
47
+ def dataverse
48
+ dataverse = Dataverse.new
49
+ yield(dataverse)
50
+ @dataverse_conf = dataverse
51
+ end
52
+
44
53
  def to_readme_md
45
54
  %Q{
46
55
  # #{@name}
47
56
 
48
- Authors: #{@authors}
57
+ authors: #{@authors}
58
+ affiliation: #{@affiliation}
59
+ email: #{@email}
49
60
 
50
- Seed: #{@seed}
61
+ seed: #{@seed}
51
62
 
52
63
  ## Description
53
64
 
@@ -64,12 +75,19 @@ Seed: #{@seed}
64
75
  config.vms.each do |k, v|
65
76
  v.generate_box config
66
77
  end
78
+
79
+ # initializing storage backends
67
80
  config.github_conf.init(config) unless config.github_conf.nil?
81
+ config.dataverse_conf.init(config) unless config.dataverse_conf.nil?
82
+
83
+ # executing jobs
68
84
  config.jobs.each do |name,job|
69
85
  for i in 0..(job.iterations-1) do
70
86
  job.execute config, i
71
87
  end
72
88
  end
89
+
90
+ # finalizing storage backends
73
91
  config.github_conf.tag unless config.github_conf.nil?
74
92
  config.github_conf.clean unless config.github_conf.nil?
75
93
  end
@@ -0,0 +1,179 @@
1
+ require 'fileutils'
2
+ require 'json'
3
+
4
+ module Xanthus
5
+ class Dataverse < Repository
6
+ attr_accessor :server
7
+ attr_accessor :repo
8
+ attr_accessor :token
9
+ attr_accessor :dataset_name
10
+ attr_accessor :author
11
+ attr_accessor :affiliation
12
+ attr_accessor :email
13
+ attr_accessor :description
14
+ attr_accessor :subject
15
+ attr_accessor :doi
16
+
17
+ def initialize
18
+ super
19
+ @server = 'default_server'
20
+ @repo = 'default_repo'
21
+ @token = 'default_token'
22
+ @dataset_name = 'default_name'
23
+ @author = 'default_author'
24
+ @affiliation = 'default_affiliation'
25
+ @email = 'default_email'
26
+ @description = 'default_description'
27
+ @subject = 'default_subject'
28
+ @doi = 'not_set'
29
+ end
30
+
31
+ def dataset_json
32
+ json = %Q{
33
+ {
34
+ "datasetVersion": {
35
+ "metadataBlocks": {
36
+ "citation": {
37
+ "fields": [
38
+ {
39
+ "value": "#{@dataset_name}",
40
+ "typeClass": "primitive",
41
+ "multiple": false,
42
+ "typeName": "title"
43
+ },
44
+ {
45
+ "value": [
46
+ {
47
+ "authorName": {
48
+ "value": "#{@author}",
49
+ "typeClass": "primitive",
50
+ "multiple": false,
51
+ "typeName": "authorName"
52
+ },
53
+ "authorAffiliation": {
54
+ "value": "#{@affiliation}",
55
+ "typeClass": "primitive",
56
+ "multiple": false,
57
+ "typeName": "authorAffiliation"
58
+ }
59
+ }
60
+ ],
61
+ "typeClass": "compound",
62
+ "multiple": true,
63
+ "typeName": "author"
64
+ },
65
+ {
66
+ "value": [
67
+ { "datasetContactEmail" : {
68
+ "typeClass": "primitive",
69
+ "multiple": false,
70
+ "typeName": "datasetContactEmail",
71
+ "value" : "#{@email}"
72
+ },
73
+ "datasetContactName" : {
74
+ "typeClass": "primitive",
75
+ "multiple": false,
76
+ "typeName": "datasetContactName",
77
+ "value": "#{@author}"
78
+ }
79
+ }],
80
+ "typeClass": "compound",
81
+ "multiple": true,
82
+ "typeName": "datasetContact"
83
+ },
84
+ {
85
+ "value": [ {
86
+ "dsDescriptionValue":{
87
+ "value": "#{@description.gsub(/\r/," ").gsub(/\n/," ")}",
88
+ "multiple":false,
89
+ "typeClass": "primitive",
90
+ "typeName": "dsDescriptionValue"
91
+ }}],
92
+ "typeClass": "compound",
93
+ "multiple": true,
94
+ "typeName": "dsDescription"
95
+ },
96
+ {
97
+ "value": [
98
+ "#{@subject}"
99
+ ],
100
+ "typeClass": "controlledVocabulary",
101
+ "multiple": true,
102
+ "typeName": "subject"
103
+ }
104
+ ],
105
+ "displayName": "Citation Metadata"
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ return json
112
+ end
113
+
114
+ def create_dataset
115
+ Dir.chdir 'dataverse_dataset' do
116
+ File.open('dataset.json', 'w+') do |f|
117
+ f.write(self.dataset_json)
118
+ end
119
+ puts "Creating dataverse #{@dataset_name} in #{@repo} at #{@server}..."
120
+ output = `curl --speed-time 15 --speed-limit 1000 --retry 50 --retry-max-time 0 -H X-Dataverse-key:#{@token} -X POST #{@server}/api/dataverses/#{@repo}/datasets --upload-file dataset.json`
121
+ puts output # needed to escape curl output
122
+ parsed = JSON.parse(output)
123
+ @doi = parsed['data']['persistentId']
124
+ puts "Dataverse #{@doi} created."
125
+ end
126
+ end
127
+
128
+ def init config
129
+ # initialize with config information
130
+ @author = config.authors
131
+ @affiliation = config.affiliation
132
+ @email = config.email
133
+ @description = config.description
134
+ @dataset_name = config.name+'-'+Time.now.strftime("%Y-%m-%d_%H-%M")
135
+
136
+ FileUtils.mkdir_p 'dataverse_dataset'
137
+ self.create_dataset
138
+ Dir.chdir 'dataverse_dataset' do
139
+ FileUtils.mkdir_p 'repo'
140
+ Dir.chdir 'repo' do
141
+ self.xanthus_file
142
+ self.readme_file config
143
+ self.inputs_file config
144
+ end
145
+ end
146
+ end
147
+
148
+ def add_file_to_dataverse name, description, folder
149
+ output = `curl --speed-time 15 --speed-limit 1000 --retry 50 --retry-max-time 0 -H X-Dataverse-key:#{@token} -X POST -F "file=@#{name}" -F 'jsonData={"description":"#{description}","directoryLabel":"#{folder}","categories":["Data"], "restrict":"false"}' "#{@server}/api/datasets/:persistentId/add?persistentId=#{@doi}"`
150
+ puts output
151
+ end
152
+
153
+ def xanthus_file
154
+ self.prepare_xanthus_file
155
+ self.add_file_to_dataverse '.xanthus', 'xanthus file used to generate the data.', 'metadata'
156
+ end
157
+
158
+ def readme_file config
159
+ self.prepare_readme_file config
160
+ self.add_file_to_dataverse 'README.md', 'readme describing the dataset.', 'metadata'
161
+ end
162
+
163
+ def inputs_file config
164
+ config.jobs.each do |name,job|
165
+ job.inputs.each do |k, files|
166
+ files.each do |file|
167
+ system('cp', '-f', "../../#{file}", "#{file}")
168
+ self.add_file_to_dataverse file, 'Job input file.', 'metadata'
169
+ end
170
+ end
171
+ end
172
+ end
173
+
174
+ def add content
175
+ self.add_file_to_dataverse content, "#{content} is a Xanthus generated file (check metadata for description)", 'data'
176
+ end
177
+
178
+ end
179
+ end
@@ -1,12 +1,13 @@
1
1
  require 'fileutils'
2
2
 
3
3
  module Xanthus
4
- class GitHub
4
+ class GitHub < Repository
5
5
  attr_accessor :repo
6
6
  attr_accessor :token
7
7
  attr_accessor :folder
8
8
 
9
9
  def initialize
10
+ super
10
11
  @repo = ''
11
12
  @token = ''
12
13
  @folder = Time.now.strftime("%Y-%m-%d_%H-%M")
@@ -20,23 +21,14 @@ module Xanthus
20
21
  end
21
22
 
22
23
  def xanthus_file
23
- script = ''
24
- File.readlines('../../.xanthus').each do |line|
25
- script += line unless line.include? 'github.token'
26
- script += "\t\tgithub.token = 'REMOVED'\n" unless !line.include? 'github.token'
27
- end
28
- File.open('.xanthus', 'w+') do |f|
29
- f.write(script)
30
- end
24
+ self.prepare_xanthus_file
31
25
  system('git', 'add', '.xanthus')
32
26
  system('git', 'commit', '-m', "[Xanthus] :horse: pushed #{@folder}/.xanthus :horse:")
33
27
  system('git', 'push', "https://#{@token}@github.com/#{@repo}", 'master')
34
28
  end
35
29
 
36
30
  def readme_file config
37
- File.open('README.md', 'w+') do |f|
38
- f.write(config.to_readme_md)
39
- end
31
+ self.prepare_readme_file config
40
32
  system('git', 'add', 'README.md')
41
33
  system('git', 'commit', '-m', "[Xanthus] :horse: pushed #{@folder}/README.md :horse:")
42
34
  system('git', 'push', "https://#{@token}@github.com/#{@repo}", 'master')
data/lib/xanthus/init.rb CHANGED
@@ -17,6 +17,8 @@ module Xanthus
17
17
  Xanthus.configure do |config|
18
18
  config.name = '#{@@name}'
19
19
  config.authors = 'John Doe'
20
+ config.affiliation = 'Somewhere University'
21
+ config.email = 'john.doe@somewhere.edu'
20
22
  config.description = %q{
21
23
  Describe my super experiment.
22
24
 
@@ -119,10 +121,17 @@ It is very cool and interesting!
119
121
  job.outputs = {spade: {trace: '/tmp/audit_cdm.avro'}}
120
122
  end
121
123
 
122
- config.github do |github|
123
- github.repo = '<ADD GITHUB REPO user/name>'
124
- github.token = '<ADD GITHUB TOKEN>'
124
+ config.dataverse do |dataverse|
125
+ dataverse.server = <ADD DATAVERSE BASE URL>
126
+ dataverse.repo = <PROVIDE DATAVERSE NAME>
127
+ dataverse.token = <PROVIDE DATAVERSE TOKEN>
128
+ dataverse.subject = <PROVIDE DATAVERSE SUBJECT (e.g. engineering)>
125
129
  end
130
+
131
+ # config.github do |github|
132
+ # github.repo = '<ADD GITHUB REPO user/name>'
133
+ # github.token = '<ADD GITHUB TOKEN>'
134
+ # end
126
135
  end
127
136
  }
128
137
  file.write(script)
data/lib/xanthus/job.rb CHANGED
@@ -19,7 +19,7 @@ module Xanthus
19
19
  @post_instructions = nil
20
20
  end
21
21
 
22
- def output_script outputs
22
+ def output_script machine, outputs
23
23
  script = ''
24
24
  outputs.each do |name, path|
25
25
  script += "cp -f #{path} /vagrant/output/#{name}.data\n"
@@ -42,10 +42,15 @@ module Xanthus
42
42
  f.write(config.vms[machine].to_vagrant)
43
43
  end
44
44
  script = Script.new(scripts, config).to_s
45
- script += self.output_script(@outputs[machine]) unless @outputs[machine].nil?
45
+ script += self.output_script(machine, @outputs[machine]) unless @outputs[machine].nil?
46
46
  File.open('provision.sh', 'w+') do |f|
47
47
  f.write(script)
48
48
  end
49
+ script = 'echo "nothing to do"'
50
+ File.open('before_halt.sh', 'w+') do |f|
51
+ f.write(script)
52
+ end
53
+ system('chmod', '+x', 'before_halt.sh')
49
54
  end
50
55
  end
51
56
 
@@ -120,6 +125,7 @@ module Xanthus
120
125
  system('rm', '-rf', "#{name.to_s}-#{iteration.to_s}")
121
126
  config.github_conf.add("#{name.to_s}-#{iteration.to_s}.tar.gz") unless config.github_conf.nil?
122
127
  config.github_conf.push unless config.github_conf.nil?
128
+ config.dataverse_conf.add("#{name.to_s}-#{iteration.to_s}.tar.gz") unless config.dataverse_conf.nil?
123
129
  puts "Job #{name.to_s}-#{iteration.to_s} done."
124
130
  end
125
131
  end
@@ -0,0 +1,28 @@
1
+ module Xanthus
2
+ class Repository
3
+
4
+ def initialize
5
+ end
6
+
7
+ def prepare_xanthus_file
8
+ script = ''
9
+ File.readlines('../../.xanthus').each do |line|
10
+ script += line unless line.include?('github.token') || line.include?('dataverse.token')
11
+
12
+ # remove github token
13
+ script += "\t\t# github.token = 'REMOVED'\n" unless !line.include? 'github.token'
14
+ # remove dataverse token
15
+ script += "\t\t# dataverse.token = 'REMOVED'\n" unless !line.include? 'dataverse.token'
16
+ end
17
+ File.open('.xanthus', 'w+') do |f|
18
+ f.write(script)
19
+ end
20
+ end
21
+
22
+ def prepare_readme_file config
23
+ File.open('README.md', 'w+') do |f|
24
+ f.write(config.to_readme_md)
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  module Xanthus
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.3"
3
3
 
4
4
  def self.version
5
5
  puts VERSION
@@ -11,6 +11,14 @@ module Xanthus
11
11
  attr_accessor :boxing
12
12
  attr_accessor :ssh_username
13
13
  attr_accessor :ssh_key_path
14
+ attr_accessor :on_aws
15
+ attr_accessor :aws_env_key_id
16
+ attr_accessor :aws_env_key_secret
17
+ attr_accessor :aws_key_pair_name
18
+ attr_accessor :aws_region
19
+ attr_accessor :aws_ami
20
+ attr_accessor :aws_instance_type
21
+ attr_accessor :aws_security_group
14
22
 
15
23
  def initialize
16
24
  @name = :default
@@ -32,7 +40,16 @@ Vagrant.configure(2) do |config|
32
40
  config.vm.box = "#{@box}"
33
41
  config.vm.box_version = "#{@version}"
34
42
  config.vm.network "private_network", ip: "#{@ip}"
43
+ config.vm.synced_folder ".", "/vagrant", create: true, owner: 'vagrant', disabled: false, type: 'virtualbox'
35
44
  }
45
+ script += %Q{
46
+ if Vagrant.has_plugin?("vagrant-vbguest")
47
+ config.vbguest.auto_update = false
48
+ end
49
+ }
50
+ script += %Q{
51
+ config.vm.synced_folder ".", "/vagrant", disabled: false, type: 'rsync'
52
+ } unless !@on_aws
36
53
  script += %Q{
37
54
  config.ssh.username = "#{@ssh_username}"
38
55
  } unless ssh_username.nil?
@@ -40,14 +57,31 @@ script += %Q{
40
57
  config.ssh.private_key_path = "#{@ssh_key_path}"
41
58
  } unless ssh_key_path.nil?
42
59
  script += %Q{
43
- config.vm.provider "virtualbox" do |vb|
60
+ config.vm.provider "virtualbox" do |vb, override|
44
61
  vb.gui = #{@gui}
45
62
  vb.memory = #{@memory}
46
63
  vb.customize ["modifyvm", :id, "--cpuexecutioncap", "#{@cpu_cap}"]
47
64
  vb.cpus = #{@cpus}
48
65
  vb.name = "#{@name}"
49
66
  end
50
- config.vm.provision "shell", path: "provision.sh"
67
+ } unless @on_aws
68
+ script += %Q{
69
+ config.vm.provider "aws" do |aws, override|
70
+ aws.access_key_id = ENV['#{@aws_env_key_id}']
71
+ aws.secret_access_key = ENV['#{@aws_env_key_secret}']
72
+ aws.keypair_name = '#{@aws_key_pair_name}'
73
+ aws.region = '#{@aws_region}'
74
+ aws.ami = '#{@aws_ami}'
75
+ aws.instance_type = '#{@aws_instance_type}'
76
+ aws.security_groups = ['#{@aws_security_group}']
77
+ end
78
+ } unless !@on_aws
79
+ script += %Q{ config.vm.provision "shell", path: "provision.sh"
80
+
81
+ config.trigger.before :halt do |trigger|
82
+ trigger.info = "Retrieving data before halt..."
83
+ trigger.run = {path: "before_halt.sh"}
84
+ end
51
85
  end
52
86
  }
53
87
  return script
metadata CHANGED
@@ -1,44 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xanthus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Pasquier
8
8
  - Xueyuan "Michael" Han
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-03-18 00:00:00.000000000 Z
12
+ date: 2021-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: json
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '2.3'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '2.3'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: bundler
16
30
  requirement: !ruby/object:Gem::Requirement
17
31
  requirements:
18
- - - ">="
32
+ - - "~>"
19
33
  - !ruby/object:Gem::Version
20
34
  version: '2.0'
21
35
  type: :development
22
36
  prerelease: false
23
37
  version_requirements: !ruby/object:Gem::Requirement
24
38
  requirements:
25
- - - ">="
39
+ - - "~>"
26
40
  - !ruby/object:Gem::Version
27
41
  version: '2.0'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: rake
30
44
  requirement: !ruby/object:Gem::Requirement
31
45
  requirements:
32
- - - ">="
46
+ - - "~>"
33
47
  - !ruby/object:Gem::Version
34
- version: '10.0'
48
+ version: '13'
35
49
  type: :development
36
50
  prerelease: false
37
51
  version_requirements: !ruby/object:Gem::Requirement
38
52
  requirements:
39
- - - ">="
53
+ - - "~>"
40
54
  - !ruby/object:Gem::Version
41
- version: '10.0'
55
+ version: '13'
42
56
  description: Automated intrusion detection dataset generation framework.
43
57
  email:
44
58
  - thomas.pasquier@bristol.ac.uk
@@ -52,10 +66,12 @@ files:
52
66
  - bin/xanthus
53
67
  - lib/xanthus.rb
54
68
  - lib/xanthus/configuration.rb
69
+ - lib/xanthus/dataverse.rb
55
70
  - lib/xanthus/default.rb
56
71
  - lib/xanthus/github.rb
57
72
  - lib/xanthus/init.rb
58
73
  - lib/xanthus/job.rb
74
+ - lib/xanthus/repository.rb
59
75
  - lib/xanthus/script.rb
60
76
  - lib/xanthus/version.rb
61
77
  - lib/xanthus/virtual_machine.rb
@@ -63,7 +79,7 @@ homepage: http://camflow.org
63
79
  licenses:
64
80
  - MIT
65
81
  metadata: {}
66
- post_install_message:
82
+ post_install_message:
67
83
  rdoc_options: []
68
84
  require_paths:
69
85
  - lib
@@ -78,9 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
94
  - !ruby/object:Gem::Version
79
95
  version: '0'
80
96
  requirements: []
81
- rubyforge_project:
82
- rubygems_version: 2.7.6
83
- signing_key:
97
+ rubygems_version: 3.2.15
98
+ signing_key:
84
99
  specification_version: 4
85
100
  summary: Automated intrusion detection dataset generation framework.
86
101
  test_files: []