Documentation ¶
Overview ¶
Package godradis provides a full-featured library for accessing the Dradis server REST API.
Index ¶
- type Attachment
- type Author
- type Client
- type Config
- type Evidence
- type EvidenceIssue
- type Godradis
- func (gd *Godradis) Configure(url, apiKey string, verify bool)
- func (gd *Godradis) CreateEvidence(node *Node, issue *Issue, content *orderedmap.OrderedMap) (Evidence, error)
- func (gd *Godradis) CreateEvidenceFromText(node *Node, issue *Issue, content string) (Evidence, error)
- func (gd *Godradis) CreateIssue(project *Project, fields *orderedmap.OrderedMap) (Issue, error)
- func (gd *Godradis) CreateIssueFromText(project *Project, text string) (Issue, error)
- func (gd *Godradis) CreateIssueLibraryEntry(fields *orderedmap.OrderedMap) (IssueLibEntry, error)
- func (gd *Godradis) CreateIssueLibraryEntryFromText(content string) (IssueLibEntry, error)
- func (gd *Godradis) CreateNode(project *Project, label string, typeId int, parentId int, position int) (Node, error)
- func (gd *Godradis) CreateNote(node *Node, fields *orderedmap.OrderedMap, categoryId ...int) (Note, error)
- func (gd *Godradis) CreateNoteFromText(node *Node, text string, categoryId ...int) (Note, error)
- func (gd *Godradis) CreateProject(name string, clientId int, reportTemplatePropertiesId interface{}, ...) (Project, error)
- func (gd *Godradis) CreateTeam(name string, teamSince ...string) (Team, error)
- func (gd *Godradis) DeleteAttachment(attachment *Attachment) error
- func (gd *Godradis) DeleteEvidence(evidence *Evidence) error
- func (gd *Godradis) DeleteIssue(i *Issue) error
- func (gd *Godradis) DeleteIssueLibraryById(entry IssueLibEntry) error
- func (gd *Godradis) DeleteNode(n *Node) error
- func (gd *Godradis) DeleteNote(note *Note) error
- func (gd *Godradis) DeleteProject(p *Project) error
- func (gd *Godradis) DeleteTeam(t *Team) error
- func (gd *Godradis) GetAllAttachments(node *Node) ([]Attachment, error)
- func (gd *Godradis) GetAllEvidence(node *Node) ([]Evidence, error)
- func (gd *Godradis) GetAllIssues(project *Project) ([]Issue, error)
- func (gd *Godradis) GetAllNodes(project *Project) ([]Node, error)
- func (gd *Godradis) GetAllNotes(node *Node) ([]Note, error)
- func (gd *Godradis) GetAllProjects() ([]Project, error)
- func (gd *Godradis) GetAllTeams() ([]Team, error)
- func (gd *Godradis) GetAttachmentByName(node *Node, filename string) (Attachment, error)
- func (gd *Godradis) GetEvidenceById(node *Node, id int) (Evidence, error)
- func (gd *Godradis) GetIssueById(project *Project, id int) (Issue, error)
- func (gd *Godradis) GetIssueByTitle(project *Project, title string) (Issue, error)
- func (gd *Godradis) GetIssueLibrary() ([]IssueLibEntry, error)
- func (gd *Godradis) GetIssueLibraryById(id int) (IssueLibEntry, error)
- func (gd *Godradis) GetNodeById(project *Project, id int) (Node, error)
- func (gd *Godradis) GetNodeByLabel(project *Project, label string) (Node, error)
- func (gd *Godradis) GetNoteById(node *Node, id int) (Note, error)
- func (gd *Godradis) GetNoteByTitle(node *Node, title string) (Note, error)
- func (gd *Godradis) GetProjectById(id int) (Project, error)
- func (gd *Godradis) GetProjectByName(name string) (Project, error)
- func (gd *Godradis) GetTeamById(id int) (Team, error)
- func (gd *Godradis) GetTeamByName(name string) (Team, error)
- func (gd *Godradis) LoadConfig(filename string) error
- func (gd *Godradis) UpdateEvidence(evidence *Evidence, fields *orderedmap.OrderedMap, issue ...*Issue) error
- func (gd *Godradis) UpdateEvidenceFromText(evidence *Evidence, content string, issue ...*Issue) error
- func (gd *Godradis) UpdateIssue(issue *Issue, fields *orderedmap.OrderedMap) error
- func (gd *Godradis) UpdateIssueFromText(issue *Issue, text string) error
- func (gd *Godradis) UpdateIssueLibraryEntry(entry *IssueLibEntry, fields *orderedmap.OrderedMap) error
- func (gd *Godradis) UpdateIssueLibraryEntryFromText(entry *IssueLibEntry, content string) error
- func (gd *Godradis) UpdateNode(n *Node, label, typeId, parentId, position interface{}) error
- func (gd *Godradis) UpdateNote(note *Note, fields *orderedmap.OrderedMap, categoryId ...int) error
- func (gd *Godradis) UpdateNoteFromText(note *Note, text string, categoryId ...int) error
- func (gd *Godradis) UpdateProject(p *Project, name, clientId, reportTemplatePropertiesId interface{}, ...) error
- func (gd *Godradis) UpdateTeam(t *Team, name, teamSince interface{}) error
- func (gd *Godradis) UploadAttachments(node *Node, filePath []string) ([]Attachment, error)
- type Issue
- type IssueLibEntry
- type Node
- type Note
- type Owner
- type Project
- type Team
- type TeamProject
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Evidence ¶
type Evidence struct { Id int `json:"id"` Content string `json:"content"` Fields orderedmap.OrderedMap `json:"fields"` Issue EvidenceIssue `json:"issue"` Node *Node }
func (*Evidence) CopyFields ¶
func (e *Evidence) CopyFields() orderedmap.OrderedMap
type EvidenceIssue ¶
type Godradis ¶
type Godradis struct { Config Config // contains filtered or unexported fields }
func (*Godradis) Configure ¶
Configure populates godradis with parameters necessary to access the Dradis server. url should be the base url of the Dradis server, before "/pro/api" and without a trailing "/" (e.g. https://example.com). apiKey is a string containing the API key shown on the user's Dradis profile page. verify instructs godradis whether to check TLS certificates on the Dradis server.
After creating the configuration, Configure creates an http.client on the Godradis object to be used for all subsequent HTTP requests to the Dradis server.
gd := godradis.Godradis{} gd.Configure("https://example.com", "abcdefghijk", false)
func (*Godradis) CreateEvidence ¶
func (gd *Godradis) CreateEvidence(node *Node, issue *Issue, content *orderedmap.OrderedMap) (Evidence, error)
CreateEvidence takes references to existing Node and Issue objects, and an OrderedMap object containing the content of the Evidence instance. The Evidence is attached to the node and issue on the Dradis server and a local Evidence object is returned.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") issue, _ := gd.GetIssueByTitle(&project, "Cross-Site Scripting") content := orderedmap.New() content.Set("Port", "443/tcp") content.Set("Reportable", "True") content.Set("Details", "Lorem ipsum dolor sit amet") evidence, _ := gd.CreateEvidence(&node, &issue, content)
func (*Godradis) CreateEvidenceFromText ¶
func (gd *Godradis) CreateEvidenceFromText(node *Node, issue *Issue, content string) (Evidence, error)
CreateEvidenceFromText provides an alternate method for creating evidence directly from a text string as opposed to the OrderedMap approach used by CreateEvidence. CreateEvidenceFromText takes references to Node and Issue objects and a string containing the raw body content and returns the newly created Evidence instance.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") issue, _ := gd.GetIssueByTitle(&project, "Cross-Site Scripting") evidence, _ := gd.CreateEvidence(&node, &issue, "#[Port]#\r\n443/tcp\r\n\r\n#[Details]#\r\nLorem ipsum dolor\r\n\r\n")
func (*Godradis) CreateIssue ¶
func (gd *Godradis) CreateIssue(project *Project, fields *orderedmap.OrderedMap) (Issue, error)
CreateIssue takes a reference to a Project object and an OrderedMap containing the fields in the Issue body, creates a new Issue on the server, and returns it.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") fields := orderedmap.New() fields.Set("Title", "Insecure Password Storage") fields.Set("Severity", "High") fields.Set("Finding Information", "Lorem ipsum dolor sit amet") issue, _ := gd.CreateIssue(&project, fields)
func (*Godradis) CreateIssueFromText ¶
CreateIssueFromText provides an alternate method for creating issues directly from a text string as opposed to the OrderedMap approach used by CreateIssue. CreateIssueFromText takes a reference to a Project object and a string containing the raw body content and returns the newly created Issue.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issue, _ = gd.CreateIssueFromText(&project, "#[Title]#\r\nInsecure Password Storage\r\n\r\n#[Severity]#\r\nHigh")
func (*Godradis) CreateIssueLibraryEntry ¶
func (gd *Godradis) CreateIssueLibraryEntry(fields *orderedmap.OrderedMap) (IssueLibEntry, error)
func (*Godradis) CreateIssueLibraryEntryFromText ¶
func (gd *Godradis) CreateIssueLibraryEntryFromText(content string) (IssueLibEntry, error)
func (*Godradis) CreateNode ¶
func (gd *Godradis) CreateNode(project *Project, label string, typeId int, parentId int, position int) (Node, error)
CreateNode takes a reference to a Project object and several mandatory properties and creates a new Node on the server and returns it. label is a string representing the name of the node. typeId is an int and can be 0 (a "default" node) or 1 (a "host" node). parentId is an int indicating the ID of the parent node if there is one, otherwise it will be created as a top-level node. position is an int that determines where to insert the node within the existing node structure.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") node, _ := gd.CreateNode(&project, "127.0.0.1", 1, 14, 3)
func (*Godradis) CreateNote ¶
func (gd *Godradis) CreateNote(node *Node, fields *orderedmap.OrderedMap, categoryId ...int) (Note, error)
CreateNote takes a reference to an existing Node object, an OrderedMap object containing the content of the Note, and an optional integer category ID that sets the note category (Defaults to "Default Category" in Dradis). The Note is attached to the node on the Dradis server and a local Note object is returned.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") fields := orderedmap.New() fields.Set("Hostnames", "foo.com\r\nexample.foo.com") note, _ := gd.CreateNote(&node, fields)
func (*Godradis) CreateNoteFromText ¶
CreateNoteFromText takes a reference to an existing Node object, a string containing the body of the Note, and an optional integer category ID that sets the note category (Defaults to "Default Category" in Dradis). The Note is attached to the node on the Dradis server and a local Note object is returned.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") text := "#[Hostnames]\r\nfoo.com\r\nexample.foo.com\r\n\r\n# note, _ := gd.CreateNote(&node, text)
func (*Godradis) CreateProject ¶
func (gd *Godradis) CreateProject(name string, clientId int, reportTemplatePropertiesId interface{}, authorIds []int, template interface{}) (Project, error)
CreateProject creates a project on the Dradis server and returns the newly created Project object. All 5 arguments are required in the function call, but only name and clientId must be non-nil. reportTemplatePropertiesId is an optional int that assigns a default report template to the project. authorIds accepts an int slice of authors to assign to the project. template is an optional string that assigns the project template based on the template name.
gd := godradis.Godradis{} [...] authors := [2]int[]{3, 4} project, _ := gd.CreateProject("New Project Name", 1, nil, authors[:], nil) fmt.Printf("%v", project.Name)
func (*Godradis) CreateTeam ¶
CreateTeam takes a name and optional teamSince (in the form "YYYY-MM-DD") string and creates a new Team on the server, returning a new Team object. teamSince defaults to the current date if it's not passed as an argument.
gd := godradis.Godradis{} [...] team, _ := gd.CreateTeam("New Team", "2019-01-01") otherTeam, _ := gd.CreateTeam("Other Team")
func (*Godradis) DeleteAttachment ¶
func (gd *Godradis) DeleteAttachment(attachment *Attachment) error
DeleteAttachment takes a reference to an existing Attachment object and deletes it from the server. The local Attachment object reference is set to nil.
func (*Godradis) DeleteEvidence ¶
DeleteEvidence takes a reference to an existing Evidence object and deletes it on the server.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") evidence, _ := gd.GetEvidenceById(&node, 4) _ := gd.DeleteEvidence(&evidence)
func (*Godradis) DeleteIssue ¶
DeleteIssue takes a reference to an existing Issue object and deletes it on the server.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issue, _ := gd.GetIssueByTitle(&project, "Cross-Site Scripting") _ := gd.DeleteIssue(&issue)
func (*Godradis) DeleteIssueLibraryById ¶
func (gd *Godradis) DeleteIssueLibraryById(entry IssueLibEntry) error
func (*Godradis) DeleteNode ¶
DeleteNode takes a reference to an existing Node object and deletes it on the server.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") _ := gd.DeleteNode(&node)
func (*Godradis) DeleteNote ¶
DeleteNote takes a reference to an existing Note object and deletes it on the server.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") note, _ := gd.GetNoteByTitle(&node, "Nmap Host Info") _ := gd.DeleteNote(¬e)
func (*Godradis) DeleteProject ¶
DeleteProject takes a reference to a Project object and deletes the project on the Dradis server.
gd := godradis.Godradis{} [...] project, _ := gd.CreateProject("New Project Name", 1, nil, nil, nil) err := gd.DeleteProject(&project) if err != nil { fmt.Println(err) }
func (*Godradis) DeleteTeam ¶
DeleteTeam takes a reference to a Team object and deletes the team on the server.
gd := godradis.Godradis{} [...] team, _ := gd.CreateTeam("New Team", "2019-01-01") err := gd.DeleteTeam(&team) if err != nil { fmt.Println(err) }
func (*Godradis) GetAllAttachments ¶
func (gd *Godradis) GetAllAttachments(node *Node) ([]Attachment, error)
GetAllAttachments takes a reference to an existing Node object and returns a slice of all attachments associated with that node.
func (*Godradis) GetAllEvidence ¶
GetAllEvidence takes a reference to a Node object and returns a list of all Evidence instances exist on the server for that node.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") evidences, _ := gd.GetAllEvidence(&node)
func (*Godradis) GetAllIssues ¶
GetAllIssues takes a reference to a Project object and returns a list of all Issues that exist on the server for that project.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issues, _ := gd.GetAllIssues(&project)
func (*Godradis) GetAllNodes ¶
GetAllNodes takes a reference to a Project object and returns a list of all Nodes that exist on the server for that project.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") nodes, _ := gd.GetAllNodes(&project)
func (*Godradis) GetAllNotes ¶
GetAllNotes takes a reference to a Node object and returns a list of all Notes attached to that node on the server.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") notes, _ := gd.GetAllNotes(&node)
func (*Godradis) GetAllProjects ¶
GetAllProjects takes no arguments and retrieves a full list of all projects on the Dradis server. If an error of any kind occurs, the function will return an empty rather than partial list as well as the error.
gd := godradis.Godradis{} [...] projectList, _ := gd.GetAllProjects() if len(projectList) > 0 { fmt.Printf("%v", projectList[0].Name) }
func (*Godradis) GetAllTeams ¶
GetAllTeams takes no arguments and returns a list of all teams on the server.
gd := godradis.Godradis{} [...] teamList, _ := gd.GetAllTeams() if len(teamList) > 0 { fmt.Printf("%v", teamList[0].Name) }
func (*Godradis) GetAttachmentByName ¶
func (gd *Godradis) GetAttachmentByName(node *Node, filename string) (Attachment, error)
GetAttachmentByName takes a reference to an existing Node object and a string filename and returns an Attachment object if it is found on the server.
func (*Godradis) GetEvidenceById ¶
GetEvidenceById takes a reference to a Node object and int id and returns the Evidence instance associated with that id.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") evidence, _ := gd.GetEvidenceById(&node, 7)
func (*Godradis) GetIssueById ¶
GetIssueById takes a reference to a Project object and int id and returns the Issue associated with that id.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issue, _ := gd.GetIssueById(&project, 12)
func (*Godradis) GetIssueByTitle ¶
GetIssueByTitle searches for and returns an Issue object based on the title. GetIssueByTitle works by calling GetAllIssues first and then ranges over them comparing the title strings.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issue, _ := gd.GetIssueByTitle(&project, "Cross-Site Scripting")
func (*Godradis) GetIssueLibrary ¶
func (gd *Godradis) GetIssueLibrary() ([]IssueLibEntry, error)
func (*Godradis) GetIssueLibraryById ¶
func (gd *Godradis) GetIssueLibraryById(id int) (IssueLibEntry, error)
func (*Godradis) GetNodeById ¶
GetNodeById takes a reference to a Project object and int id and returns the node associated with that id.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") node, _ := gd.GetNodeById(&project, 7)
func (*Godradis) GetNodeByLabel ¶
GetNodeByLabel searches for and returns a Node object based on the label. GetNodeByLabel works by calling GetAllNodes first and then ranges over them comparing the label strings.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") node, _ := gd.GetNodeByLabel(&project, "127.0.0.1")
func (*Godradis) GetNoteById ¶
GetNoteById takes a reference to a Node object and int id and returns the Note instance associated with that id.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") note, _ := gd.GetNoteById(&node, 7)
func (*Godradis) GetNoteByTitle ¶
GetNoteByTitle takes a reference to a Node object and string title and returns the first Note instance associated with that title.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") note, _ := gd.GetNoteByTitle(&node, "Nmap Host Info")
func (*Godradis) GetProjectById ¶
GetProjectById fetches a Project object from the Dradis server based on the int id.
gd := godradis.Godradis{} [...] project, err := gd.GetProjectById(45) if err != nil { fmt.Println(err) }
func (*Godradis) GetProjectByName ¶
GetProjectByName searches for and returns a Project object based on the name. GetProjectByName works by calling GetAllProjects first and then ranges over them comparing the name strings.
gd := godradis.Godradis{} [...] project, err := gd.GetProjectByName("Foobar External Network Penetration Test") if err != nil { fmt.Println(err) }
func (*Godradis) GetTeamById ¶
GetTeamById fetches a Team object from the Dradis server based on the int id.
gd := godradis.Godradis{} [...] team, err := gd.GetTeamById(2) if err != nil { fmt.Println(err) }
func (*Godradis) GetTeamByName ¶
GetTeamByName searches for and returns a Team object based on the name. GetTeamByName works by calling GetAllTeams first and then ranges over them comparing the name strings.
gd := godradis.Godradis{} [...] team, err := gd.GetTeamByName("Test Client") if err != nil { fmt.Println(err) }
func (*Godradis) LoadConfig ¶
LoadConfig behaves the same way as Configure except that it loads the configuration parameters from a JSON file instead of accepting them directly in the function call.
gd := godradis.Godradis{} err := gd.LoadConfig("dradis_config.json") if err != nil { fmt.Println(err) }
func (*Godradis) UpdateEvidence ¶
func (gd *Godradis) UpdateEvidence(evidence *Evidence, fields *orderedmap.OrderedMap, issue ...*Issue) error
UpdateEvidence takes a reference to an existing Evidence object, an OrderedMap containing the fields making up the content of the Evidence body, and optionally a reference to an Issue object if the evidence is going to be attached to a different issue on the server. UpdateEvidence updates the evidence on the server and modifies the local Evidence object in place with the updated information. Note that due to the way the Dradis API works, all fields in the body must be passed in the OrderedMap, not just the fields that are being modified.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") evidence, _ := gd.GetEvidenceById(&node, 2) newFields := evidence.CopyFields() newFields.Set("Port", "995/tcp") _ := gd.UpdateEvidence(&evidence, newFields)
func (*Godradis) UpdateEvidenceFromText ¶
func (gd *Godradis) UpdateEvidenceFromText(evidence *Evidence, content string, issue ...*Issue) error
UpdateEvidenceFromText provides an alternate method for updating evidence directly from a text string as opposed to the OrderedMap approach used by UpdateEvidence. UpdateEvidenceFromText takes a reference to an Evidence object, a string containing the content, and optionally a reference to an Issue object if the evidence is being attached to a different issue. The evidence object is modified in place with the updated information.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") evidence, _ := gd.GetEvidenceById(&node, 4) _ := gd.UpdateEvidenceFromText(&evidence, "#[Port]#\r\n443/tcp\r\n\r\n#[Details]#\r\nLorem ipsum dolor\r\n\r\n")
func (*Godradis) UpdateIssue ¶
func (gd *Godradis) UpdateIssue(issue *Issue, fields *orderedmap.OrderedMap) error
UpdateIssue takes a reference to an existing Issue object and an OrderedMap containing the fields making up the content of the Issue body, updates the Issue on the server, and modifies the local Issue object in place with the updated information. Note that due to the way the Dradis API works, all fields in the body must be passed in the OrderedMap, not just the fields that are being modified.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issue, _ := gd.GetIssueByTitle(&project, "Insecure Password Storage") fields := issue.Fields fields.Set("Severity", "Medium") _ := gd.UpdateIssue(&issue, fields)
func (*Godradis) UpdateIssueFromText ¶
UpdateIssueFromText provides an alternate method for updating issues directly from a text string as opposed to the OrderedMap approach used by UpdateIssue. UpdateIssueFromText takes a reference to an existing Issue object and a string containing the raw body content and modifies the existing Issue object in place. Note that due to the way the Dradis API works, all fields in the body must be passed in the string, not just the fields that are being modified.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") issue, _ := gd.GetIssueByTitle(&project, "Insecure Password Storage") _ := gd.UpdateIssueFromText(&issue, "#[Title]#\r\nInsecure Password Storage\r\n\r\n#[Severity]#\r\Medium")
func (*Godradis) UpdateIssueLibraryEntry ¶
func (gd *Godradis) UpdateIssueLibraryEntry(entry *IssueLibEntry, fields *orderedmap.OrderedMap) error
func (*Godradis) UpdateIssueLibraryEntryFromText ¶
func (gd *Godradis) UpdateIssueLibraryEntryFromText(entry *IssueLibEntry, content string) error
func (*Godradis) UpdateNode ¶
UpdateNode takes a reference to an existing Node object and updates any non-nil properties passed to it as arguments.
gd := godradis.Godradis{} [...] project, _ := gd.GetProjectByName("Foobar External Network Penetration Test") node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") _ := gd.UpdateNode(&node, "localhost", nil, nil, nil)
func (*Godradis) UpdateNote ¶
func (gd *Godradis) UpdateNote(note *Note, fields *orderedmap.OrderedMap, categoryId ...int) error
UpdateNote takes a reference to an existing Note object, an OrderedMap containing the fields making up the content of the Note body, and an optional integer category ID that sets the note category (Defaults to "Default Category" in Dradis). UpdateNote updates the note on the server and modifies the local Note object in place with the updated information. Note that due to the way the Dradis API works, all fields in the body must be passed in the OrderedMap, not just the fields that are being modified.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") note, _ := gd.GetNoteByTitle(&node, "Nmap Host Info") newFields := note.CopyFields() newFields.Set("Hostnames", "sub.foo.com") _ := gd.UpdateNote(¬e, newFields)
func (*Godradis) UpdateNoteFromText ¶
UpdateNoteFromText takes a reference to an existing Note object, a string containing the body of the Note, and an optional integer category ID that sets the note category (Defaults to "Default Category" in Dradis). UpdateNoteFromText updates the note on the server and modifies the local Note object in place with the updated information.
gd := godradis.Godradis{} [...] node, _ := gd.GetNodeByLabel(&project, "127.0.0.1") note, _ := gd.GetNoteByTitle(&node, "Nmap Host Info") text := "#[Hostnames]#\r\nsub.foo.com\r\n\r\n note, _ := gd.UpdateNoteFromText(&node, text)
func (*Godradis) UpdateProject ¶
func (gd *Godradis) UpdateProject(p *Project, name, clientId, reportTemplatePropertiesId interface{}, authorIds []int, template interface{}) error
UpdateProject takes a reference to an existing Project object as well as 5 arguments representing properties to update. All arguments are required to be passed to UpdateProject but only properties being modified need to be non-nil. UpdateProject modifies the original Project object in-place rather than returning a new one.
gd := godradis.Godradis{} [...] project, _ := gd.CreateProject("New Project Name", 1, nil, nil, nil) err := gd.UpdateProject(&project, "Modified the project name", nil, nil, nil, nil) if err != nil { fmt.Printf("%v", project.Name) }
func (*Godradis) UpdateTeam ¶
UpdateTeam takes a reference to an existing Team object and a name and teamSince (in the form "YYYY-MM-DD") string as optional arguments. The Team argument is updated in-place.
gd := godradis.Godradis{} [...] team, _ := gd.GetTeamByName("Test Client") err := gd.UpdateTeam(&team, nil, "2019-02-01")
func (*Godradis) UploadAttachments ¶
func (gd *Godradis) UploadAttachments(node *Node, filePath []string) ([]Attachment, error)
UploadAttachments takes a reference to an existing Node object and a slice of strings containing filepaths and uploads these attachments to the Dradis server. A slice of Attachment objects is returned.
type Issue ¶
type Issue struct { Id int `json:"id"` Title string `json:"title"` Fields orderedmap.OrderedMap `json:"fields"` Text string `json:"text"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Project *Project }
type IssueLibEntry ¶
type IssueLibEntry struct { Id int `json:"id"` Title string `json:"title"` Fields orderedmap.OrderedMap `json:"fields"` State int `json:"state"` Content string `json:"content"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
func (*IssueLibEntry) CopyFields ¶
func (i *IssueLibEntry) CopyFields() orderedmap.OrderedMap
func (*IssueLibEntry) SetField ¶
func (i *IssueLibEntry) SetField(key, value string)
type Node ¶
type Node struct { Mu sync.Mutex Id int `json:"id"` Label string `json:"label"` TypeId int `json:"type_id"` ParentId int `json:"parent_id"` Position int `json:"position"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Evidence []Evidence `json:"evidence"` Notes []Note `json:"notes"` Project *Project }
func (*Node) GetEvidenceByField ¶
func (*Node) GetEvidenceByIssueTitle ¶
func (*Node) GetNotesByTitle ¶
type Note ¶
type Note struct { Id int `json:"id"` CategoryId int `json:"category_id"` Title string `json:"title"` Fields orderedmap.OrderedMap `json:"fields"` Text string `json:"text"` Node *Node }
func (*Note) CopyFields ¶
func (n *Note) CopyFields() orderedmap.OrderedMap
type TeamProject ¶
Notes ¶
Bugs ¶
The parentId argument to CreateNode may not be correctly serialized in the API request