Skip to content

This is the Golang implementation of the GMP protocol based on OpenVAS

Notifications You must be signed in to change notification settings

boynicholas/openvas-gmp-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openvas GMP lib With Golang

This library wraps the Open VAS GMP protocol and is used to interact with the Greenbone Vulnerability Manager.

Currently under development, it implements some of the common features of GMP 21.4 and the latest 21.10.

Installation and Usage

You need to first download the package to your project

go get github.com/boynicholas/openvas-gmp-lib

Then you can easily call it

package gmp

import (
	"log"
	"os"
	"strconv"
	"testing"

	"github.com/boynicholas/openvas-gmp-lib/command"
)

func TestGmpNew(t *testing.T) {
	gmp, err := NewGmp(GetGmpConfig())

	if err != nil {
		log.Fatalln(err)
	}

	err = gmp.Authenticate(GetAuthenticate())
	if err != nil {
		log.Fatalln(err)
	}

	// todo something.

	defer gmp.Close()
}

func GetGmpConfig() GmpConfig {
	gmpPort, _ := strconv.ParseUint(os.Getenv("GmpPort"), 10, 16)
	return GmpConfig{
		Addr:              os.Getenv("GmpAddr"),
		Port:              uint16(gmpPort),
		TlsCaCertPath:     os.Getenv("GmpCaCert"),
		TlsClientCertPath: os.Getenv("GmpClientCert"),
		TlsClientKeyPath:  os.Getenv("GmpClientKey"),
	}
}

func GetAuthenticate() *command.Authenticate {
	return command.NewAuthenticate(os.Getenv("GmpUser"), os.Getenv("GmpPass"))
}

Support

For related questions, you can use Issue to feedback to me

About

This is the Golang implementation of the GMP protocol based on OpenVAS

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages