opinion

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package opinion implements the STIX 2.1 Relationship object.

The following information comes directly from the STIX 2.1 specification.

An Opinion is an assessment of the correctness of the information in a STIX Object produced by a different entity. The primary property is the opinion property, which captures the level of agreement or disagreement using a fixed scale. That fixed scale also supports a numeric mapping to allow for consistent statistical operations across opinions.

For example, an analyst from a consuming organization might say that they "strongly disagree" with a Campaign object and provide an explanation about why. In a more automated workflow, a SOC operator might give an Indicator "one star" in their TIP (expressing "strongly disagree") because it is considered to be a false positive within their environment. Opinions are subjective, and the specification does not address how best to interpret them. Sharing communities are encouraged to provide clear guidelines to their constituents regarding best practice for the use of Opinion objects within the community.

Because Opinions are typically (though not always) created by human analysts and are comprised of human-oriented text, they contain an additional property to capture the analyst(s) that created the Opinion. This is distinct from the created_by_ref property, which is meant to capture the organization that created the object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opinion

type Opinion struct {
	objects.CommonObjectProperties
	Explanation string `json:"explanation,omitempty"`
	properties.AuthorsProperty
	Opinion string `json:"opinion,omitempty"`
	properties.ObjectRefsProperty
}
Opinion - This type implements the STIX 2 Opinion SDO and defines all of the

properties and methods needed to create and work with this object. All of the methods not defined local to this type are inherited from the individual properties.

func Decode

func Decode(data []byte) (*Opinion, error)
Decode - This function is a simple wrapper for decoding JSON data. It will

decode a slice of bytes into an actual struct and return a pointer to that object along with any errors.

func New

func New() *Opinion
New - This function will create a new STIX Opinion object and return

it as a pointer. It will also initialize the object by setting all of the basic properties.

func (*Opinion) Encode

func (o *Opinion) Encode() ([]byte, error)

Encode - This method is a simple wrapper for encoding an object into JSON

func (*Opinion) EncodeToString

func (o *Opinion) EncodeToString() (string, error)
EncodeToString - This method is a simple wrapper for encoding an object into

JSON

func (*Opinion) GetPropertyList

func (o *Opinion) GetPropertyList() []string
GetProperties - This method will return a list of all of the properties that

are unique to this object. This is used by the custom UnmarshalJSON for this object. It is defined here in this file to make it easy to keep in sync.

func (*Opinion) UnmarshalJSON

func (o *Opinion) UnmarshalJSON(b []byte) error
UnmarshalJSON - This method will over write the default UnmarshalJSON method

to enable custom properties that this library does not know about. It will store them as map where the value of each key is a byte arrays. This way a tool that does know how to deal with them can then further process them after this is done. This will also allow the storage of the raw JSON data.

func (*Opinion) Valid

func (o *Opinion) Valid() (bool, int, []string)
Valid - This method will verify and test all of the properties on an object

to make sure they are valid per the specification. It will return a boolean, an integer that tracks the number of problems found, and a slice of strings that contain the detailed results, whether good or bad.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL