-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Persist IP addresses related to VM access via CPVM #9534
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
Persist IP addresses related to VM access via CPVM #9534
Conversation
|
@blueorangutan package |
|
@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9534 +/- ##
============================================
- Coverage 16.06% 16.06% -0.01%
- Complexity 12863 12865 +2
============================================
Files 5641 5642 +1
Lines 493791 493852 +61
Branches 59858 59860 +2
============================================
+ Hits 79327 79331 +4
- Misses 405683 405739 +56
- Partials 8781 8782 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10674 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
4d62ae2 to
cdec550
Compare
|
@bernardodemarco , I understand what and how, but have a hard time to get the why of this PR. Can you expand on that please? |
The main idea behind the proposed enhancement is to help operators better identify who accessed a virtual machine console. The |
thanks, makes sense. |
|
@nvazquez can you have a look at this one? |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
cdec550 to
e49980f
Compare
nvazquez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
sureshanaparti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11055 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Thanks @bernardodemarco |
|
[SF] Trillian test result (tid-11441)
|
|
@JoaoJandre , it looks like this is ready. should we merge it before 4.20? |
I think we should leave this for 4.21. We're only accepting bugfixes currently. |
BryanMLima
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLGTM, I did not manually test it.
|
@blueorangutan package |
|
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
engine/schema/src/main/resources/META-INF/db/schema-41910to42000.sql
Outdated
Show resolved
Hide resolved
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11658 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
1ed976f to
77530fc
Compare
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11715 |
|
@weizhouapache should we run the CI once again for this one? The tests failures here #9534 (comment) don't seem to be related |
|
@bernardodemarco sure @blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-11875)
|
Description
This PR proposes to persist IP addresses related to VM access via CPVM. Specifically, it stores the IP address of the client accessing a VM and the IP address of the console endpoint creator. To achieve this, the
cloud.console_sessiontable was extended with two new columns:client_address, which stores the client's IP address, andconsole_endpoint_creator_address, which captures the IP address of the console endpoint creator.These IP addresses were already being captured for logging and validation purposes. The console endpoint creator's IP is captured here, at the start of the
CreateConsoleEndpointCmdexecution:cloudstack/api/src/main/java/org/apache/cloudstack/api/command/user/consoleproxy/CreateConsoleEndpointCmd.java
Lines 65 to 68 in 47a6b70
The client address is captured by calling
session.getRemoteAddress().getAddress().getHostAddress()in this method, that gets executed when the client connects to the console:cloudstack/services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVNCHandler.java
Lines 157 to 160 in 47a6b70
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
client_addressandconsole_endpoint_creator_addresscolumns to thecloud.console_sessiontable.SELECT * FROM `cloud`.`console_session` ORDER BY created DESC LIMIT 1;As can be noticed, the
console_endpoint_creator_addresscolumn was populated accordingly, whereas theclient_adresswas still empty since the VM had not been accessed yet.SELECT * FROM `cloud`.`console_session` ORDER BY created DESC LIMIT 1;As can be noticed, the IP address of the client that accessed the VM through CPVM was persisted correctly.