firstiep

package module
v0.0.0-...-3a41b09 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 5 Imported by: 0

README

firstiep

GoDoc MIT License Go Report Card PRs Welcome

Tools for working with FIRST IEP (Information Exchange Policy) objects - https://www.first.org/iep/

Demo

Install

go get github.com/jakewarren/firstiep/...

Usage

As a library
package main

import (
	"fmt"

	"github.com/jakewarren/firstiep"
)

func main() {

	// create a new IEP object
	i := firstiep.New()
	
	// fill in fields you want represented
	i.TLP = "RED"

	// output the object for inspection
	fmt.Println(i)

	// perform validation on the object
	if err := i.Validate(); err == nil {
		fmt.Println("Valid!")
	} else {
		fmt.Println("Not valid:", err)
	}

}
As a cmd line utility

On the command line, run firstiep and follow the wizard to select the options you want, the tool will then output the JSON representation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IEP

type IEP struct {
	// Provides a unique ID to identify a specific IEP implementation.
	ID string `json:"id" validate:"nonzero"`
	// This statement can be used to provide a name for an IEP implementation.
	Name string `json:"name,omitempty"`
	// States the version of the IEP framework that has been used. e.g. 1.0
	Version int64 `json:"version,omitempty"`
	// This statement can be used to provide a URL reference to the specific IEP implementation.
	Reference string `json:"reference,omitempty"`
	// States the UTC date that the IEP is effective from.
	StartDate string `json:"start-date,omitempty"`
	// States the UTC date that the IEP is effective until.
	EndDate string `json:"end-date,omitempty"`
	// States whether the received information has to be encrypted when it is retransmitted by the recipient.
	EncryptInTransit string `json:"encrypt-in-transit,omitempty" validate:"regexp=(^$|MUST|MAY)"`
	// States whether the received information has to be encrypted by the Recipient when it is stored at rest.
	EncryptAtREST string `json:"encrypt-at-rest,omitempty" validate:"regexp=(^$|MUST|MAY)"`
	// States the permitted actions that Recipients can take upon information received.
	PermittedActions string `` /* 183-byte string literal not displayed */
	// Recipients are permitted notify affected third parties of a potential compromise or threat. Examples include permitting National CSIRTs to send notifications to affected constituents, or a service provider contacting affected customers.
	AffectedPartyNotifications string `json:"affected-party-notifications,omitempty" validate:"regexp=(^$|MAY|MUST NOT)"`
	// Recipients are permitted to redistribute the information received within the redistribution scope as defined by the enumerations. The enumerations “RED”, “AMBER”, “GREEN”, “WHITE” are to be interpreted as described in the FIRST Traffic Light Protocol Policy
	TLP string `json:"tlp,omitempty" validate:"regexp=(^$|RED|AMBER|GREEN|WHITE)"`
	// Recipients could be required to attribute or anonymize the Provider when redistributing the information received.
	Attribution string `json:"attribution,omitempty" validate:"regexp=(^$|MUST|MAY|MUST NOT)"`
	// Recipients could be required to obfuscate or anonymize information that could be used to identify the affected parties before redistributing the information received. 	Examples include removing affected parties IP addresses, or removing the affected parties names but leaving the affected parties industry vertical prior to sending a notification.
	ObfuscateAffectedParties string `json:"obfuscate-affected-parties,omitempty" validate:"regexp=(^$|MAY|MUST|MUST NOT)"`
	// States whether the recipient MAY or MUST NOT resell the information received unmodified or in a semantically equivalent format. e.g. transposing the information from a .csv file format to a .json file format would be considered semantically equivalent.
	UnmodifiedResale string `json:"unmodified-resale,omitempty" validate:"regexp=(^$|MUST NOT|MAY)"`
	// This statement can be used to convey a description or reference to any applicable licenses, agreements, or conditions between the producer and receiver. e.g. specific terms of use , contractual language, agreement name, or a URL.
	ExternalReference string `json:"external-reference,omitempty"`
}

IEP defines the information exchange policy https://www.first.org/iep/

func New

func New() *IEP

func (*IEP) String

func (r *IEP) String() string

func (*IEP) Validate

func (r *IEP) Validate() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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