You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/04/22 07:44:55 UTC

[GitHub] [skywalking] sonatype-lift[bot] commented on a diff in pull request #8725: Add data-generator module to run OAP in testing mode, generating mock data for testing

sonatype-lift[bot] commented on code in PR #8725:
URL: https://github.com/apache/skywalking/pull/8725#discussion_r855861734


##########
oap-server/server-tools/data-generator/src/main/java/org/apache/skywalking/generator/SequenceGenerator.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.skywalking.generator;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ThreadLocalRandom;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.google.common.base.Preconditions;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@JsonDeserialize(builder = SequenceGenerator.Builder.class)
+public final class SequenceGenerator implements Generator<Long> {
+    private final boolean limitedDomain;
+    private final long min;
+    private final long max;
+    private final long step;
+    private final Integer fluctuation;
+    private final Integer domainSize;
+    private final ThreadLocalRandom random = ThreadLocalRandom.current();

Review Comment:
   *PREDICTABLE_RANDOM:*  This random generator (java.util.concurrent.ThreadLocalRandom) is predictable [(details)](https://find-sec-bugs.github.io/bugs.htm#PREDICTABLE_RANDOM)
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196461889&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196461889&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461889&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461889&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196461889&lift_comment_rating=5) ]



##########
oap-server/server-tools/data-generator/src/main/java/org/apache/skywalking/generator/StringGenerator.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * 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.skywalking.generator;
+
+import java.util.HashSet;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.ThreadLocalRandom;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.google.common.base.Strings;
+import org.apache.commons.lang3.RandomStringUtils;
+import lombok.Data;
+
+@JsonDeserialize(builder = StringGenerator.Builder.class)
+public final class StringGenerator implements Generator<String> {
+    private final int length;
+    private final String prefix;
+    private final boolean letters;
+    private final boolean numbers;
+    private final boolean limitedDomain;
+    private final Random random = ThreadLocalRandom.current();

Review Comment:
   *PREDICTABLE_RANDOM:*  This random generator (java.util.concurrent.ThreadLocalRandom) is predictable [(details)](https://find-sec-bugs.github.io/bugs.htm#PREDICTABLE_RANDOM)
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196461857&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196461857&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461857&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461857&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196461857&lift_comment_rating=5) ]



##########
oap-server/server-tools/data-generator/src/main/java/org/apache/skywalking/generator/BoolGenerator.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.skywalking.generator;
+
+import java.util.Random;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.Data;
+
+@JsonDeserialize(builder = BoolGenerator.Builder.class)
+public final class BoolGenerator implements Generator<Boolean> {
+    private final Random random = new Random();

Review Comment:
   *PREDICTABLE_RANDOM:*  This random generator (java.util.Random) is predictable [(details)](https://find-sec-bugs.github.io/bugs.htm#PREDICTABLE_RANDOM)
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196461881&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196461881&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461881&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461881&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196461881&lift_comment_rating=5) ]



##########
oap-server/server-tools/data-generator/src/main/java/org/apache/skywalking/generator/IntGenerator.java:
##########
@@ -0,0 +1,102 @@
+/*
+ * 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.skywalking.generator;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ThreadLocalRandom;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.google.common.base.Preconditions;
+import lombok.Data;
+
+@JsonDeserialize(builder = IntGenerator.Builder.class)
+public final class IntGenerator implements Generator<Long> {
+    private final boolean limitedDomain;
+    private final Long min;
+    private final Long max;
+    private final Integer domainSize;
+    private final ThreadLocalRandom random = ThreadLocalRandom.current();

Review Comment:
   *PREDICTABLE_RANDOM:*  This random generator (java.util.concurrent.ThreadLocalRandom) is predictable [(details)](https://find-sec-bugs.github.io/bugs.htm#PREDICTABLE_RANDOM)
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196461891&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196461891&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461891&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196461891&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196461891&lift_comment_rating=5) ]



##########
oap-server/server-tools/data-generator/pom.xml:
##########
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  ~ 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>server-tools</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>9.1.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>data-generator</artifactId>
+    <name>data-generator</name>
+    <description>
+        Module to generate data for testing.
+    </description>
+
+    <dependencies>
+        <dependency>

Review Comment:
   *Critical OSS Vulnerability:*
   ### pkg:maven/org.apache.skywalking/server-starter@9.1.0-SNAPSHOT
   3 Critical, 7 Severe, 2 Moderate, 0 Unknown vulnerabilities have been found across 11 dependencies
   
   <details>
     <summary><b>Components</b></summary><br/>
     <ul>
         <details>
           <summary><b>pkg:maven/commons-codec/commons-codec@1.11</b></summary>
           <ul>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2012-0050] CWE-20: Improper Input Validation
   > commons-codec - Base32 would decode some invalid Base32 encoded string into arbitrary value
   
   The product does not validate or incorrectly validates input that can affect the control flow or data flow of a program.
   >
   > **CVSS Score:** 5.3
   >
   > **CVSS Vector:** CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
   >
   > **CWE:** CWE-20
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/com.h2database/h2@2.1.210</b></summary>
           <ul>
     <details>
       <summary><b>CRITICAL Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2020-1324] CWE-94: Improper Control of Generation of Code ('Code Injection')
   > h2 - Remote Code Execution (RCE)
   
   The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
   >
   > **CVSS Score:** 8
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H
   >
   > **CWE:** CWE-94
   
   </ul>
       </details>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [CVE-2018-14335] CWE-59: Improper Link Resolution Before File Access ('Link Following')
   > An issue was discovered in H2 1.4.197. Insecure handling of permissions in the backup function allows attackers to read sensitive files (outside of their permissions) via a symlink to a fake database file.
   >
   > **CVSS Score:** 6.5
   >
   > **CVSS Vector:** CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
   >
   > **CWE:** CWE-59
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/com.squareup.okhttp3/okhttp@3.14.9</b></summary>
           <ul>
     <details>
       <summary><b>CRITICAL Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [CVE-2021-0341] CWE-295: Improper Certificate Validation
   > In verifyHostName of OkHostnameVerifier.java, there is a possible way to accept a certificate for the wrong domain due to improperly used crypto. This could lead to remote information disclosure with no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVersions: Android-8.1 Android-9 Android-10 Android-11Android ID: A-171980069
   >
   > **CVSS Score:** 7.5
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
   >
   > **CWE:** CWE-295
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/org.bouncycastle/bcprov-ext-jdk15on@1.69</b></summary>
           <ul>
     <details>
       <summary><b>MODERATE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2019-0673] CWE-400: Uncontrolled Resource Consumption ('Resource Exhaustion')
   > BouncyCastle - Denial of Service (DoS)
   
   The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.
   >
   > **CVSS Score:** 3.7
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
   >
   > **CWE:** CWE-400
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/io.grpc/grpc-core@1.43.2</b></summary>
           <ul>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2021-0818] CWE-404: Improper Resource Shutdown or Release
   > grpc-core - Improper Resource Shutdown or Release
   
   The program does not release or incorrectly releases a resource before it is made available for re-use.
   >
   > **CVSS Score:** 6.5
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
   >
   > **CWE:** CWE-404
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/io.netty/netty-handler@4.1.68.Final</b></summary>
           <ul>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2020-0026] CWE-300: Channel Accessible by Non-Endpoint ('Man-in-the-Middle')
   > netty-handler - Improper Certificate Validation
   
   The product does not adequately verify the identity of actors at both ends of a communication channel, or does not adequately ensure the integrity of the channel, in a way that allows the channel to be accessed or influenced by an actor that is not an endpoint.
   >
   > **CVSS Score:** 6.5
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
   >
   > **CWE:** CWE-300
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/org.freemarker/freemarker@2.3.28</b></summary>
           <ul>
     <details>
       <summary><b>CRITICAL Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2019-0870] CWE-94: Improper Control of Generation of Code ('Code Injection')
   > Apache FreeMarker - Code Injection
   
   The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
   >
   > **CVSS Score:** 7.7
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N
   >
   > **CWE:** CWE-94
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/com.google.guava/guava@31.1-jre</b></summary>
           <ul>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2020-0926] CWE-379: Creation of Temporary File in Directory with Incorrect Permissions
   > guava - Creation of Temporary File in Directory with Insecure Permissions [CVE-2020-8908]
   
   The software creates a temporary file in a directory whose permissions allow unintended actors to determine the file&#39;s existence or otherwise access that file.
   >
   > **CVSS Score:** 6.2
   >
   > **CVSS Vector:** CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
   >
   > **CWE:** CWE-379
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/io.netty/netty-codec-http@4.1.68.Final</b></summary>
           <ul>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [CVE-2021-43797] CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling')
   > Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers &amp; clients. Netty prior to version 4.1.71.Final skips control chars when they are present at the beginning / end of the header name. It should instead fail fast as these are not allowed by the spec and could lead to HTTP request smuggling. Failing to do the validation might cause netty to &quot;sanitize&quot; header names before it forward these to another remote system when used as proxy. This remote system can&#39;t see the invalid usage anymore, and therefore does not do the validation itself. Users should upgrade to version 4.1.71.Final.
   >
   > **CVSS Score:** 6.5
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
   >
   > **CWE:** CWE-444
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/org.bouncycastle/bcprov-jdk15on@1.69</b></summary>
           <ul>
     <details>
       <summary><b>MODERATE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [sonatype-2019-0673] CWE-400: Uncontrolled Resource Consumption ('Resource Exhaustion')
   > BouncyCastle - Denial of Service (DoS)
   
   The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.
   >
   > **CVSS Score:** 3.7
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
   >
   > **CWE:** CWE-400
   
   </ul>
       </details>
           </ul>
         </details>
         <details>
           <summary><b>pkg:maven/org.apache.kafka/kafka-clients@2.4.1</b></summary>
           <ul>
     <details>
       <summary><b>SEVERE Vulnerabilities (1)</b></summary><br/>
   <ul>
   
   > #### [CVE-2021-38153] CWE-203: Information Exposure Through Discrepancy
   > Some components in Apache Kafka use `Arrays.equals` to validate a password or key, which is vulnerable to timing attacks that make brute force attacks for such credentials more likely to be successful. Users should upgrade to 2.8.1 or higher, or 3.0.0 or higher where this vulnerability has been fixed. The affected versions include Apache Kafka 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, and 2.8.0.
   >
   > **CVSS Score:** 5.9
   >
   > **CVSS Vector:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
   >
   > **CWE:** CWE-203
   
   </ul>
       </details>
           </ul>
         </details>
     </ul>
   </details>
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196462186&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196462186&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462186&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462186&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196462186&lift_comment_rating=5) ]



##########
docker/data-generator/docker-entrypoint.sh:
##########
@@ -0,0 +1,46 @@
+#!/bin/sh
+# 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.
+
+set -e
+
+echo "[Entrypoint] Apache SkyWalking Data Generator Docker Image"
+
+EXT_LIB_DIR=/skywalking/ext-libs
+EXT_CONFIG_DIR=/skywalking/ext-config
+
+# Override default application.yml with application.yml in the data generator module
+
+cp -vfRL tools/data-generator/config/application.yml config/
+
+# Override configuration files
+if [ "$(ls -A $EXT_CONFIG_DIR)" ]; then
+  cp -vfRL ${EXT_CONFIG_DIR}/* config/
+fi
+
+CLASSPATH="config:$CLASSPATH"
+for i in oap-libs/*.jar
+do
+    CLASSPATH="$i:$CLASSPATH"
+done
+for i in "${EXT_LIB_DIR}"/*.jar
+do
+    CLASSPATH="$i:$CLASSPATH"
+done
+
+set -ex
+
+exec java ${JAVA_OPTS} -classpath ${CLASSPATH} org.apache.skywalking.starter.DataGeneratorStartUp "$@"

Review Comment:
   *ShellCheck:*  Double quote to prevent globbing and word splitting.
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196462287&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196462287&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462287&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462287&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196462287&lift_comment_rating=5) ]



##########
docker/data-generator/docker-entrypoint.sh:
##########
@@ -0,0 +1,46 @@
+#!/bin/sh
+# 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.
+
+set -e
+
+echo "[Entrypoint] Apache SkyWalking Data Generator Docker Image"
+
+EXT_LIB_DIR=/skywalking/ext-libs
+EXT_CONFIG_DIR=/skywalking/ext-config
+
+# Override default application.yml with application.yml in the data generator module
+
+cp -vfRL tools/data-generator/config/application.yml config/
+
+# Override configuration files
+if [ "$(ls -A $EXT_CONFIG_DIR)" ]; then
+  cp -vfRL ${EXT_CONFIG_DIR}/* config/
+fi
+
+CLASSPATH="config:$CLASSPATH"
+for i in oap-libs/*.jar
+do
+    CLASSPATH="$i:$CLASSPATH"
+done
+for i in "${EXT_LIB_DIR}"/*.jar
+do
+    CLASSPATH="$i:$CLASSPATH"
+done
+
+set -ex
+
+exec java ${JAVA_OPTS} -classpath ${CLASSPATH} org.apache.skywalking.starter.DataGeneratorStartUp "$@"

Review Comment:
   *ShellCheck:*  Double quote to prevent globbing and word splitting.
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196462286&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196462286&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462286&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462286&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196462286&lift_comment_rating=5) ]



##########
oap-server/server-tools/data-generator/src/main/assembly/bin/start.sh:
##########
@@ -0,0 +1,49 @@
+#!/usr/bin/env sh
+# 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.
+
+PRG="$0"
+PRGDIR=$(dirname "$PRG")
+[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/../../.." > /dev/null || exit 1; pwd)
+
+OAP_LOG_DIR="${OAP_LOG_DIR:-${OAP_HOME}/logs}"
+JAVA_OPTS="${JAVA_OPTS:-  -Xms256M -Xmx512M}"
+
+if [ ! -d "${OAP_LOG_DIR}" ]; then
+    mkdir -p "${OAP_LOG_DIR}"
+fi
+
+_RUNJAVA=${JAVA_HOME}/bin/java
+[ -z "$JAVA_HOME" ] && _RUNJAVA=java
+
+CLASSPATH="$OAP_HOME/tools/data-generator/config:$OAP_HOME/config:$CLASSPATH"
+for i in "$OAP_HOME"/oap-libs/*.jar
+do
+    CLASSPATH="$i:$CLASSPATH"
+done
+
+OAP_OPTIONS=" -Doap.logDir=${OAP_LOG_DIR}"
+
+eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} ${OAP_OPTIONS} -classpath $CLASSPATH org.apache.skywalking.starter.DataGeneratorStartUp \
+        2>${OAP_LOG_DIR}/oap.log 1> /dev/null &"
+
+if [ $? -eq 0 ]; then

Review Comment:
   *ShellCheck:*  Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=196462279&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=196462279&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462279&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=196462279&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=196462279&lift_comment_rating=5) ]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org