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

Alexander Rojas commented on MESOS-8413:
----------------------------------------

Backport commits.

{noformat}
commit af082dc8e31be696dc857374d13359d98b4f4359
Author:     Alexander Rojas <[email protected]>
AuthorDate: Thu Jan 18 16:20:18 2018 +0100
Commit:     Alexander Rojas <[email protected]>
CommitDate: Thu Jan 25 11:04:57 2018 +0100

    Added SecurePathOrValue for file flags which need not to leak contents.

    The default behavior when serializing a flag, if its value comes from
    a file (by using the prefix `file://`) is to show the contents of
    the file instead of the path to the file.

    A common pattern for flags containing sensitive information is to
    store the values in a secure file, however the default behavior
    of serializing flags causes these values to be leaked when
    serializing a subclass of `FlagsBase`.

    This patch introduces the structure `SecurePathOrValue` so that
    the default behavior is overriden and the path of the flag will
    be shown instead of the flag value itself.

    Review: https://reviews.apache.org/r/65226
{noformat}
{noformat}
commit e6269bea534dfc512291e7762e34cfdb216eb311
Author:     Alexander Rojas <[email protected]>
AuthorDate: Thu Jan 11 10:47:04 2018 +0100
Commit:     Alexander Rojas <[email protected]>
CommitDate: Thu Jan 25 11:05:09 2018 +0100

    Mesos flags related to ZooKeeper use SecurePathOrValue.

    Up until now the Mesos master flag `--zk` as well as the Mesos agent
    flag `--master` would leak ZooKeeper authentication credentials in
    both logs and results for the `/flags` endpoint, if the credentials
    were part of the configuration url.

    This patch prevents this leakage if a user decides to store the
    ZooKeeper url in a file and pass the file as a value to the flags
    mentioned above (using the preffix `file://`).

    Review: https://reviews.apache.org/r/65090
{noformat}

{noformat}
commit b9b626c9b50e7c8ebd376990ab1f41fc5e1a36a7 (HEAD -> 1.5.x, upstream/1.5.x)
Author:     Alexander Rojas <[email protected]>
AuthorDate: Thu Jan 25 11:49:47 2018 +0100
Commit:     Alexander Rojas <[email protected]>
CommitDate: Thu Jan 25 11:49:47 2018 +0100

    Added MESOS-8413 to CHANGELOG.
{noformat}


