imdsutils

package
v0.0.0-...-81e640e Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package imdsutils holds utils related to the IMDS tests

Index

Constants

View Source
const (
	// IMDSSecurityCredentialsURL is the URL used by the IMDS tests
	IMDSSecurityCredentialsURL = "/latest/meta-data/iam/security-credentials/test"
	// AWSSecurityCredentialsAccessKeyIDTestValue is the AccessKeyID used by the IMDS tests
	AWSSecurityCredentialsAccessKeyIDTestValue = "ASIAIOSFODNN7EXAMPLE"
	// AWSSecurityCredentialsTypeTestValue is the AWS Credentials Type used by the IMDS tests
	AWSSecurityCredentialsTypeTestValue = "AWS-HMAC"
	// AWSSecurityCredentialsCodeTestValue is the AWS Credentials Code used by the IMDS tests
	AWSSecurityCredentialsCodeTestValue = "Success"
	// AWSSecurityCredentialsLastUpdatedTestValue is the AWS Credentials LastUpdated value used by the IMDS tests
	AWSSecurityCredentialsLastUpdatedTestValue = "2012-04-26T16:39:16Z"
	// AWSSecurityCredentialsExpirationTestValue is the AWS Credentials Expiration value used by the IMDS tests
	AWSSecurityCredentialsExpirationTestValue = "2324-05-01T12:00:00Z"
	// AWSIMDSServerTestValue is the IMDS Server used by the IMDS tests
	AWSIMDSServerTestValue = "EC2ws"
	// CSMDummyInterface is the Dummy interface name used by the IMDS tests
	CSMDummyInterface = "dummy_csm"
	// IMDSTestServerIP is the IMDS server IP used by the IMDS tests
	IMDSTestServerIP = "169.254.169.254"
	// IMDSTestServerPort is the IMDS server port used by the IMDS tests
	IMDSTestServerPort = 8080
)

Variables

This section is empty.

Functions

func CreateDummyInterface

func CreateDummyInterface(ip string, name string) (*netlink.Dummy, error)

CreateDummyInterface creates a dummy interface and attaches it to the provided IP

func CreateIMDSServer

func CreateIMDSServer(addr string) *http.Server

CreateIMDSServer creates a fake IMDS server

func RemoveDummyInterface

func RemoveDummyInterface(link *netlink.Dummy) error

RemoveDummyInterface removes the provided dummy interface

func StopIMDSserver

func StopIMDSserver(server *http.Server) error

StopIMDSserver stops the provided server gracefully

Types

This section is empty.

Jump to

Keyboard shortcuts

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