Skip to content

Commit

Permalink
⭐️ full IMDSv2 support for Amazon instances (#1966)
Browse files Browse the repository at this point in the history
* 🐛 fix instance identity doc fetching for ec2 instances

* ⭐️ update aws windows platform detection

* 🧹 remove machine id as default id detector

* 🧹 update tests for aws ec2 detection

---------

Co-authored-by: Christoph Hartmann <[email protected]>
  • Loading branch information
vjeffrey and chris-rock authored Oct 5, 2023
1 parent 8dd5b36 commit 133dab5
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 38 deletions.
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@
"args": [
"status",
],
},
{
"name": "cnquery-shell",
"type": "go",
"request": "launch",
"program": "${workspaceRoot}/apps/cnquery/cnquery.go",
"args": [
"shell", "ssh", "[email protected]",
],
}
]
}
3 changes: 2 additions & 1 deletion providers/os/connection/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (c *Connection) RunCommand(command string) (*shared.Command, error) {
found, ok := c.data.Commands[command]
if !ok {
// try to fetch command by hash (more reliable for whitespace)
found, ok = c.data.Commands[hashCmd(command)]
hash := hashCmd(command)
found, ok = c.data.Commands[hash]
}
if !ok {
c.missing["command"][command] = true
Expand Down
2 changes: 1 addition & 1 deletion providers/os/connection/vagrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func migrateVagrantAssetToSsh(id uint32, sshConfig *vagrant.VagrantVmSSHConfig,

asset.Name = sshConfig.Host
asset.Connections = []*inventory.Config{cc}
asset.IdDetector = []string{ids.IdDetector_Hostname, ids.IdDetector_SshHostkey, ids.IdDetector_MachineID}
asset.IdDetector = []string{ids.IdDetector_Hostname, ids.IdDetector_SshHostkey}

return nil
}
8 changes: 5 additions & 3 deletions providers/os/id/aws/testdata/instance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
gid = 0
size = 0

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -43,6 +46,5 @@ stdout = """
}
"""


[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = "ec2-name"
7 changes: 5 additions & 2 deletions providers/os/id/aws/testdata/instancearm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
gid = 0
size = 0

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -55,5 +58,5 @@ stdout = """
}
"""

[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = "ec2-name"
5 changes: 4 additions & 1 deletion providers/os/id/aws/testdata/notinstance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
gid = 0
size = 0

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand Down
83 changes: 71 additions & 12 deletions providers/os/id/awsec2/metadata_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,29 @@ import (
)

const (
identityUrl = "http://169.254.169.254/latest/dynamic/instance-identity/document"
tagNameUrl = "http://169.254.169.254/latest/meta-data/tags/instance/Name"
identityUrl = `-H "X-aws-ec2-metadata-token: %s" -v http://169.254.169.254/latest/dynamic/instance-identity/document`
tokenUrl = `-H "X-aws-ec2-metadata-token-ttl-seconds: 21600" -X PUT "http://169.254.169.254/latest/api/token"`
tagNameUrl = `-H "X-aws-ec2-metadata-token: %s" -v http://169.254.169.254/latest/meta-data/tags/instance/Name`

identityUrlWindows = `
$Headers = @{
"X-aws-ec2-metadata-token" = %s
}
Invoke-RestMethod -TimeoutSec 1 -Headers $Headers -URI http://169.254.169.254/latest/dynamic/instance-identity/document -UseBasicParsing | ConvertTo-Json
`

tokenUrlWindows = `
$Headers = @{
"X-aws-ec2-metadata-token-ttl-seconds" = "21600"
}
Invoke-RestMethod -Method Put -Uri "http://169.254.169.254/latest/api/token" -Headers $Headers -TimeoutSec 1 -UseBasicParsing
`
tagNameUrlWindows = `
$Headers = @{
"X-aws-ec2-metadata-token" = %s
}
Invoke-RestMethod -Method Put -Uri "http://169.254.169.254/latest/meta-data/tags/instance/Name" -Headers $Headers -TimeoutSec 1 -UseBasicParsing
`
)

func NewCommandInstanceMetadata(conn shared.Connection, pf *inventory.Platform, config *aws.Config) *CommandInstanceMetadata {
Expand Down Expand Up @@ -81,34 +102,72 @@ func (m *CommandInstanceMetadata) Identify() (Identity, error) {
}, nil
}

func curlWindows(url string) string {
return fmt.Sprintf("Invoke-RestMethod -TimeoutSec 1 -URI %s -UseBasicParsing | ConvertTo-Json", url)
}
type metadataType int

const (
document metadataType = iota
instanceNameTag
)

func (m *CommandInstanceMetadata) curlDocument(url string) (string, error) {
func (m *CommandInstanceMetadata) curlDocument(metadataType metadataType) (string, error) {
switch {
case m.platform.IsFamily(inventory.FAMILY_UNIX):
cmd, err := m.conn.RunCommand("curl " + url)
cmd, err := m.conn.RunCommand("curl " + tokenUrl)
if err != nil {
return "", err
}
data, err := io.ReadAll(cmd.Stdout)
if err != nil {
return "", err
}
tokenString := strings.TrimSpace(string(data))

commandScript := ""
switch metadataType {
case document:
commandScript = "curl " + fmt.Sprintf(identityUrl, tokenString)
case instanceNameTag:
commandScript = "curl " + fmt.Sprintf(tagNameUrl, tokenString)
}

cmd, err = m.conn.RunCommand(commandScript)
if err != nil {
return "", err
}
data, err = io.ReadAll(cmd.Stdout)
if err != nil {
return "", err
}

return strings.TrimSpace(string(data)), nil
case m.platform.IsFamily(inventory.FAMILY_WINDOWS):
curlCmd := curlWindows(url)
encoded := powershell.Encode(curlCmd)
cmd, err := m.conn.RunCommand(encoded)
tokenPwshEncoded := powershell.Encode(tokenUrlWindows)
cmd, err := m.conn.RunCommand(tokenPwshEncoded)
if err != nil {
return "", err
}
data, err := io.ReadAll(cmd.Stdout)
if err != nil {
return "", err
}
tokenString := strings.TrimSpace(string(data))

commandScript := ""
switch metadataType {
case document:
commandScript = powershell.Encode(fmt.Sprintf(identityUrlWindows, tokenString))
case instanceNameTag:
commandScript = powershell.Encode(fmt.Sprintf(tagNameUrlWindows, tokenString))
}

cmd, err = m.conn.RunCommand(commandScript)
if err != nil {
return "", err
}
data, err = io.ReadAll(cmd.Stdout)
if err != nil {
return "", err
}

return strings.TrimSpace(string(data)), nil
default:
Expand All @@ -117,7 +176,7 @@ func (m *CommandInstanceMetadata) curlDocument(url string) (string, error) {
}

func (m *CommandInstanceMetadata) instanceNameTag() (string, error) {
res, err := m.curlDocument(tagNameUrl)
res, err := m.curlDocument(instanceNameTag)
if err != nil {
return "", err
}
Expand All @@ -128,5 +187,5 @@ func (m *CommandInstanceMetadata) instanceNameTag() (string, error) {
}

func (m *CommandInstanceMetadata) instanceIdentityDocument() (string, error) {
return m.curlDocument(identityUrl)
return m.curlDocument(document)
}
14 changes: 14 additions & 0 deletions providers/os/id/awsec2/metadata_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ func TestEC2RoleProviderInstanceIdentityLocal(t *testing.T) {
cfg := fakeConfig()
cfg.HTTPClient = smithyhttp.ClientDoFunc(func(r *http.Request) (*http.Response, error) {
url := r.URL.String()
if strings.Contains(url, "latest/api/token") {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: io.NopCloser(bytes.NewBufferString("mock-token")),
}, nil
}
if strings.Contains(url, "tags/instance/Name") {
return &http.Response{
StatusCode: 200,
Expand Down Expand Up @@ -75,6 +82,13 @@ func TestEC2RoleProviderInstanceIdentityLocalDisabledTagsService(t *testing.T) {
cfg := fakeConfig()
cfg.HTTPClient = smithyhttp.ClientDoFunc(func(r *http.Request) (*http.Response, error) {
url := r.URL.String()
if strings.Contains(url, "latest/api/token") {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: io.NopCloser(bytes.NewBufferString("mock-token")),
}, nil
}
if strings.Contains(url, "tags/instance/Name") {
return &http.Response{
StatusCode: 404,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ stdout = "4.9.125-linuxkit"
[files."/etc/redhat-release"]
content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -31,5 +34,5 @@ stdout = """
}
"""

[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = "ec2-name"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ stdout = "4.9.125-linuxkit"
[files."/etc/redhat-release"]
content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -31,7 +34,7 @@ stdout = """
}
"""

[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = """
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[commands]
[commands.91c156428b424f02b6d9b55114d3c59363d93e949562699f15fd09a244018994]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"
[commands.e56abebcba6dd24f679c4735d8528f601cbaaa8ce87d252864eb3dc20b37c2ab]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuAC0AdAB0AGwALQBzAGUAYwBvAG4AZABzACIAIAA9ACAAIgAyADEANgAwADAAIgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBhAHAAaQAvAHQAbwBrAGUAbgAiACAALQBIAGUAYQBkAGUAcgBzACAAJABIAGUAYQBkAGUAcgBzACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBzAGUAQgBhAHMAaQBjAFAAYQByAHMAaQBuAGcACgA="
stdout = "MYTOKEN"
[commands.6d04327ce300f1710513ea721bedbcc6f69ca633530aa1413d89e729bebabde9]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAACgB9AAoASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0ASABlAGEAZABlAHIAcwAgACQASABlAGEAZABlAHIAcwAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4ACgA="
stdout = "{\r\n \"accountId\": \"123456789012\",\r\n \"architecture\": \"x86_64\",\r\n \"availabilityZone\": \"us-east-1d\",\r\n \"billingProducts\": [\r\n \"bp-6ba54002\"\r\n ],\r\n \"devpayProductCodes\": null,\r\n \"marketplaceProductCodes\": null,\r\n \"imageId\": \"ami-0b17e49efb8d755c3\",\r\n \"instanceId\": \"i-1234567890abcdef0\",\r\n \"instanceType\": \"t2.micro\",\r\n \"kernelId\": null,\r\n \"pendingTime\": \"2021-11-17T15:26:40Z\",\r\n \"privateIp\": \"172.31.25.200\",\r\n \"ramdiskId\": null,\r\n \"region\": \"us-east-1\",\r\n \"version\": \"2017-09-30\"\r\n}\r\n"
stderr = ""
exit_status = 0
[commands.fb0f5ced4f556de99f237ea35a78ba4ddd5fc4e149589805d95cbf44f5ccc7aa]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"
[commands.22c5978cf5e5d4bea90d4ee9887a992a7ad26ab93f39ddb241584c18a55f641b]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAATQBZAFQATwBLAEUATgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACIAIAAtAEgAZQBhAGQAZQByAHMAIAAkAEgAZQBhAGQAZQByAHMAIAAtAFQAaQBtAGUAbwB1AHQAUwBlAGMAIAAxACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAKAA=="
stdout = "ec2-name-windows"
stderr = ""
exit_status = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
[commands]
[commands.91c156428b424f02b6d9b55114d3c59363d93e949562699f15fd09a244018994]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"
[commands.e56abebcba6dd24f679c4735d8528f601cbaaa8ce87d252864eb3dc20b37c2ab]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuAC0AdAB0AGwALQBzAGUAYwBvAG4AZABzACIAIAA9ACAAIgAyADEANgAwADAAIgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBhAHAAaQAvAHQAbwBrAGUAbgAiACAALQBIAGUAYQBkAGUAcgBzACAAJABIAGUAYQBkAGUAcgBzACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBzAGUAQgBhAHMAaQBjAFAAYQByAHMAaQBuAGcACgA="
stdout = "MYTOKEN"
[commands.6d04327ce300f1710513ea721bedbcc6f69ca633530aa1413d89e729bebabde9]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAACgB9AAoASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0ASABlAGEAZABlAHIAcwAgACQASABlAGEAZABlAHIAcwAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4ACgA="
stdout = "{\r\n \"accountId\": \"123456789012\",\r\n \"architecture\": \"x86_64\",\r\n \"availabilityZone\": \"us-east-1d\",\r\n \"billingProducts\": [\r\n \"bp-6ba54002\"\r\n ],\r\n \"devpayProductCodes\": null,\r\n \"marketplaceProductCodes\": null,\r\n \"imageId\": \"ami-0b17e49efb8d755c3\",\r\n \"instanceId\": \"i-1234567890abcdef0\",\r\n \"instanceType\": \"t2.micro\",\r\n \"kernelId\": null,\r\n \"pendingTime\": \"2021-11-17T15:26:40Z\",\r\n \"privateIp\": \"172.31.25.200\",\r\n \"ramdiskId\": null,\r\n \"region\": \"us-east-1\",\r\n \"version\": \"2017-09-30\"\r\n}\r\n"
stderr = ""
exit_status = 0
[commands.fb0f5ced4f556de99f237ea35a78ba4ddd5fc4e149589805d95cbf44f5ccc7aa]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"

[commands.22c5978cf5e5d4bea90d4ee9887a992a7ad26ab93f39ddb241584c18a55f641b]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAATQBZAFQATwBLAEUATgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACIAIAAtAEgAZQBhAGQAZQByAHMAIAAkAEgAZQBhAGQAZQByAHMAIAAtAFQAaQBtAGUAbwB1AHQAUwBlAGMAIAAxACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAKAA=="
stdout = """
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Expand Down
Loading

0 comments on commit 133dab5

Please sign in to comment.