[jira] [Commented] (GUACAMOLE-501) Session Recording: use connection id as default value for recording-name

2018-02-08 Thread Michael Jumper (JIRA)

[ 
https://issues.apache.org/jira/browse/GUACAMOLE-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357448#comment-16357448
 ] 

Michael Jumper commented on GUACAMOLE-501:
--

If you are looking to correlate IDs generated by your application with the ID 
generated by guacd, you need to keep track of the connection ID returned by 
guacd within your application. Assuming that you do have such a unique value 
generated at the application level, I suggest using that value within the 
recording name, rather than relying on guacd to generate a unique name for you.

There would be some utility in allowing the web application to tag a connection 
with some arbitrary value, so that guacd's logs can be more easily correlated, 
but that doesn't really touch on the issue here. If you're looking for 
uniquely-named recordings for sessions through your webapp, you will need to 
generate those unique names. Relying upon or attempting to control the 
connection ID is not a good solution for this.

> Session Recording: use connection id as default value for recording-name
> 
>
> Key: GUACAMOLE-501
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-501
> Project: Guacamole
>  Issue Type: New Feature
>  Components: guacamole
>Reporter: Kris Keller
>Priority: Minor
>
> The current default value for recording-name is "recording".  It would be 
> great if the guacamole-server component would use the connection id instead.
> e.g. 
> $c134c9d2-699e-46f1-af5c-add1c440a41f.recording
> Unfortunately, the client can't pass this down as it doesnt know the 
> connection id until after the connection is established and has received the 
> "ready" instruction.
>  
> Even if the guacamole team didn't want to make the connection id be the 
> default name, at least adding another token parameter for the connection id 
> would be awesome as well.  
> e.g. recording-name=${CONNECTION_ID}
>  Below is a patch i created to support the defaulting of the recording-name 
> parameter to connection id for rdp connections:
> {code:java}
> --- a/src/protocols/rdp/rdp_settings.c
> +++ b/src/protocols/rdp/rdp_settings.c
> @@ -837,9 +837,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
>                  IDX_RECORDING_PATH, NULL);
>      /* Read recording name */
> +    char pszRecordingName[255] = {'\0'};
> +    sprintf(pszRecordingName, "%s.recording", user->client->connection_id);
>      settings->recording_name =
>          guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
> -                IDX_RECORDING_NAME, GUAC_RDP_DEFAULT_RECORDING_NAME);
> +                IDX_RECORDING_NAME, pszRecordingName);
>      /* Parse output exclusion flag */
>      settings->recording_exclude_output =
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GUACAMOLE-501) Session Recording: use connection id as default value for recording-name

2018-02-08 Thread Kris Keller (JIRA)

[ 
https://issues.apache.org/jira/browse/GUACAMOLE-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357251#comment-16357251
 ] 

Kris Keller commented on GUACAMOLE-501:
---

Our application does a lot of auditing and event correlation.  We cannot tell 
guacd what unique identifier to use for each connection so rather than mapping 
a series of id's together across all tiers, we just rely on the id generated by 
guacd.  This makes log correlation easier as we only have a single id to look 
for.  So, for us, we would like the session recording to have a name with the 
connection id in it.   We can't provide guacd with the connection id to use for 
the session recording because the client doesn't know it until the connection 
has been established and the client receives the "ready" instruction.
So, with the way we want to be able to correlate everything together we are 
with either sending a token or updating all protocols to default to 
user->client->connection_id+".recording".

If we could tell guacd what connection_id to use that would work as well.  Or 
some other form of a diagnostic/logging context id.

> Session Recording: use connection id as default value for recording-name
> 
>
> Key: GUACAMOLE-501
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-501
> Project: Guacamole
>  Issue Type: New Feature
>  Components: guacamole
>Reporter: Kris Keller
>Priority: Minor
>
> The current default value for recording-name is "recording".  It would be 
> great if the guacamole-server component would use the connection id instead.
> e.g. 
> $c134c9d2-699e-46f1-af5c-add1c440a41f.recording
> Unfortunately, the client can't pass this down as it doesnt know the 
> connection id until after the connection is established and has received the 
> "ready" instruction.
>  
> Even if the guacamole team didn't want to make the connection id be the 
> default name, at least adding another token parameter for the connection id 
> would be awesome as well.  
> e.g. recording-name=${CONNECTION_ID}
>  Below is a patch i created to support the defaulting of the recording-name 
> parameter to connection id for rdp connections:
> {code:java}
> --- a/src/protocols/rdp/rdp_settings.c
> +++ b/src/protocols/rdp/rdp_settings.c
> @@ -837,9 +837,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
>                  IDX_RECORDING_PATH, NULL);
>      /* Read recording name */
> +    char pszRecordingName[255] = {'\0'};
> +    sprintf(pszRecordingName, "%s.recording", user->client->connection_id);
>      settings->recording_name =
>          guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
> -                IDX_RECORDING_NAME, GUAC_RDP_DEFAULT_RECORDING_NAME);
> +                IDX_RECORDING_NAME, pszRecordingName);
>      /* Parse output exclusion flag */
>      settings->recording_exclude_output =
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GUACAMOLE-501) Session Recording: use connection id as default value for recording-name

2018-02-06 Thread Michael Jumper (JIRA)

[ 
https://issues.apache.org/jira/browse/GUACAMOLE-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354780#comment-16354780
 ] 

Michael Jumper commented on GUACAMOLE-501:
--

Adding a token which is applied at the guacd layer would be a violation of 
separation of concerns, so that much can't be done here. Substitution of 
parameter values, calculation of desired values, etc. should be done above 
guacd, with guacd simply receiving the values which some other process (opaque 
to guacd) determines to be necessary.

