Skip to content

Commit

Permalink
Merge pull request #6 from rapid7/release-1.0.1
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
trobinson-r7 committed Jun 3, 2021
2 parents 474cced + 9ba5f81 commit 17cf12a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/version.go
Expand Up @@ -6,13 +6,13 @@ import (
"github.com/spf13/cobra"
)

var version = "1.0.0"
var version = "1.0.1"

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Version of integration",
Long: "Prints the version of the integration",
Long: "Prints the version of the integration",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %s\n", version)
},
Expand Down
2 changes: 1 addition & 1 deletion extension.spec.yaml
Expand Up @@ -3,7 +3,7 @@ products: [insightappsec]
name: insightappsec_threadfix
title: Threadfix Scan Import
description: Import InsightAppSec scans into Threadfix to correlate scan results across multiple application security tools
version: 1.0.0
version: 1.0.1
vendor: rapid7
status: []
support: rapid7
Expand Down
1 change: 1 addition & 0 deletions help.md
Expand Up @@ -198,6 +198,7 @@ vulnerabilities and should have little to no impact on correlation across applic

# Version History

* 1.0.1 - Fixed issue with TF application names containing spaces, added User-Agent to IAS requests
* 1.0.0 - Initial release of integration

# Links
Expand Down
4 changes: 4 additions & 0 deletions pkg/components/insightappsec/client.go
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"

"github.com/rapid7/strategic-integrations/appsec/rapid7-insightappsec-threadfix/pkg/shared"
log "github.com/sirupsen/logrus"
)
Expand All @@ -13,6 +14,8 @@ type API struct {
APIClient shared.APIClient
}

const UserAgent = "r7:insightappsec-threadfix-extension/1.0.1"

func (ias *API) DoSearch(searchType string, query string, index int, size int, sort string) []byte {
var search = SearchParameters{Type: searchType, Query: query}
var header = ias.FormatHeader()
Expand Down Expand Up @@ -218,6 +221,7 @@ func (ias *API) FormatUrl(url Url) string {
func (ias *API) FormatHeader() map[string]string {
var header = make(map[string]string)
header["x-api-key"] = ias.Config.APIKey
header["User-Agent"] = UserAgent

return header
}
5 changes: 4 additions & 1 deletion pkg/components/threadfix/client.go
Expand Up @@ -5,6 +5,9 @@ import (
"encoding/json"
"errors"
"fmt"

netUrl "net/url"

"github.com/rapid7/strategic-integrations/appsec/rapid7-insightappsec-threadfix/pkg/shared"
"github.com/rapid7/strategic-integrations/appsec/rapid7-insightappsec-threadfix/pkg/shared/logging"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -67,7 +70,7 @@ func (tf *API) ListScans(appId int) ([]ScanMetadata, error) {
}

func (tf *API) GetAppByName(teamName string, appName string) (Application, error) {
var endpoint = fmt.Sprintf("rest/applications/%s/lookup?name=%s", teamName, appName)
var endpoint = fmt.Sprintf("rest/applications/%s/lookup?name=%s", teamName, netUrl.QueryEscape(appName))
var header = tf.FormatHeader()
var url = tf.FormatUrl(endpoint)
var app Application
Expand Down

0 comments on commit 17cf12a

Please sign in to comment.