security

package module
v0.0.0-...-6c4b7e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: AGPL-3.0 Imports: 28 Imported by: 4

README

API Service Security

The apiservice security is the implementation of the security part from the unified api. The api service security is available in all Perinets Products.

This implementation does store its resources, e.g. client certificate and host certificate persistently in the file system /var/lib/apiservice/security/ as json files.

References

Dual License

This software is by default licensed via the GNU Affero General Public License version 3. However it is also available with a commercial license on request (https://perinet.io/contact).

Documentation

Index

Constants

View Source
const (
	API_VERSION        = "22"
	HOST_CERT          = "server.pem"
	HOST_CERT_KEY      = "server.key"
	CLIENT_CERT        = "client.pem"
	CLIENT_CERT_KEY    = "client.key"
	ROOT_CA_CERT       = "root-ca.pem"
	ROOT_CA_CERT_BCK   = "root-ca.pem.bck"
	FW_CA_CERT         = "fw-ca.pem"
	USER_CONFIGURATION = "/var/lib/security/config.json"
)

Variables

View Source
var (
	Logger log.Logger = *log.Default()
)
View Source
var SecurityEvent = func() { log.Println("WARNING: no security event function defined") }

Functions

func CreateHostCert

func CreateHostCert()

func Get_webserver_cert_path

func Get_webserver_cert_path(w http.ResponseWriter, r *http.Request)

func PathsGet

func PathsGet() []httpserver.Endpoint

func Security_CSR_Create

func Security_CSR_Create(w http.ResponseWriter, r *http.Request)

func Security_Certificate_Delete

func Security_Certificate_Delete(w http.ResponseWriter, r *http.Request)

func Security_Certificate_Get

func Security_Certificate_Get(w http.ResponseWriter, r *http.Request)

func Security_Certificate_Key_Get

func Security_Certificate_Key_Get(w http.ResponseWriter, r *http.Request)

func Security_Certificate_Set

func Security_Certificate_Set(w http.ResponseWriter, r *http.Request)

func Security_Commit_Set

func Security_Commit_Set(w http.ResponseWriter, r *http.Request)

func Security_Config_Get

func Security_Config_Get(w http.ResponseWriter, r *http.Request)

func Security_Config_Set

func Security_Config_Set(w http.ResponseWriter, r *http.Request)

func Security_Info_Get

func Security_Info_Get(w http.ResponseWriter, r *http.Request)

func Security_Login_Create

func Security_Login_Create(w http.ResponseWriter, r *http.Request)

func Security_Logout_Set

func Security_Logout_Set(w http.ResponseWriter, r *http.Request)

func Security_Password_Set

func Security_Password_Set(w http.ResponseWriter, r *http.Request)

func Security_TrustAnchor_Delete

func Security_TrustAnchor_Delete(w http.ResponseWriter, r *http.Request)

func Security_TrustAnchor_Get

func Security_TrustAnchor_Get(w http.ResponseWriter, r *http.Request)

func Security_TrustAnchor_Set

func Security_TrustAnchor_Set(w http.ResponseWriter, r *http.Request)

func Security_TrustAnchors_Get

func Security_TrustAnchors_Get(w http.ResponseWriter, r *http.Request)

func Set_webserver_cert_path

func Set_webserver_cert_path(w http.ResponseWriter, r *http.Request)

Types

type CsrRequest

type CsrRequest struct {
	Type       string                 `json:"type"`
	Parameters []CsrRequestParameters `json:"parameters"`
	Name       SubjectName            `json:"name"`
}

type CsrRequestParameters

type CsrRequestParameters struct {
	OID   string `json:"OID"`
	Value string `json:"value"`
}

type Security

type Security struct {
	ApiVersion json.Number    `json:"api_version"`
	Config     SecurityConfig `json:"config"`
}

type SecurityConfig

type SecurityConfig struct {
	ClientAuthMethod auth.AuthMethod `json:"client_auth_method"`
}

type SubjectName

type SubjectName struct {
	CommonName         string `json:"CommonName"`
	SerialNumber       string `json:"SerialNumber"`
	Country            string `json:"Country"`
	Locality           string `json:"Locality"`
	Province           string `json:"Province"`
	OrganizationName   string `json:"OrganizationName"`
	OrganizationalUnit string `json:"OrganizationalUnit"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL