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

ASF GitHub Bot commented on ZOOKEEPER-2014:
-------------------------------------------

Github user breed commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/96#discussion_r86679106
  
    --- Diff: 
src/java/test/org/apache/zookeeper/test/ReconfigExceptionTest.java ---
    @@ -0,0 +1,220 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.zookeeper.test;
    +
    +import java.io.IOException;
    +import java.util.ArrayList;
    +import java.util.Collections;
    +import java.util.List;
    +import java.util.concurrent.TimeoutException;
    +
    +import org.apache.zookeeper.ZKTestCase;
    +import org.apache.zookeeper.KeeperException;
    +import org.apache.zookeeper.ZooDefs;
    +import org.apache.zookeeper.PortAssignment;
    +import org.apache.zookeeper.admin.ZooKeeperAdmin;
    +import org.apache.zookeeper.data.ACL;
    +import org.apache.zookeeper.data.Id;
    +import org.apache.zookeeper.data.Stat;
    +import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
    +import org.junit.After;
    +import org.junit.Assert;
    +import org.junit.Before;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +public class ReconfigExceptionTest extends ZKTestCase {
    +    private static final Logger LOG = LoggerFactory
    +            .getLogger(ReconfigExceptionTest.class);
    +    private static String authProvider = 
"zookeeper.DigestAuthenticationProvider.superDigest";
    +    // Use DigestAuthenticationProvider.base64Encode or
    +    // run ZooKeeper jar with 
org.apache.zookeeper.server.auth.DigestAuthenticationProvider to generate 
password.
    +    // An example:
    +    // java -cp 
zookeeper-3.6.0-SNAPSHOT.jar:lib/log4j-1.2.17.jar:lib/slf4j-log4j12-1.7.5.jar:
    +    // lib/slf4j-api-1.7.5.jar 
org.apache.zookeeper.server.auth.DigestAuthenticationProvider super:test
    +    // The password here is 'test'.
    +    private static String superDigest = 
"super:D/InIHSb7yEEbrWz8b9l71RjZJU=";
    +    private QuorumUtil qu;
    +    private ZooKeeperAdmin zkAdmin;
    +
    +    @Before
    +    public void setup() throws InterruptedException, 
KeeperException.NoNodeException {
    --- End diff --
    
    +1 awesome work! i only found little nits! thanx for sticking with this!


> Only admin should be allowed to reconfig a cluster
> --------------------------------------------------
>
>                 Key: ZOOKEEPER-2014
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2014
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.5.0
>            Reporter: Raul Gutierrez Segales
>            Assignee: Michael Han
>            Priority: Blocker
>             Fix For: 3.5.3
>
>         Attachments: ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, 
> ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, 
> ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, 
> ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, 
> ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch, ZOOKEEPER-2014.patch
>
>
> ZOOKEEPER-107 introduces reconfiguration support via the reconfig() call. We 
> should, at the very least, ensure that only the Admin can reconfigure a 
> cluster. Perhaps restricting access to /zookeeper/config as well, though this 
> is debatable. Surely one could ensure Admin only access via an ACL, but that 
> would leave everyone who doesn't use ACLs unprotected. We could also force a 
> default ACL to make it a bit more consistent (maybe).
> Finally, making reconfig() only available to Admins means they have to run 
> with zookeeper.DigestAuthenticationProvider.superDigest (which I am not sure 
> if everyone does, or how would it work with other authentication providers). 
> Review board https://reviews.apache.org/r/51546/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to