Skip to content

Support alternate password for PTF container#16457

Merged
StormLiangMS merged 5 commits intosonic-net:masterfrom
wangxin:ptf-alt-password
Jan 14, 2025
Merged

Support alternate password for PTF container#16457
StormLiangMS merged 5 commits intosonic-net:masterfrom
wangxin:ptf-alt-password

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Jan 10, 2025

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
    • Add ownership here(Microsft required only)
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?

This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?

Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Collaborator

/azp run

@wangxin wangxin requested a review from lolyu January 10, 2025 10:11
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin wangxin changed the title Support use alternate password for PTF container Support alternate password for PTF container Jan 12, 2025
Copy link
Collaborator

@lolyu lolyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mssonicbld
Copy link
Collaborator

@wangxin PR conflicts with 202311 branch

@Javier-Tan
Copy link
Contributor

Hi @wangxin, could you create manual PR in azure-msft sonic-mgmt:202405 due to merge conflicts? Thanks!

StormLiangMS pushed a commit that referenced this pull request Jan 22, 2025
Manually cherry-pick #16457 to 202311 branch due to conflicts.

What is the motivation for this PR?
The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?
This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?
Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-mgmt.msft#43

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jan 31, 2025
What is the motivation for this PR?
The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?
This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?
Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #16743

mssonicbld pushed a commit that referenced this pull request Jan 31, 2025
What is the motivation for this PR?
The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?
This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?
Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Feb 21, 2025
What is the motivation for this PR?
The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?
This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?
Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.
@wangxin
Copy link
Collaborator Author

wangxin commented Feb 21, 2025

Hi @wangxin, could you create manual PR in azure-msft sonic-mgmt:202405 due to merge conflicts? Thanks!

Created PR for manual cherry-pick: Azure/sonic-mgmt.msft#104

nnelluri-cisco pushed a commit to nnelluri-cisco/sonic-mgmt that referenced this pull request Mar 15, 2025
What is the motivation for this PR?
The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?
This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?
Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.
ansrajpu-git pushed a commit to ansrajpu-git/sonic-mgmt that referenced this pull request Apr 14, 2025
What is the motivation for this PR?
The PTF container is always using default password. If the PTF container is on same bridge with the host server's management IP, then it is easily accessible from other host servers. This is not secure enough. We need to support alternate password for the PTF container and password rotation.

How did you do it?
This change improved the ansible related code to support accessing the PTF containers using the multi_ssh_pass ansible plugin. Then we can specify alternate passwords for the PTF container. When alternate passwords are specified, the default password of PTF container is updated after PTF creation.

How did you verify/test it?
Tested remove-topo/add-topo/restart-ptf on KVM and physical testbed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants