[
https://issues.apache.org/jira/browse/FLINK-3930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15455506#comment-15455506
]
ASF GitHub Bot commented on FLINK-3930:
---------------------------------------
Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/flink/pull/2425#discussion_r77180355
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientSecureTest.java
---
@@ -0,0 +1,46 @@
+/*
+ * 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.flink.runtime.blob;
+
+import org.apache.flink.configuration.ConfigConstants;
+import org.junit.BeforeClass;
+
+import java.io.IOException;
+
+import static org.junit.Assert.fail;
+
+public class BlobClientSecureTest extends BlobClientTest {
+
+ /**
+ * Starts the BLOB server with secure cookie enabled configuration
+ */
+ @BeforeClass
+ public static void startServer() {
+ try {
+ config.setBoolean(ConfigConstants.SECURITY_ENABLED,
true);
+ config.setString(ConfigConstants.SECURITY_COOKIE,
"foo");
+ BLOB_SERVER = new BlobServer(config);
+ }
+ catch (IOException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
--- End diff --
Maybe it makes sense to add a test ensuring that clients with a wrong
cookie are rejected:
```
@Test(expected = IOException.class)
public void testInvalidSecurityCookie() throws IOException {
BlobClient client = null;
try {
byte[] testBuffer = createTestBuffer();
MessageDigest md = BlobUtils.createMessageDigest();
md.update(testBuffer);
InetSocketAddress serverAddress = new
InetSocketAddress("localhost", BLOB_SERVER.getPort());
client = new BlobClient(serverAddress, "different");
// Store some data
client.put(testBuffer);
}
finally {
if (client != null) {
try {
client.close();
} catch (Throwable t) {}
}
}
}
```
> Implement Service-Level Authorization
> -------------------------------------
>
> Key: FLINK-3930
> URL: https://issues.apache.org/jira/browse/FLINK-3930
> Project: Flink
> Issue Type: New Feature
> Components: Security
> Reporter: Eron Wright
> Assignee: Vijay Srinivasaraghavan
> Labels: security
> Original Estimate: 672h
> Remaining Estimate: 672h
>
> _This issue is part of a series of improvements detailed in the [Secure Data
> Access|https://docs.google.com/document/d/1-GQB6uVOyoaXGwtqwqLV8BHDxWiMO2WnVzBoJ8oPaAs/edit?usp=sharing]
> design doc._
> Service-level authorization is the initial authorization mechanism to ensure
> clients (or servers) connecting to the Flink cluster are authorized to do so.
> The purpose is to prevent a cluster from being used by an unauthorized
> user, whether to execute jobs, disrupt cluster functionality, or gain access
> to secrets stored within the cluster.
> Implement service-level authorization as described in the design doc.
> - Introduce a shared secret cookie
> - Enable Akka security cookie
> - Implement data transfer authentication
> - Secure the web dashboard
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)