osel/qualys_mock_test.go
Nate Johnston ca0e1ca769 Initial import of osel code
This is an initial import of the osel codebase.  The osel tool is a tool that
initiates external security scans (initially through Qualys) upon reciept of
AMQP events that indicate certain sensitive events have occurred, like a
security group rule change.

The commit history had to be thrown away because it contained some non-public
data, so I would like to call out the following contributors:

This uses go 1.10 and vgo for dependency management.

Co-Authored-By: Charles Bitter <Charles_Bitter@cable.comcast.com>
Co-Authored-By: Olivier Gagnon <Olivier_Gagnon@cable.comcast.com>
Co-Authored-By: Joseph Sleiman <Joseph_Sleiman@comcast.com>

Change-Id: Ib6abe2024fd91978b783ceee4cff8bb4678d7b15
2018-03-24 15:30:57 +00:00

37 lines
1.0 KiB
Go

package main
import (
"log"
//"github.com/satori/go.uuid"
)
// QualysActions is a class that handles all interactions directly with Qualys.
// See the comment on QualysActioner for rationale.
type QualysTestActions struct {
testUUID string
}
// InitiateScan is the main method for the QualysActioner class, it
// makes a call to the Qualys API to start a scan and harvests a scan ID, and
// an optional error string if there is a problem contacting Qualys.
func (s *QualysTestActions) InitiateScan(ipAddresses []string) (string, error) {
//testUUID = uuid.NewV4().String()
s.testUUID = `5fbf3cef-976e-475d-bd84-47ef23638a6b`
log.Printf("FAKE QUALYS SCAN: %s\n", s.testUUID)
return s.testUUID, nil
}
// GetTestScanID returns the fake UUID created in testing. This allows for
// inspection of the UUID in unit tests.
func (s *QualysTestActions) GetTestScanID() string {
return s.testUUID
}
func (s *QualysTestActions) DropIPv6() bool {
return false
}
func connectFakeQualys() *QualysTestActions {
return new(QualysTestActions)
}