> Zookeeper configuration passwords are shown in clear text
> ---------------------------------------------------------
>
>                 Key: MESOS-8413
>                 URL: https://issues.apache.org/jira/browse/MESOS-8413
>             Project: Mesos
>          Issue Type: Bug
>          Components: master
>    Affects Versions: 1.4.1
>            Reporter: Alexander Rojas
>            Assignee: Alexander Rojas
>            Priority: Major
>              Labels: mesosphere, security
>             Fix For: 1.5.0, 1.6.0
>
>
> No matter how one configures mesos, either by passing the ZooKeeper flags in 
> the command line or using a file, as follows:
> {noformat}
> ./bin/mesos-master.sh --work_dir=/tmp/$USER/mesos/master 
> --log_dir=/tmp/$USER/mesos/master/log 
> --zk=zk://${zk_username}:${zk_password}@${zk_addr}/mesos --quorum=1
> {noformat}
> {noformat}
> echo "zk://${zk_username}:${zk_password}@${zk_addr}/mesos" > 
> /tmp/${USER}/mesos/zk_config.txt
> ./bin/mesos-master.sh --work_dir=/tmp/$USER/mesos/master 
> --log_dir=/tmp/$USER/mesos/master/log --zk=/tmp/${USER}/mesos/zk_config.txt
> {noformat}
> both the logs and the results of the {{/flags}} endpoint will resolve to the 
> contents of the flags, i.e.:
> {noformat}
> I0108 10:12:50.387522 28579 master.cpp:458] Flags at startup: 
> --agent_ping_timeout="15secs" --agent_reregister_timeout="10mins" 
> --allocation_interval="1secs" --allocator="HierarchicalDRF" 
> --authenticate_agents="false" --authenticate_frameworks="false" 
> --authenticate_http_frameworks="false" --authenticate_http_readonly="false" 
> --authenticate_http_readwrite="false" --authenticators="crammd5" 
> --authorizers="local" --filter_gpu_resources="true" --framework_sorter="drf" 
> --help="false" --hostname_lookup="true" --http_authenticators="basic" 
> --initialize_driver_logging="true" --log_auto_initialize="true" 
> --log_dir="/tmp/user/mesos/master/log" --logbufsecs="0" 
> --logging_level="INFO" --max_agent_ping_timeouts="5" 
> --max_completed_frameworks="50" --max_completed_tasks_per_framework="1000" 
> --max_unreachable_tasks_per_framework="1000" --port="5050" --quiet="false" 
> --quorum="1" --recovery_agent_removal_limit="100%" 
> --registry="replicated_log" --registry_fetch_timeout="1mins" 
> --registry_gc_interval="15mins" --registry_max_agent_age="2weeks" 
> --registry_max_agent_count="102400" --registry_store_timeout="20secs" 
> --registry_strict="false" --require_agent_domain="false" 
> --root_submissions="true" --user_sorter="drf" --version="false" 
> --webui_dir="/home/user/mesos/build/../src/webui" 
> --work_dir="/tmp/user/mesos/master" 
> --zk="zk://user@passwd:127.0.0.1:2181/mesos" --zk_session_timeout="10secs"
> {noformat}
> {noformat}
> HTTP/1.1 200 OK
> Content-Encoding: gzip
> Content-Length: 591
> Content-Type: application/json
> Date: Mon, 08 Jan 2018 15:12:53 GMT
> {
>     "flags": {
>         "agent_ping_timeout": "15secs",
>         "agent_reregister_timeout": "10mins",
>         "allocation_interval": "1secs",
>         "allocator": "HierarchicalDRF",
>         "authenticate_agents": "false",
>         "authenticate_frameworks": "false",
>         "authenticate_http_frameworks": "false",
>         "authenticate_http_readonly": "false",
>         "authenticate_http_readwrite": "false",
>         "authenticators": "crammd5",
>         "authorizers": "local",
>         "filter_gpu_resources": "true",
>         "framework_sorter": "drf",
>         "help": "false",
>         "hostname_lookup": "true",
>         "http_authenticators": "basic",
>         "initialize_driver_logging": "true",
>         "log_auto_initialize": "true",
>         "log_dir": "/tmp/user/mesos/master/log",
>         "logbufsecs": "0",
>         "logging_level": "INFO",
>         "max_agent_ping_timeouts": "5",
>         "max_completed_frameworks": "50",
>         "max_completed_tasks_per_framework": "1000",
>         "max_unreachable_tasks_per_framework": "1000",
>         "port": "5050",
>         "quiet": "false",
>         "quorum": "1",
>         "recovery_agent_removal_limit": "100%",
>         "registry": "replicated_log",
>         "registry_fetch_timeout": "1mins",
>         "registry_gc_interval": "15mins",
>         "registry_max_agent_age": "2weeks",
>         "registry_max_agent_count": "102400",
>         "registry_store_timeout": "20secs",
>         "registry_strict": "false",
>         "require_agent_domain": "false",
>         "root_submissions": "true",
>         "user_sorter": "drf",
>         "version": "false",
>         "webui_dir": "/home/user/mesos/build/../src/webui",
>         "work_dir": "/tmp/user/mesos/master",
>         "zk": "zk://user@passwd:127.0.0.1:2181/mesos",
>         "zk_session_timeout": "10secs"
>     }
> }
> {noformat}
> Which leads to having no effective way to prevent the passwords to be shown 
> if someone can get the hands in either of the previous methods.



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

Reply via email to