jira

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: Apache-2.0 Imports: 24 Imported by: 12

README

jira

Build Status Go Report Card GoDoc License PRs Welcome

jira

Documentation

Index

Constants

View Source
const (
	// DateFormatJira is used to parse the string dates that JIRA returns from API requests
	DateFormatJira = "2006-01-02T15:04:05.999-0700"

	// DateOnlyJira is used to set the date of JIRA tickets where more fine-grained dates is not needed
	DateOnlyJira = "2006-01-02"

	// QueryDateTimeFormatJira is the format of dates in a JQL
	QueryDateTimeFormatJira = "2006/01/02 15:04"
)
View Source
const (
	// MaxThreads defines the amount of threads create API calls for JIRA
	MaxThreads = 25

	// StatusReopened is the status of a ticket which a scanner confirmed its vulnerability still exists after it was marked resolved
	StatusReopened = "Reopened"

	// StatusClosedRemediated is the status of a ticket which was marked resolved, and had the vulnerability resolution confirmed by a scanner
	StatusClosedRemediated = "Closed-Remediated"

	// StatusClosedFalsePositive is the status of a ticket which has the vulnerability confirmed to be a false positive
	StatusClosedFalsePositive = "Closed-False-Positive"

	// StatusClosedDecommissioned is the status of a ticket for a vulnerability on a device that is no longer active
	StatusClosedDecommissioned = "Closed-Decommission"

	// StatusOpen is the status of a ticket which has not had any remediation steps taken
	StatusOpen = "Open"

	// StatusInProgress is the status of a ticket which is in the process of remediation
	StatusInProgress = "In-Progress"

	// StatusResolvedException is the status of a ticket which does not need to have the vulnerability remediated but not confirmed by a scanner
	StatusResolvedException = "Resolved-Exception"

	// StatusClosedException is the status of a ticket which does not need to have the vulnerability remediated
	StatusClosedException = "Closed-Exception"

	// StatusResolvedDecom is the status of a ticket for a vulnerability on a device that is no longer active but not confirmed by a scanner
	StatusResolvedDecom = "Resolved-Decommissioned"

	// StatusResolvedRemediated is the status of a ticket which was marked resolved but not confirmed by a scanner
	StatusResolvedRemediated = "Resolved-Remediated"

	// StatusResolvedFalsePositive is the status of a ticket which has the vulnerability confirmed to be a false positive but not verified by a scanner
	StatusResolvedFalsePositive = "Resolved-FalsePositive"

	// StatusClosedCerf is the status of a ticket that was closed due to an associated CERF (Candidate Exception Request Form)
	StatusClosedCerf = "Closed-CERF"

	// StatusClosedError is
	StatusClosedError = "Closed-Error"
)

Const for status maps These are used as KEYS to grab the equivalent mapped status from the JIRA payload

View Source
const Unassigned = "Unassigned"

Unassigned holds the string value of the assignee of a ticket that has yet to be assigned

Variables

View Source
var MappableFields = []string{
	backendMOD,
	backendSummary,
	backendHostname,
	backendIPAddress,
	backendMACAddress,
	backendServicePort,
	backendDescription,
	backendSolution,
	backendVRRPriority,
	backendScanDate,
	backendAssignmentGroup,
	backendResolutionDate,
	backendOperatingSystem,
	backendVulnerability,
	backendCVSS,
	backendVulnerabilityID,
	backendGroupID,
	backendDeviceID,
	backendScanID,
	backendOrg,
	backendCERF,
	backendCERFExpiration,
	backendCVEReferences,
	backendVendorReferences,
	backendOSDetailed,
	backendConfig,
	backendLastChecked,
	backendCloudID,
}

MappableFields contains a list of all custom fields used by Aegis that may need to be mapped to a different name for a field that uses custom fields with different names

Functions

This section is empty.

Types

type Action

type Action struct {
	ActionID          string  `xml:"id,attr"`
	TransitionName    string  `xml:"name,attr"`
	TransitionDetails Results `xml:"results>unconditional-result"`
}

Action is a member of Status and must be exported in order to be marshaled

type ActionID

type ActionID struct {
	ID string `xml:"id,attr"`
}

ActionID is a member of Action and must be exported in order to be marshaled

type AddBody

type AddBody struct {
	Body string `json:"body" structs:"body"`
}

AddBody is used in UpdateObjects and must be exported in order to be marshaled

type Assignee

type Assignee struct {
	Name string `json:"name,omitempty"`
}

Assignee is used in FieldStruct and must be exported in order to be marshaled

type AssignmentGroupResponse

type AssignmentGroupResponse struct {
	Name string `json:"name"`
}

AssignmentGroupResponse is a member of assignmentGroupResponseWrapper and must be exported in order to be marshaled

type CF

type CF struct {
	Value interface{} `json:"value,omitempty"`
	ID    int         `json:"id,omitempty"`
	Self  string      `json:"self,omitempty"`
	Name  interface{} `json:"name,omitempty"`
}

