GoTenable is a Go library for interfacing with Tenable product APIs.
Tenable.io
package main
import (
"github.com/andrewspearson/gotenable/gotenableutils"
"github.com/andrewspearson/gotenable/tenableio"
)
func main() {
config := tenableio.Config{}
config.AccessKey = `ACCESS_KEY`
config.SecretKey = `SECRET_KEY`
tio := tenableio.New(config)
resp := tio.Get(`/scans`)
gotenableutils.PPrintJSON(resp.Body)
}
Tenable.sc
package main
import (
"github.com/andrewspearson/gotenable/gotenableutils"
"github.com/andrewspearson/gotenable/tenablesc"
)
func main() {
config := tenablesc.Config{}
config.BaseURL = `https://tenablesc.company.local`
config.AccessKey = `ACCESS_KEY`
config.SecretKey = `SECRET_KEY`
tsc := tenablesc.New(config)
resp := tsc.Get(`/scan`)
gotenableutils.PPrintJSON(resp.Body)
}
Downloads
package main
import (
"github.com/andrewspearson/gotenable/downloads"
"github.com/andrewspearson/gotenable/gotenableutils"
)
func main() {
config := downloads.Config{}
config.BearerToken = `BEARER_TOKEN`
dl := downloads.New(config)
resp := dl.Get(`/pages`)
gotenableutils.PPrintJSON(resp.Body)
}
See DOCUMENTATION.md for complete details.