Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openssh] Export remote address to environment variable for TACACS authorization. #12447

Merged
merged 7 commits into from
Nov 3, 2022

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Oct 19, 2022

Export remote address to environment variable for TACACS authorization.

Why I did it

When remote user login, nss-tacplus need user remove address for TACACSS authorization.

How I did it

Export remote address to environment variable "SSH_REMOTE_IP"

How to verify it

Pass all E2E test.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Export remote address to environment variable for TACACS authorization.

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@liuh-80 liuh-80 changed the title [SSH] Export remote address to environment variable for TACACS authoriz… [SSH] Export remote address to environment variable for TACACS authorization. Oct 19, 2022
@liuh-80 liuh-80 changed the title [SSH] Export remote address to environment variable for TACACS authorization. [openssh] Export remote address to environment variable for TACACS authorization. Oct 20, 2022
@liuh-80
Copy link
Contributor Author

liuh-80 commented Oct 21, 2022

This PR depends on #12327 to merge first.
Because build openssh need build libnl first:

The following packages have unmet dependencies:
libibverbs1 : Depends: libnl-route-3-200 (>= 3.2.7) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
make[1]: *** [Makefile:9: /sonic/target/debs/bullseye/openssh-server_8.4p1-5+deb11u1_amd64.deb] Error 100

@liuh-80 liuh-80 marked this pull request as ready for review October 21, 2022 07:14
@liuh-80 liuh-80 requested a review from lguohan as a code owner October 21, 2022 07:14
@liuh-80 liuh-80 requested a review from qiluo-msft October 21, 2022 07:14
liuh-80 added a commit that referenced this pull request Oct 24, 2022
…12327)

Update openssh make file, add missing dependency to libnl.

#### Why I did it
Openssh indirectly depends on libnl.
Another PR #12447 need add new patch to openssh, after adding new patch to openssh, PR build failed with libnl missing error.

#### How I did it
Update openssh make file, add missing dependency to libnl.

#### How to verify it
Pass all test case

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205

#### Description for the changelog
Update openssh make file, add missing dependency to libnl.

#### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
@liuh-80
Copy link
Contributor Author

liuh-80 commented Oct 24, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Oct 24, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Oct 24, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

yxieca pushed a commit that referenced this pull request Oct 27, 2022
…12327)

Update openssh make file, add missing dependency to libnl.

#### Why I did it
Openssh indirectly depends on libnl.
Another PR #12447 need add new patch to openssh, after adding new patch to openssh, PR build failed with libnl missing error.

#### How I did it
Update openssh make file, add missing dependency to libnl.

#### How to verify it
Pass all test case

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205

#### Description for the changelog
Update openssh make file, add missing dependency to libnl.

#### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
+{
+ const char *remote_ip = ssh_remote_ipaddr(ssh);
+ const int remote_port = ssh_remote_port(ssh);
+ const char remote_addr_port[32 + INET6_ADDRSTRLEN];
Copy link
Collaborator

@qiluo-msft qiluo-msft Oct 28, 2022

Choose a reason for hiding this comment

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

INET6_ADDRSTRLEN

Do you need reserve one more char for blank? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary: IP port max value is 65535, so '32 + INET6_ADDRSTRLEN' is enough.

@qiluo-msft
Copy link
Collaborator

Please resolve the conflict.

@liuh-80
Copy link
Contributor Author

liuh-80 commented Nov 3, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 merged commit 1f88a3e into sonic-net:master Nov 3, 2022
yxieca pushed a commit that referenced this pull request Nov 10, 2022
…thorization. (#12447)

Export remote address to environment variable for TACACS authorization.

#### Why I did it
When remote user login, nss-tacplus need user remove address for TACACSS authorization.

#### How I did it
Export remote address to environment variable "SSH_REMOTE_IP"

#### How to verify it
Pass all E2E test.

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205

#### Description for the changelog
Export remote address to environment variable for TACACS authorization.

#### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
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.

3 participants