{quote}
The current default value for recording-name is "recording".  It would be great 
if the guacamole-server component would use the connection id instead.

e.g. 

$c134c9d2-699e-46f1-af5c-add1c440a41f.recording
{quote}

Can you elaborate on why?

The expectation is that applications leveraging the Guacamole API would 
populate this value as they see fit, or that users of the mainline Guacamole 
application will use the existing tokens (like GUAC_USERNAME, GUAC_DATE, 
GUAC_TIME, etc.) to produce a reasonably-unique name. I don't think internal 
values from the Guacamole protocol should be used here.

> Session Recording: use connection id as default value for recording-name
> 
>
> Key: GUACAMOLE-501
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-501
> Project: Guacamole
>  Issue Type: New Feature
>  Components: guacamole
>Reporter: Kris Keller
>Priority: Minor
>
> The current default value for recording-name is "recording".  It would be 
> great if the guacamole-server component would use the connection id instead.
> e.g. 
> $c134c9d2-699e-46f1-af5c-add1c440a41f.recording
> Unfortunately, the client can't pass this down as it doesnt know the 
> connection id until after the connection is established and has received the 
> "ready" instruction.
>  
> Even if the guacamole team didn't want to make the connection id be the 
> default name, at least adding another token parameter for the connection id 
> would be awesome as well.  
> e.g. recording-name=${CONNECTION_ID}
>  Below is a patch i created to support the defaulting of the recording-name 
> parameter to connection id for rdp connections:
> {code:java}
> --- a/src/protocols/rdp/rdp_settings.c
> +++ b/src/protocols/rdp/rdp_settings.c
> @@ -837,9 +837,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
>                  IDX_RECORDING_PATH, NULL);
>      /* Read recording name */
> +    char pszRecordingName[255] = {'\0'};
> +    sprintf(pszRecordingName, "%s.recording", user->client->connection_id);
>      settings->recording_name =
>          guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
> -                IDX_RECORDING_NAME, GUAC_RDP_DEFAULT_RECORDING_NAME);
> +                IDX_RECORDING_NAME, pszRecordingName);
>      /* Parse output exclusion flag */
>      settings->recording_exclude_output =
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GUACAMOLE-501) Session Recording: use connection id as default value for recording-name

2018-02-06 Thread Kris Keller (JIRA)

[ 
https://issues.apache.org/jira/browse/GUACAMOLE-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354106#comment-16354106
 ] 

Kris Keller commented on GUACAMOLE-501:
---

Didn't feel like updating every protocol so locally implemented 
${CONNECTION_ID} token replacement.  Please feel free to grade my "c" 
techniques.


{code:java}
/diff --git a/src/libguac/user.c b/src/libguac/user.c
index 14ec75b..ae5fb04 100644
--- a/src/libguac/user.c
+++ b/src/libguac/user.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 guac_user* guac_user_alloc() {
 
@@ -354,6 +355,21 @@ char* guac_user_parse_args_string(guac_user* user, const 
char** arg_names,
 
 }
 
+/* check for specific tokens and replace with real values */
+char *psIndex = strstr(value, "${CONNECTION_ID}");
+if (psIndex != NULL) {
+int bszConnectionId = strlen(user->client->connection_id);
+int bszValue = strlen(value);
+int bszNewValue = bszValue-16+bszConnectionId;
+char *pszNewValue = (char*)malloc(bszNewValue);
+memset(pszNewValue, 0, bszNewValue);
+int offset = psIndex-value;
+strncpy(pszNewValue, value, offset);
+strncpy(&pszNewValue[offset], user->client->connection_id, 
bszConnectionId);
+strcpy(&pszNewValue[offset+bszConnectionId], &value[offset+16]);
+return pszNewValue;
+}
+
 /* Otherwise use provided value */
 return strdup(value);
 

{code}


> Session Recording: use connection id as default value for recording-name
> 
>
> Key: GUACAMOLE-501
> URL: https://issues.apache.org/jira/browse/GUACAMOLE-501
> Project: Guacamole
>  Issue Type: New Feature
>  Components: guacamole
>Reporter: Kris Keller
>Priority: Minor
>
> The current default value for recording-name is "recording".  It would be 
> great if the guacamole-server component would use the connection id instead.
> e.g. 
> $c134c9d2-699e-46f1-af5c-add1c440a41f.recording
> Unfortunately, the client can't pass this down as it doesnt know the 
> connection id until after the connection is established and has received the 
> "ready" instruction.
>  
> Even if the guacamole team didn't want to make the connection id be the 
> default name, at least adding another token parameter for the connection id 
> would be awesome as well.  
> e.g. recording-name=${CONNECTION_ID}
>  Below is a patch i created to support the defaulting of the recording-name 
> parameter to connection id for rdp connections:
> {code:java}
> --- a/src/protocols/rdp/rdp_settings.c
> +++ b/src/protocols/rdp/rdp_settings.c
> @@ -837,9 +837,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
>                  IDX_RECORDING_PATH, NULL);
>      /* Read recording name */
> +    char pszRecordingName[255] = {'\0'};
> +    sprintf(pszRecordingName, "%s.recording", user->client->connection_id);
>      settings->recording_name =
>          guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
> -                IDX_RECORDING_NAME, GUAC_RDP_DEFAULT_RECORDING_NAME);
> +                IDX_RECORDING_NAME, pszRecordingName);
>      /* Parse output exclusion flag */
>      settings->recording_exclude_output =
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)