Skip to content

Commit

Permalink
CopyFilesOverSSH, InstallSSHKey restrictions (#14478)
Browse files Browse the repository at this point in the history
* [XamarinTestCloudV1, VSBuildV1, CopyFilesOverSSHV0, InstallSSHKeyV0, SshV0] Added restrictions to tasks

* Excluded VSBuild and XamarinTestCloud tasks.

* Addressed code review points

* Bumped tasks version

Co-authored-by: Anatolii Bolshakov (Akvelon INC) <[email protected]>
Co-authored-by: Anatoly Bolshakov <[email protected]>
  • Loading branch information
3 people authored Apr 2, 2021
1 parent 354883e commit 6289c10
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
12 changes: 10 additions & 2 deletions Tasks/CopyFilesOverSSHV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 180,
"Minor": 186,
"Patch": 0
},
"demands": [],
"minimumAgentVersion": "2.144.0",
"minimumAgentVersion": "2.182.1",
"instanceNameFormat": "Securely copy files to the remote machine",
"groups": [
{
Expand Down Expand Up @@ -128,6 +128,14 @@
"argumentFormat": ""
}
},
"restrictions": {
"commands": {
"mode": "restricted"
},
"settableVariables": {
"allowed": []
}
},
"messages": {
"CheckLogForStdErr": "Check the build log for STDERR from the command.",
"CleanTargetFolder": "Cleaning target folder %s on the remote machine",
Expand Down
12 changes: 10 additions & 2 deletions Tasks/CopyFilesOverSSHV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 180,
"Minor": 186,
"Patch": 0
},
"demands": [],
"minimumAgentVersion": "2.144.0",
"minimumAgentVersion": "2.182.1",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"groups": [
{
Expand Down Expand Up @@ -128,6 +128,14 @@
"argumentFormat": ""
}
},
"restrictions": {
"commands": {
"mode": "restricted"
},
"settableVariables": {
"allowed": []
}
},
"messages": {
"CheckLogForStdErr": "ms-resource:loc.messages.CheckLogForStdErr",
"CleanTargetFolder": "ms-resource:loc.messages.CleanTargetFolder",
Expand Down
12 changes: 10 additions & 2 deletions Tasks/InstallSSHKeyV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 181,
"Minor": 186,
"Patch": 0
},
"runsOn": [
"Agent",
"DeploymentGroup"
],
"demands": [],
"minimumAgentVersion": "2.117.0",
"minimumAgentVersion": "2.182.1",
"instanceNameFormat": "Install an SSH key",
"groups": [
{
Expand Down Expand Up @@ -128,6 +128,14 @@
"argumentFormat": ""
}
},
"restrictions": {
"commands": {
"mode": "restricted"
},
"settableVariables": {
"allowed": ["SSH_AGENT_PID", "SSH_AUTH_SOCK", "INSTALL_SSH_KEY_CONFIG_LOCATION", "INSTALL_SSH_KEY_KNOWN_HOSTS_LOCATION"]
}
},
"messages": {
"SSHKeyAlreadyInstalled": "The SSH key is already installed.",
"SSHPublicKeyMalformed": "Could not get the base64 portion of the public SSH key.",
Expand Down
17 changes: 15 additions & 2 deletions Tasks/InstallSSHKeyV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 181,
"Minor": 186,
"Patch": 0
},
"runsOn": [
"Agent",
"DeploymentGroup"
],
"demands": [],
"minimumAgentVersion": "2.117.0",
"minimumAgentVersion": "2.182.1",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"groups": [
{
Expand Down Expand Up @@ -128,6 +128,19 @@
"argumentFormat": ""
}
},
"restrictions": {
"commands": {
"mode": "restricted"
},
"settableVariables": {
"allowed": [
"SSH_AGENT_PID",
"SSH_AUTH_SOCK",
"INSTALL_SSH_KEY_CONFIG_LOCATION",
"INSTALL_SSH_KEY_KNOWN_HOSTS_LOCATION"
]
}
},
"messages": {
"SSHKeyAlreadyInstalled": "ms-resource:loc.messages.SSHKeyAlreadyInstalled",
"SSHPublicKeyMalformed": "ms-resource:loc.messages.SSHPublicKeyMalformed",
Expand Down

0 comments on commit 6289c10

Please sign in to comment.