ruby-stix2 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -1
- data/README.md +49 -3
- data/lib/stix2/base.rb +7 -0
- data/lib/stix2/common.rb +80 -15
- data/lib/stix2/confidence_scale.rb +106 -0
- data/lib/stix2/custom_object.rb +20 -0
- data/lib/stix2/cyberobservable_objects/email_message.rb +1 -1
- data/lib/stix2/cyberobservable_objects/network_traffic.rb +1 -1
- data/lib/stix2/cyberobservable_objects/process.rb +17 -0
- data/lib/stix2/cyberobservable_objects/user_account.rb +4 -4
- data/lib/stix2/cyberobservable_objects/x509_certificate.rb +3 -1
- data/lib/stix2/domain_objects/malware.rb +1 -1
- data/lib/stix2/enum.rb +59 -0
- data/lib/stix2/extension_definition.rb +10 -0
- data/lib/stix2/extensions/alternate_data_stream_type.rb +9 -0
- data/lib/stix2/extensions/archive_file.rb +8 -0
- data/lib/stix2/extensions/http_request.rb +12 -0
- data/lib/stix2/extensions/icmp.rb +8 -0
- data/lib/stix2/extensions/ntfs.rb +10 -0
- data/lib/stix2/extensions/pdf.rb +11 -0
- data/lib/stix2/extensions/raster_image.rb +10 -0
- data/lib/stix2/extensions/socket.rb +13 -0
- data/lib/stix2/extensions/tcp.rb +8 -0
- data/lib/stix2/extensions/unix_account.rb +10 -0
- data/lib/stix2/extensions/windows_pe_optional_header_type.rb +37 -0
- data/lib/stix2/extensions/windows_pe_section_type.rb +10 -0
- data/lib/stix2/extensions/windows_pebinary.rb +21 -0
- data/lib/stix2/extensions/windows_process.rb +13 -0
- data/lib/stix2/extensions/windows_service.rb +14 -0
- data/lib/stix2/external_reference.rb +1 -5
- data/lib/stix2/identifier.rb +2 -12
- data/lib/stix2/kill_chain_phase.rb +3 -7
- data/lib/stix2/languages.rb +236 -0
- data/lib/stix2/meta_objects/data_markings/base.rb +1 -4
- data/lib/stix2/meta_objects/data_markings/granular_marking.rb +1 -5
- data/lib/stix2/meta_objects/data_markings/object_marking.rb +2 -12
- data/lib/stix2/meta_objects/language_content.rb +1 -1
- data/lib/stix2/ov.rb +6 -0
- data/lib/stix2/relationship_objects/sighting.rb +1 -1
- data/lib/stix2/storage.rb +21 -15
- data/lib/stix2/version.rb +1 -1
- data/lib/stix2.rb +35 -7
- data/ruby-stix2.gemspec +9 -5
- metadata +40 -6
- data/lib/stix2/boolean.rb +0 -18
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-stix2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dario Lombardo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -108,7 +108,21 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.22.0
|
111
|
-
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: irb
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.7.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.7.0
|
125
|
+
description: 'Ruby implementation for the STIX protocol version 2.1. Full specs: https://docs.oasis-open.org/cti/stix/v2.1/stix-v2.1.html'
|
112
126
|
email: lomato@gmail.com
|
113
127
|
executables: []
|
114
128
|
extensions: []
|
@@ -122,9 +136,11 @@ files:
|
|
122
136
|
- README.md
|
123
137
|
- Rakefile
|
124
138
|
- lib/stix2.rb
|
125
|
-
- lib/stix2/
|
139
|
+
- lib/stix2/base.rb
|
126
140
|
- lib/stix2/bundle.rb
|
127
141
|
- lib/stix2/common.rb
|
142
|
+
- lib/stix2/confidence_scale.rb
|
143
|
+
- lib/stix2/custom_object.rb
|
128
144
|
- lib/stix2/cyberobservable_objects/artifact.rb
|
129
145
|
- lib/stix2/cyberobservable_objects/autonomous_system.rb
|
130
146
|
- lib/stix2/cyberobservable_objects/base.rb
|
@@ -139,6 +155,7 @@ files:
|
|
139
155
|
- lib/stix2/cyberobservable_objects/mac_addr.rb
|
140
156
|
- lib/stix2/cyberobservable_objects/mutex.rb
|
141
157
|
- lib/stix2/cyberobservable_objects/network_traffic.rb
|
158
|
+
- lib/stix2/cyberobservable_objects/process.rb
|
142
159
|
- lib/stix2/cyberobservable_objects/software.rb
|
143
160
|
- lib/stix2/cyberobservable_objects/url.rb
|
144
161
|
- lib/stix2/cyberobservable_objects/user_account.rb
|
@@ -166,9 +183,26 @@ files:
|
|
166
183
|
- lib/stix2/domain_objects/tool.rb
|
167
184
|
- lib/stix2/domain_objects/vulnerability.rb
|
168
185
|
- lib/stix2/enum.rb
|
186
|
+
- lib/stix2/extension_definition.rb
|
187
|
+
- lib/stix2/extensions/alternate_data_stream_type.rb
|
188
|
+
- lib/stix2/extensions/archive_file.rb
|
189
|
+
- lib/stix2/extensions/http_request.rb
|
190
|
+
- lib/stix2/extensions/icmp.rb
|
191
|
+
- lib/stix2/extensions/ntfs.rb
|
192
|
+
- lib/stix2/extensions/pdf.rb
|
193
|
+
- lib/stix2/extensions/raster_image.rb
|
194
|
+
- lib/stix2/extensions/socket.rb
|
195
|
+
- lib/stix2/extensions/tcp.rb
|
196
|
+
- lib/stix2/extensions/unix_account.rb
|
197
|
+
- lib/stix2/extensions/windows_pe_optional_header_type.rb
|
198
|
+
- lib/stix2/extensions/windows_pe_section_type.rb
|
199
|
+
- lib/stix2/extensions/windows_pebinary.rb
|
200
|
+
- lib/stix2/extensions/windows_process.rb
|
201
|
+
- lib/stix2/extensions/windows_service.rb
|
169
202
|
- lib/stix2/external_reference.rb
|
170
203
|
- lib/stix2/identifier.rb
|
171
204
|
- lib/stix2/kill_chain_phase.rb
|
205
|
+
- lib/stix2/languages.rb
|
172
206
|
- lib/stix2/meta_objects/base.rb
|
173
207
|
- lib/stix2/meta_objects/data_markings/base.rb
|
174
208
|
- lib/stix2/meta_objects/data_markings/granular_marking.rb
|
@@ -194,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
228
|
requirements:
|
195
229
|
- - ">="
|
196
230
|
- !ruby/object:Gem::Version
|
197
|
-
version: '
|
231
|
+
version: '2.7'
|
198
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
233
|
requirements:
|
200
234
|
- - ">="
|
@@ -204,5 +238,5 @@ requirements: []
|
|
204
238
|
rubygems_version: 3.3.26
|
205
239
|
signing_key:
|
206
240
|
specification_version: 4
|
207
|
-
summary: Ruby implementation for the STIX protocol version 2
|
241
|
+
summary: Ruby implementation for the STIX protocol version 2.1
|
208
242
|
test_files: []
|
data/lib/stix2/boolean.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module Stix2
|
2
|
-
class Boolean
|
3
|
-
def initialize(value)
|
4
|
-
case value
|
5
|
-
when String
|
6
|
-
@value = !!(value =~ /\A(true|t|yes|y|1)\z/i)
|
7
|
-
when Numeric
|
8
|
-
@value = !value.to_i.zero?
|
9
|
-
else
|
10
|
-
@value = (value == true)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def method_missing(m, *args, &block)
|
15
|
-
@value.send(m, *args, &block)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|