Listen for events and forward to external security scanning services.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

qualys_mock_test.go 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. import (
  3. "log"
  4. //"github.com/satori/go.uuid"
  5. )
  6. // QualysActions is a class that handles all interactions directly with Qualys.
  7. // See the comment on QualysActioner for rationale.
  8. type QualysTestActions struct {
  9. testUUID string
  10. }
  11. // InitiateScan is the main method for the QualysActioner class, it
  12. // makes a call to the Qualys API to start a scan and harvests a scan ID, and
  13. // an optional error string if there is a problem contacting Qualys.
  14. func (s *QualysTestActions) InitiateScan(ipAddresses []string) (string, error) {
  15. //testUUID = uuid.NewV4().String()
  16. s.testUUID = `5fbf3cef-976e-475d-bd84-47ef23638a6b`
  17. log.Printf("FAKE QUALYS SCAN: %s\n", s.testUUID)
  18. return s.testUUID, nil
  19. }
  20. // GetTestScanID returns the fake UUID created in testing. This allows for
  21. // inspection of the UUID in unit tests.
  22. func (s *QualysTestActions) GetTestScanID() string {
  23. return s.testUUID
  24. }
  25. func (s *QualysTestActions) DropIPv6() bool {
  26. return false
  27. }
  28. func connectFakeQualys() *QualysTestActions {
  29. return new(QualysTestActions)
  30. }