CF is used for parsing custom field information from the JIRA API back to the JIRA driver

type ConfigJira

type ConfigJira interface {
	EncryptionKey() string
}

ConfigJira is an interface that defines the fields that JIRA requires from the app config

type ConnectorJira

type ConnectorJira struct {
	CERFs sync.Map

	Fields        map[string]*Field
	Resolutions   map[string]*jira.Resolution
	Statuses      map[string]*jira.Status
	IssueTypes    map[string]jira.IssueType
	TransitionMap map[string]map[string][]workflowTransition
	// contains filtered or unexported fields
}

ConnectorJira is the struct that is used to make API calls against JIRA

func ConnectJira

func ConnectJira(api string, user string, password string, lstream logger) (connector *ConnectorJira, err error)

ConnectJira creates a JIRA connection using basic authentication

func NewJiraConnector

func NewJiraConnector(ctx context.Context, lstream logger, config domain.SourceConfig) (connector *ConnectorJira, token string, err error)

NewJiraConnector creates a new JIRA connector for interacting with a JIRA system it attempts to use Oauth if the information is present in the source config. If not, basic authentication is used

func (*ConnectorJira) AssignmentGroupExists

func (connector *ConnectorJira) AssignmentGroupExists(groupName string) (exists bool, err error)

AssignmentGroupExists checks to see if the input string is a valid assignment group in JIRA

func (*ConnectorJira) CreateTicket

func (connector *ConnectorJira) CreateTicket(ticket domain.Ticket) (sourceID int, sourceKey string, err error)

CreateTicket returns the source id and source key of the newly created ticket for logging in the database

func (*ConnectorJira) DeleteTicket

func (connector *ConnectorJira) DeleteTicket(id string) (err error)

DeleteTicket delete the ticket in JIRA corresponding to the id parameter. Used by the JIRA tool

func (*ConnectorJira) GetAdditionalTicketsForDecomDevices

func (connector *ConnectorJira) GetAdditionalTicketsForDecomDevices(tickets []domain.Ticket) (relatedTickets <-chan domain.Ticket, err error)

GetAdditionalTicketsForDecomDevices gets the additional tickets by looking for all the tickets for the decommed devices(except those with "Closed-Remediated".

func (*ConnectorJira) GetAdditionalTicketsForVulnPerDevice

func (connector *ConnectorJira) GetAdditionalTicketsForVulnPerDevice(tickets []domain.Ticket) (relatedTickets <-chan domain.Ticket, err error)

GetAdditionalTicketsForVulnPerDevice gets the additional tickets for the Vulns that have been scanned on all devices

func (*ConnectorJira) GetByCustomJQL

func (connector *ConnectorJira) GetByCustomJQL(JQL string) (tickets []domain.Ticket, err error)

GetByCustomJQL returns the tickets that JIRA returns for a JQL statement. Not used by the application but is useful for testing

func (*ConnectorJira) GetByCustomJQLChan

func (connector *ConnectorJira) GetByCustomJQLChan(JQL string) (ticketChan <-chan domain.Ticket)

GetByCustomJQLChan returns the tickets that JIRA returns for a JQL statement onto a channel

func (*ConnectorJira) GetCERFExpirationUpdates

func (connector *ConnectorJira) GetCERFExpirationUpdates(startDate time.Time) (cerfs map[string]time.Time, err error)

GetCERFExpirationUpdates returns a map relating CERF tickets to their expiration date. It only grabs tickets that expire after the startDate parameter

func (*ConnectorJira) GetCountOfTicketsInStatus

func (connector *ConnectorJira) GetCountOfTicketsInStatus(status string, orgCode string) (count int, err error)

GetCountOfTicketsInStatus returns the amount of tickets in a given status. Used by the API to populate dashboard information

func (*ConnectorJira) GetEditableFields

func (connector *ConnectorJira) GetEditableFields(id string) (err error)

GetEditableFields is not used by the project, but is useful for debugging as it prints the editable JIRA fields

func (*ConnectorJira) GetFieldMap

func (connector *ConnectorJira) GetFieldMap(in string) *Field

GetFieldMap returns the custom project field equivalent to the backend field name

func (*ConnectorJira) GetFieldMapName

func (connector *ConnectorJira) GetFieldMapName(in string) (out string)

GetFieldMapName returns the custom project field name equivalent to the backend field name

func (*ConnectorJira) GetFieldsForProject

func (connector *ConnectorJira) GetFieldsForProject(project string, includeNonMappables bool) (fields []string, err error)

GetFieldsForProject only returns the field allowed by the mappable_fields dictated in the jira payload. It is used by the API TODO should we just return the list of mappable fields in the connector payload? do we need to confirm with the API that the fields exist for the project?

func (*ConnectorJira) GetOpenTicketsByGroupID

func (connector *ConnectorJira) GetOpenTicketsByGroupID(methodOfDiscovery string, orgCode string, groupID string) (tickets <-chan domain.Ticket, err error)

GetOpenTicketsByGroupID returns tickets with an open status for an organization/method of discovery within a specified group For CIS tickets the entity ID is stored in the deviceID field, the ruleHash is stored in the vulnerabilityID field and the cloudAccountID is stored in the group ID

func (*ConnectorJira) GetProject

func (connector *ConnectorJira) GetProject() string

GetProject returns the project that a JIRA connection is pointing to (defined in the JIRA source config payload)

func (*ConnectorJira) GetStatusMap

func (connector *ConnectorJira) GetStatusMap(in string) string

GetStatusMap returns the mapped status to the status provided in the parameter. This is required as a JIRA project will have their own custom statuses that do not match the statuses defined in the application

func (*ConnectorJira) GetTicket

func (connector *ConnectorJira) GetTicket(sourceKey string) (ticket domain.Ticket, err error)

GetTicket returns a domain object containing information of the JIRA ticket relating to the SourceKey

func (*ConnectorJira) GetTicketsByClosedStatus

func (connector *ConnectorJira) GetTicketsByClosedStatus(orgCode string, methodOfDiscovery string, startDate time.Time) (tix <-chan domain.Ticket)

GetTicketsByClosedStatus retrieves closed exception and closed false positive tickets

func (*ConnectorJira) GetTicketsByDeviceIDVulnID

func (connector *ConnectorJira) GetTicketsByDeviceIDVulnID(methodOfDiscovery string, orgCode string, deviceID string, vulnID string, statuses map[string]bool, port int, protocol string) (tickets <-chan domain.Ticket, err error)

GetTicketsByDeviceIDVulnID returns tickets with the device and vulnerability id provided in the parameters

func (*ConnectorJira) GetTicketsForRescan

func (connector *ConnectorJira) GetTicketsForRescan(cerfs []domain.CERF, MethodOfDiscovery string, OrgCode string, Algorithm string) (tickets <-chan domain.Ticket, err error)

GetTicketsForRescan returns tickets for the rescan job. The type of rescan job is defined in Algorithm, and controls the tickets that are returned

func (*ConnectorJira) GetTicketsUpdatedSince

func (connector *ConnectorJira) GetTicketsUpdatedSince(since time.Time, orgCode string, methodOfDiscovery string) <-chan domain.Ticket

GetTicketsUpdatedSince get's all tickets that have been updated after the since date passed in

func (*ConnectorJira) Transition

func (connector *ConnectorJira) Transition(ticket domain.Ticket, toStatus string, comment string, assignTo string) (err error)

Transition changes the status of the ticket in JIRA (corresponding to the ticket parameter) to the parameter status

func (*ConnectorJira) UpdateTicket

func (connector *ConnectorJira) UpdateTicket(ticket domain.Ticket, comment string) (SourceID int, SourceKey string, err error)

UpdateTicket takes a ticket of an input. The equivalent JIRA ticket is pulled. The difference between the two tickets is calculated, and a payload is generated that transforms the existing JIRA issue into the issue that was passed as a parameter

type Field

type Field struct {
	ID          string   `json:"id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Custom      bool     `json:"custom,omitempty"`
	Orderable   bool     `json:"orderable,omitempty"`
	Navigable   bool     `json:"navigable,omitempty"`
	Searchable  bool     `json:"searchable,omitempty"`
	ClauseNames []string `json:"clauseNames,omitempty"`
	Schema      Schema   `json:"schema,omitempty"`
}

Field is used for parsing field information from the JIRA API

type FieldList

type FieldList struct {
	UpdatedDate        *time.Time  `json:"updateddate,omitempty"`
	ResolutionDate     string      `json:"resolutiondate,omitempty"`
	Project            *string     `json:"project,omitempty"`
	Summary            *string     `json:"summary,omitempty"`
	ProposedExpiration *time.Time  `json:"proposedexpiration,omitempty"`
	ReportedBy         *ValueField `json:"reportedby,omitempty"`
	Priority           *ValueField `json:"priority,omitempty"`
	MACAddress         *string     `json:"macaddress,omitempty"`
	Hostname           *string     `json:"hostname,omitempty"`
	GroupID            int32       `json:"groupid,omitempty"`
	ScanID             string      `json:"scanid,omitempty"`
	VulnerabilityID    string      `json:"vulnerabilityid,omitempty"`
	CreatedDate        *time.Time  `json:"created,omitempty"`
	Labels             *[]string   `json:"labels,omitempty"`
	CerfLink           string      `json:"cerflink,omitempty"`
	DeviceID           string      `json:"deviceid,omitempty"`
	AssignedTo         *Assignee   `json:"assignee,omitempty"`
	AssetsAffected     *string     `json:"assetsaffected,omitempty"`
	ScanErrata         *string     `json:"scanerrata,omitempty"`
	ResolutionStatus   *string     `json:"resolutionstatus,omitempty"`
	DueDate            *time.Time  `json:"duedate,omitempty"`
	AlertDate          *time.Time  `json:"alertdate,omitempty"`
	ServicePorts       *string     `json:"serviceports,omitempty"`
	TicketType         *string     `json:"issuetype,omitempty"`
	AssignmentGroup    *Assignee   `json:"assignmentgroup,omitempty"`
	MethodOfDiscovery  *ValueField `json:"methodofdiscovery,omitempty"`
	VulnerabilityTitle *string     `json:"vulnerabilitytitle,omitempty"`
	CveReferences      *string     `json:"cve_references,omitempty"`
	IPAddress          *string     `json:"ipaddress,omitempty"`
	ID                 int32       `json:"id,omitempty"`
	Title              string      `json:"title,omitempty"`
	Status             *string     `json:"status,omitempty"`
	OperatingSystem    *ValueField `json:"operatingsystem,omitempty"`
	CVSS               *ValueField `json:"cvss,omitempty"`
	OrganizationID     int32       `json:"organizationid,omitempty"`
	OrgCode            *string     `json:"org,omitempty"`
	Description        *string     `json:"description,omitempty"`
	VendorReferences   *string     `json:"vendor_references,omitempty"`
	Solution           *string     `json:"solution,omitempty"`
	LastChecked        *time.Time  `json:"lastchecked,omitempty"`
}

FieldList is a member of updateBlock and must be exported in order to be marshaled

type FieldStruct

type FieldStruct struct {
	ReopenReason   string    `json:"customfield_11360,omitempty"`
	ResolutionDate string    `json:"customfield_11364,omitempty"`
	Assignee       *Assignee `json:"assignee,omitempty"`
}

FieldStruct is used in createTransitionPayload and must be exported in order to be marshaled

type Issue

type Issue struct {
	Issue *jira.Issue
	// contains filtered or unexported fields
}

Issue holds the issue returned from JIRA and implements the domain.Ticket interface

func (*Issue) AlertDate

func (ji *Issue) AlertDate() (param *time.Time)

AlertDate gets the AlertDate parameter from the Ticket struct

func (*Issue) AlertDateOrDefault

func (ji *Issue) AlertDateOrDefault() (param time.Time)

AlertDateOrDefault gets the AlertDate parameter from the Ticket struct

func (*Issue) AssignedTo

func (ji *Issue) AssignedTo() (param *string)

AssignedTo gets the AssignedTo parameter from the Ticket struct

func (*Issue) AssignedToOrDefault

func (ji *Issue) AssignedToOrDefault() (param string)

AssignedToOrDefault gets the AssignedTo parameter from the Ticket struct

func (*Issue) AssignmentGroup

func (ji *Issue) AssignmentGroup() (param *string)

AssignmentGroup gets the AssignmentGroup parameter from the Ticket struct

func (*Issue) AssignmentGroupOrDefault

func (ji *Issue) AssignmentGroupOrDefault() (param string)

AssignmentGroupOrDefault gets the AssignmentGroup parameter from the Ticket struct

func (*Issue) CERF

func (ji *Issue) CERF() (param string)

CERF gets the CERF parameter from the Ticket struct

func (*Issue) CERFExpirationDate

func (ji *Issue) CERFExpirationDate() (param time.Time)

CERFExpirationDate gets the CERFExpirationDate parameter from the Ticket struct

func (*Issue) CVEReferences

func (ji *Issue) CVEReferences() (param *string)

CVEReferences gets the CVEReferences parameter from the Ticket struct

func (*Issue) CVEReferencesOrDefault

func (ji *Issue) CVEReferencesOrDefault() (param string)

CVEReferencesOrDefault gets the CVEReferences parameter from the Ticket struct

func (*Issue) CVSS

func (ji *Issue) CVSS() (param *float32)

CVSS gets the CVSS parameter from the Ticket struct

func (*Issue) CVSSOrDefault

func (ji *Issue) CVSSOrDefault() (param float32)

CVSSOrDefault gets the CVSS parameter from the Ticket struct

func (*Issue) CloudID

func (ji *Issue) CloudID() (param string)

CloudID gets the CloudID parameter from the Ticket struct

func (*Issue) Configs

func (ji *Issue) Configs() (param string)

Configs gets the Configs parameter from the Ticket struct

func (*Issue) CreatedDate

func (ji *Issue) CreatedDate() (param *time.Time)

CreatedDate gets the CreatedDate parameter from the Ticket struct

func (*Issue) CreatedDateOrDefault

func (ji *Issue) CreatedDateOrDefault() (param time.Time)

CreatedDateOrDefault gets the CreatedDate parameter from the Ticket struct

func (*Issue) DBCreatedDate

func (ji *Issue) DBCreatedDate() (param time.Time)

DBCreatedDate gets the DBCreatedDate parameter from the Ticket struct

func (*Issue) DBUpdatedDate

func (ji *Issue) DBUpdatedDate() (param *time.Time)

DBUpdatedDate gets the DBUpdatedDate parameter from the Ticket struct

func (*Issue) DBUpdatedDateOrDefault

func (ji *Issue) DBUpdatedDateOrDefault() (param time.Time)

DBUpdatedDateOrDefault gets the DBUpdatedDate parameter from the Ticket struct

func (*Issue) Description

func (ji *Issue) Description() (param *string)

Description gets the Description parameter from the Ticket struct

func (*Issue) DescriptionOrDefault

func (ji *Issue) DescriptionOrDefault() (param string)

DescriptionOrDefault gets the Description parameter from the Ticket struct

func (*Issue) DeviceID

func (ji *Issue) DeviceID() (param string)

DeviceID gets the DeviceID parameter from the Ticket struct

func (*Issue) DueDate

func (ji *Issue) DueDate() (param *time.Time)

DueDate gets the DueDate parameter from the Ticket struct

func (*Issue) DueDateOrDefault

func (ji *Issue) DueDateOrDefault() (param time.Time)

DueDateOrDefault gets the DueDate parameter from the Ticket struct

func (*Issue) GroupID

func (ji *Issue) GroupID() (param string)

GroupID gets the GroupID parameter from the Ticket struct

func (*Issue) HostName

func (ji *Issue) HostName() (param *string)

HostName gets the HostName parameter from the Ticket struct

func (*Issue) HostNameOrDefault

func (ji *Issue) HostNameOrDefault() (param string)

HostNameOrDefault gets the HostName parameter from the Ticket struct

func (*Issue) ID

func (ji *Issue) ID() (param int)

ID gets the ID parameter from the Ticket struct

func (*Issue) IPAddress

func (ji *Issue) IPAddress() (param *string)

IPAddress gets the IPAddress parameter from the Ticket struct

func (*Issue) IPAddressOrDefault

func (ji *Issue) IPAddressOrDefault() (param string)

IPAddressOrDefault gets the IPAddress parameter from the Ticket struct

func (*Issue) Labels

func (ji *Issue) Labels() (param *string)

Labels gets the Labels parameter from the Ticket struct

func (*Issue) LabelsOrDefault

func (ji *Issue) LabelsOrDefault() (param string)

LabelsOrDefault gets the Labels parameter from the Ticket struct

func (*Issue) LastChecked

func (ji *Issue) LastChecked() (param *time.Time)

LastChecked gets the LastChecked parameter from the Ticket struct

func (*Issue) LastCheckedOrDefault

func (ji *Issue) LastCheckedOrDefault() (param time.Time)

LastCheckedOrDefault gets the LastChecked parameter from the Ticket struct

func (*Issue) MacAddress

func (ji *Issue) MacAddress() (param *string)

MacAddress gets the MacAddress parameter from the Ticket struct

func (*Issue) MacAddressOrDefault

func (ji *Issue) MacAddressOrDefault() (param string)

MacAddressOrDefault gets the MacAddress parameter from the Ticket struct

func (*Issue) MethodOfDiscovery

func (ji *Issue) MethodOfDiscovery() (param *string)

MethodOfDiscovery gets the MethodOfDiscovery parameter from the Ticket struct

func (*Issue) MethodOfDiscoveryOrDefault

func (ji *Issue) MethodOfDiscoveryOrDefault() (param string)

MethodOfDiscoveryOrDefault gets the MethodOfDiscovery parameter from the Ticket struct

func (*Issue) OSDetailed

func (ji *Issue) OSDetailed() (param *string)

OSDetailed gets the OSDetailed parameter from the Ticket struct

func (*Issue) OSDetailedOrDefault

func (ji *Issue) OSDetailedOrDefault() (param string)

OSDetailedOrDefault gets the OSDetailed parameter from the Ticket struct

func (*Issue) OperatingSystem

func (ji *Issue) OperatingSystem() (param *string)

OperatingSystem gets the OperatingSystem parameter from the Ticket struct

func (*Issue) OperatingSystemOrDefault

func (ji *Issue) OperatingSystemOrDefault() (param string)

OperatingSystemOrDefault gets the OperatingSystem parameter from the Ticket struct

func (*Issue) OrgCode

func (ji *Issue) OrgCode() (param *string)

OrgCode gets the OrgCode parameter from the Ticket struct

func (*Issue) OrgCodeOrDefault

func (ji *Issue) OrgCodeOrDefault() (param string)

OrgCodeOrDefault gets the OrgCode parameter from the Ticket struct

func (*Issue) OrganizationID

func (ji *Issue) OrganizationID() (param string)

OrganizationID gets the OrganizationID parameter from the Ticket struct The OrganizationID is a database field, and is not relevant to JIRA tickets

func (*Issue) Packages

func (ji *Issue) Packages() (param *string)

Packages gets the Packages parameter from the Ticket struct

func (*Issue) PackagesOrDefault

func (ji *Issue) PackagesOrDefault() (param string)

PackagesOrDefault gets the Packages parameter from the Ticket struct

func (*Issue) Priority

func (ji *Issue) Priority() (param *string)

Priority gets the Priority parameter from the Ticket struct

func (*Issue) PriorityOrDefault

func (ji *Issue) PriorityOrDefault() (param string)

PriorityOrDefault gets the Priority parameter from the Ticket struct

func (*Issue) Project

func (ji *Issue) Project() (param *string)

Project gets the Project parameter from the Ticket struct

func (*Issue) ProjectOrDefault

func (ji *Issue) ProjectOrDefault() (param string)

ProjectOrDefault gets the Project parameter from the Ticket struct

func (*Issue) ReportedBy

func (ji *Issue) ReportedBy() (param *string)

ReportedBy gets the ReportedBy parameter from the Ticket struct

func (*Issue) ReportedByOrDefault

func (ji *Issue) ReportedByOrDefault() (param string)

ReportedByOrDefault gets the ReportedBy parameter from the Ticket struct

func (*Issue) ResolutionDate

func (ji *Issue) ResolutionDate() (param *time.Time)

ResolutionDate gets the ResolutionDate parameter from the Ticket struct

func (*Issue) ResolutionDateOrDefault

func (ji *Issue) ResolutionDateOrDefault() (param time.Time)

ResolutionDateOrDefault gets the ResolutionDate parameter from the Ticket struct

func (*Issue) ResolutionStatus

func (ji *Issue) ResolutionStatus() (param *string)

ResolutionStatus gets the ResolutionStatus parameter from the Ticket struct

func (*Issue) ResolutionStatusOrDefault

func (ji *Issue) ResolutionStatusOrDefault() (param string)

ResolutionStatusOrDefault gets the ResolutionStatus parameter from the Ticket struct

func (*Issue) ScanID

func (ji *Issue) ScanID() (param int)

ScanID gets the ScanID parameter from the Ticket struct

func (*Issue) ServicePorts

func (ji *Issue) ServicePorts() (param *string)

ServicePorts gets the ServicePorts parameter from the Ticket struct

func (*Issue) ServicePortsOrDefault

func (ji *Issue) ServicePortsOrDefault() (param string)

ServicePortsOrDefault gets the ServicePorts parameter from the Ticket struct

func (*Issue) SetAlertDate

func (ji *Issue) SetAlertDate(val time.Time)

SetAlertDate sets the AlertDate parameter from the Ticket struct

func (*Issue) SetAssignedTo

func (ji *Issue) SetAssignedTo(val string)

SetAssignedTo sets the AssignedTo parameter from the Ticket struct

func (*Issue) SetAssignmentGroup

func (ji *Issue) SetAssignmentGroup(val string)

SetAssignmentGroup sets the AssignmentGroup parameter from the Ticket struct

func (*Issue) SetCERF

func (ji *Issue) SetCERF(val string)

SetCERF sets the CERF parameter from the Ticket struct

func (*Issue) SetCERFExpirationDate

func (ji *Issue) SetCERFExpirationDate(val time.Time)

SetCERFExpirationDate sets the CERFExpirationDate parameter from the Ticket struct

func (*Issue) SetCVEReferences

func (ji *Issue) SetCVEReferences(val string)

SetCVEReferences sets the CVEReferences parameter from the Ticket struct

func (*Issue) SetCVSS

func (ji *Issue) SetCVSS(val float32)

SetCVSS sets the CVSS parameter from the Ticket struct

func (*Issue) SetCloudID

func (ji *Issue) SetCloudID(val string)

SetCloudID sets the CloudID parameter from the Ticket struct

func (*Issue) SetConfigs

func (ji *Issue) SetConfigs(val string)

SetConfigs sets the Configs parameter from the Ticket struct

func (*Issue) SetCreatedDate

func (ji *Issue) SetCreatedDate(val time.Time)

SetCreatedDate sets the CreatedDate parameter from the Ticket struct

func (*Issue) SetDBCreatedDate

func (ji *Issue) SetDBCreatedDate(val time.Time)

SetDBCreatedDate sets the DBCreatedDate parameter from the Ticket struct

func (*Issue) SetDBUpdatedDate

func (ji *Issue) SetDBUpdatedDate(val time.Time)

SetDBUpdatedDate sets the DBUpdatedDate parameter from the Ticket struct

func (*Issue) SetDescription

func (ji *Issue) SetDescription(val string)

SetDescription sets the Description parameter from the Ticket struct

func (*Issue) SetDeviceID

func (ji *Issue) SetDeviceID(val string)

SetDeviceID sets the DeviceID parameter from the Ticket struct

func (*Issue) SetDueDate

func (ji *Issue) SetDueDate(val time.Time)

SetDueDate sets the DueDate parameter from the Ticket struct

func (*Issue) SetGroupID

func (ji *Issue) SetGroupID(val string)

SetGroupID sets the GroupID parameter from the Ticket struct

func (*Issue) SetHostName

func (ji *Issue) SetHostName(val string)

SetHostName sets the HostName parameter from the Ticket struct

func (*Issue) SetID

func (ji *Issue) SetID(val int)

SetID sets the ID parameter from the Ticket struct

func (*Issue) SetIPAddress

func (ji *Issue) SetIPAddress(val string)

SetIPAddress sets the IPAddress parameter from the Ticket struct

func (*Issue) SetLabels

func (ji *Issue) SetLabels(val string)

SetLabels sets the Labels parameter from the Ticket struct

func (*Issue) SetLastChecked

func (ji *Issue) SetLastChecked(val time.Time)

SetLastChecked sets the LastChecked parameter from the Ticket struct

func (*Issue) SetMacAddress

func (ji *Issue) SetMacAddress(val string)

SetMacAddress sets the MacAddress parameter from the Ticket struct

func (*Issue) SetMethodOfDiscovery

func (ji *Issue) SetMethodOfDiscovery(val string)

SetMethodOfDiscovery sets the MethodOfDiscovery parameter from the Ticket struct

func (*Issue) SetOSDetailed

func (ji *Issue) SetOSDetailed(val string)

SetOSDetailed sets the OSDetailed parameter from the Ticket struct

func (*Issue) SetOperatingSystem

func (ji *Issue) SetOperatingSystem(val string)

SetOperatingSystem sets the OperatingSystem parameter from the Ticket struct

func (*Issue) SetOrgCode

func (ji *Issue) SetOrgCode(val string)

SetOrgCode sets the OrgCode parameter from the Ticket struct

func (*Issue) SetOrganizationID

func (ji *Issue) SetOrganizationID(val string)

SetOrganizationID sets the OrganizationID parameter from the Ticket struct

func (*Issue) SetPackages

func (ji *Issue) SetPackages(val string)

SetPackages sets the Packages parameter from the Ticket struct

func (*Issue) SetPriority

func (ji *Issue) SetPriority(val string)

SetPriority sets the Priority parameter from the Ticket struct

func (*Issue) SetProject

func (ji *Issue) SetProject(val string)

SetProject sets the Project parameter from the Ticket struct

func (*Issue) SetReportedBy

func (ji *Issue) SetReportedBy(val string)

SetReportedBy sets the ReportedBy parameter from the Ticket struct

func (*Issue) SetResolutionDate

func (ji *Issue) SetResolutionDate(val time.Time)

SetResolutionDate sets the ResolutionDate parameter from the Ticket struct

func (*Issue) SetResolutionStatus

func (ji *Issue) SetResolutionStatus(val string)

SetResolutionStatus sets the ResolutionStatus parameter from the Ticket struct

func (*Issue) SetScanID

func (ji *Issue) SetScanID(val int)

SetScanID sets the ScanID parameter from the Ticket struct

func (*Issue) SetServicePorts

func (ji *Issue) SetServicePorts(val string)

SetServicePorts sets the ServicePorts parameter from the Ticket struct

func (*Issue) SetSolution

func (ji *Issue) SetSolution(val string)

SetSolution sets the Solution parameter from the Ticket struct

func (*Issue) SetStatus

func (ji *Issue) SetStatus(val string)

SetStatus sets the Status parameter from the Ticket struct

func (*Issue) SetSummary

func (ji *Issue) SetSummary(val string)

SetSummary sets the Summary parameter from the Ticket struct

func (*Issue) SetTicketType

func (ji *Issue) SetTicketType(val string)

SetTicketType sets the TicketType parameter from the Ticket struct

func (*Issue) SetTitle

func (ji *Issue) SetTitle(val string)

SetTitle sets the Title parameter from the Ticket struct

func (*Issue) SetUpdatedDate

func (ji *Issue) SetUpdatedDate(val time.Time)

SetUpdatedDate sets the UpdatedDate parameter from the Ticket struct

func (*Issue) SetVendorReferences

func (ji *Issue) SetVendorReferences(val string)

SetVendorReferences sets the VendorReferences parameter from the Ticket struct

func (*Issue) SetVulnerabilityID

func (ji *Issue) SetVulnerabilityID(val string)

SetVulnerabilityID sets the VulnerabilityID parameter from the Ticket struct

func (*Issue) SetVulnerabilityTitle

func (ji *Issue) SetVulnerabilityTitle(val string)

SetVulnerabilityTitle sets the VulnerabilityTitle parameter from the Ticket struct

func (*Issue) Solution

func (ji *Issue) Solution() (param *string)

Solution gets the Solution parameter from the Ticket struct

func (*Issue) SolutionOrDefault

func (ji *Issue) SolutionOrDefault() (param string)

SolutionOrDefault gets the Solution parameter from the Ticket struct

func (*Issue) Status

func (ji *Issue) Status() (param *string)

Status gets the Status parameter from the Ticket struct

func (*Issue) StatusOrDefault

func (ji *Issue) StatusOrDefault() (param string)

StatusOrDefault gets the Status parameter from the Ticket struct

func (*Issue) Summary

func (ji *Issue) Summary() (param *string)

Summary gets the Summary parameter from the Ticket struct

func (*Issue) SummaryOrDefault

func (ji *Issue) SummaryOrDefault() (param string)

SummaryOrDefault gets the Summary parameter from the Ticket struct

func (*Issue) TicketType

func (ji *Issue) TicketType() (param *string)

TicketType gets the TicketType parameter from the Ticket struct

func (*Issue) TicketTypeOrDefault

func (ji *Issue) TicketTypeOrDefault() (param string)

TicketTypeOrDefault gets the TicketType parameter from the Ticket struct

func (*Issue) Title

func (ji *Issue) Title() (param string)

Title gets the Title parameter from the Ticket struct

func (*Issue) UpdatedDate

func (ji *Issue) UpdatedDate() (param *time.Time)

UpdatedDate gets the UpdatedDate parameter from the Ticket struct

func (*Issue) UpdatedDateOrDefault

func (ji *Issue) UpdatedDateOrDefault() (param time.Time)

UpdatedDateOrDefault gets the UpdatedDate parameter from the Ticket struct

func (*Issue) VendorReferences

func (ji *Issue) VendorReferences() (param *string)

VendorReferences gets the VendorReferences parameter from the Ticket struct

func (*Issue) VendorReferencesOrDefault

func (ji *Issue) VendorReferencesOrDefault() (param string)

VendorReferencesOrDefault gets the VendorReferences parameter from the Ticket struct

func (*Issue) VulnerabilityID

func (ji *Issue) VulnerabilityID() (param string)

VulnerabilityID gets the VulnerabilityID parameter from the Ticket struct

func (*Issue) VulnerabilityTitle

func (ji *Issue) VulnerabilityTitle() (param *string)

VulnerabilityTitle gets the VulnerabilityTitle parameter from the Ticket struct

func (*Issue) VulnerabilityTitleOrDefault

func (ji *Issue) VulnerabilityTitleOrDefault() (param string)

VulnerabilityTitleOrDefault gets the VulnerabilityTitle parameter from the Ticket struct

type PayloadJira

type PayloadJira struct {
	Project string `json:"project"`

	// Mappable fields is used by the UI to discern which JIRA fields can be mapped to a field supplied by a cloud provider
	MappableFields []string `json:"mappable_fields,omitempty"`

	// Maps the Aegis name for a status to the JIRA-specific name for a status
	StatusMap map[string]string `json:"status_map"`

	// Maps the Aegis name for a field to the JIRA-specific name for a field
	FieldMap map[string]string `json:"field_map"`
}

PayloadJira contains the structure of the JSON fields that need to be loaded from the JIRA source config

type Query

type Query struct {
	JQL    string
	Size   int
	Fields map[string]bool
}

Query is the struct that is used to execute a JQL against JIRA

func NewQuery

func NewQuery() (q *Query)

NewQuery initializes the Query object for querying JIRA's JQL

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request contains the fields required to make a JIRA API call and process the result

type Results

type Results struct {
	DestinationStatusID string `xml:"step,attr"`
}

Results in a member of Action and must be exported in order to be marshaled

type Schema

type Schema struct {
	Type     string `json:"type,omitempty"`
	Custom   string `json:"custom,omitempty"`
	CustomID int    `json:"customId,omitempty"`
}

Schema is used in field and must be exported in order to be marshaled

type Status

type Status struct {
	StatusName    string     `xml:"name,attr"`
	StatusID      string     `xml:"id,attr"`
	Actions       []Action   `xml:"actions>action"`
	CommonActions []ActionID `xml:"actions>common-action"`
}

Status is a member of workflow and must be exported in order to be marshaled

type Transition

type Transition struct {
	ID     string                     `json:"id"     structs:"id"`
	Name   string                     `json:"name"   structs:"name"`
	To     Status                     `json:"to"     structs:"status"`
	Fields map[string]TransitionField `json:"fields" structs:"fields"`
}

Transition is used in transitionResult and must be exported in order to be marshaled

type TransitionField

type TransitionField struct {
	Required bool   `json:"required"`
	Name     string `json:"name"`
}

TransitionField is used in Transition and must be exported in order to be marshaled

type TransitionPayload

type TransitionPayload struct {
	ID       string  `json:"id" structs:"id"`
	Assignee *string `json:"assignee,omitempty"`
	Unknowns tcontainer.MarshalMap
}

TransitionPayload is used in createTransitionPayload and must be exported in order to be marshaled

type Update

type Update struct {
	Comment []UpdateObjects `json:"comment,omitempty" structs:"comment" `
}

Update is used in createTransitionPayload and must be exported in order to be marshaled

type UpdateObjects

type UpdateObjects struct {
	Add AddBody `json:"add,omitempty" structs:"add" `
}

UpdateObjects is used in Update and must be exported in order to be marshaled

type ValueField

type ValueField struct {
	Value string `json:"value,omitempty"`
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
}

ValueField is a member of FieldList and must be exported in order to be marshaled

Jump to

Keyboard shortcuts

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