Giter Site home page Giter Site logo

yahoo / sherlock Goto Github PK

View Code? Open in Web Editor NEW
149.0 16.0 43.0 1.59 MB

Sherlock is an anomaly detection service built on top of Druid

License: Other

Makefile 0.02% Java 58.83% HTML 11.39% CSS 1.87% JavaScript 27.19% Jupyter Notebook 0.71%
anomaly-detection timeseries druid redis redis-cluster jobscheduler sparkjava

sherlock's Introduction

Sherlock: Anomaly Detector

build Release Artifacts Snapshot Artifacts Coverage Status GPL 3.0

Table of Contents

Introduction to Sherlock

Sherlock is an anomaly detection service built on top of Druid. It leverages EGADS (Extensible Generic Anomaly Detection System) to detect anomalies in time-series data. Users can schedule jobs on an hourly, daily, weekly, or monthly basis, view anomaly reports from Sherlock's interface, or receive them via email.

Components

  1. Timeseries Generation
  2. EGADS Anomaly Detection
  3. Redis database
  4. UI in Spark Java

Detailed Description

Timeseries Generation

Timeseries generation is the first phase of Sherlock's anomaly detection. The user inputs a full Druid JSON query with a metric name and group-by dimensions. Sherlock validates the query, adjusts the time interaval and granularity based on the EGADS config, and makes a call to Druid. Druid responds with an array of time-series, which are parsed into EGADS time-series.

Sample Druid Query:

{
  "metric": "metric(metric1/metric2)", 
  "aggregations": [
    {
      "filter": {
        "fields": [
          {
            "type": "selector", 
            "dimension": "dim1", 
            "value": "value1"
          }
        ], 
        "type": "or"
      }, 
      "aggregator": {
        "fieldName": "metric2", 
        "type": "longSum", 
        "name": "metric2"
      }, 
      "type": "filtered"
    }
  ], 
  "dimension": "groupByDimension", 
  "intervals": "2017-09-10T00:00:01+00:00/2017-10-12T00:00:01+00:00", 
  "dataSource": "source1", 
  "granularity": {
    "timeZone": "UTC", 
    "type": "period", 
    "period": "P1D"
  }, 
  "threshold": 50, 
  "postAggregations": [
    {
      "fields": [
        {
          "fieldName": "metric1", 
          "type": "fieldAccess", 
          "name": "metric1"
        }
      ], 
      "type": "arithmetic", 
      "name": "metric(metric1/metric2)", 
      "fn": "/"
    }
  ], 
  "queryType": "topN"
}

Sample Druid Response:

[ {
  "timestamp" : "2017-10-11T00:00:00.000Z",
  "result" : [ {
    "groupByDimension" : "dim1",
    "metric(metric1/metric2)" : 8,
    "metric1" : 128,
    "metric2" : 16
  }, {
    "groupByDimension" : "dim2",
    "metric(metric1/metric2)" : 4.5,
    "metric1" : 42,
    "metric2" : 9.33
  } ]
}, {
  "timestamp" : "2017-10-12T00:00:00.000Z",
  "result" : [ {
    "groupByDimension" : "dim1",
    "metric(metric1/metric2)" : 9,
    "metric1" : 180,
    "metric2" : 20
  }, {
    "groupByDimension" : "dim2",
    "metric(metric1/metric2)" : 5.5,
    "metric1" : 95,
    "metric2" : 17.27
  } ]
} ]

EGADS Anomaly Detection

Sherlock calls the user-configured EGADS API for each generated time-series, generates anomaly reports from the response, and stores these reports in a database. Users may also elect to receive anomaly reports by email.

Redis Database

Sherlock uses a Redis backend Redis to store job metadata, generated anomaly reports, among other information, and as a persistent job queue. Keys related to Reports have retention policy. Hourly job reports have retention of 14 days and daily/weekly/monthly job reports have 1 year of retention.

Sherlock UI

Sherlock's user interface is built with Spark. The UI enables users to submit instant anomaly analyses, create and launch detection jobs, view anomalies on a heatmap, and on a graph.

Building Sherlock

A Makefile is provided with all build targets.

Building the JAR

make jar

This creates sherlock.jar in the target/ directory.

How to run

Sherlock is run through the commandline with config arguments.

java -Dlog4j.configuration=file:${path_to_log4j}/log4j.properties \
      -jar ${path_to_jar}/sherlock.jar \
      --version $(VERSION) \
      --project-name $(PROJECT_NAME) \
      --port $(PORT) \
      --enable-email \
      --failure-email $(FAILURE_EMAIL) \
      --from-mail $(FROM_MAIL) \
      --reply-to $(REPLY_TO) \
      --smtp-host $(SMTP_HOST) \
      --interval-minutes $(INTERVAL_MINUTES) \
      --interval-hours $(INTERVAL_HOURS) \
      --interval-days $(INTERVAL_DAYS) \
      --interval-weeks $(INTERVAL_WEEKS) \
      --interval-months $(INTERVAL_MONTHS) \
      --egads-config-filename $(EGADS_CONFIG_FILENAME) \
      --redis-host $(REDIS_HOSTNAME) \
      --redis-port $(REDIS_PORT) \
      --execution-delay $(EXECUTION_DELAY) \
      --timeseries-completeness $(TIMESERIES_COMPLETENESS)

CLI args usage

args required default description
--help - false help
--config - null config
--version - v0.0.0 version
--egads-config-filename - provided egads-config-filename
--port - 4080 port
--interval-minutes - 180 interval-minutes
--interval-hours - 672 interval-hours
--interval-days - 28 interval-days
--interval-weeks - 12 interval-weeks
--interval-months - 6 interval-months
--enable-email - false enable-email
--from-mail if email enabled from-mail
--reply-to if email enabled reply-to
--smtp-host if email enabled smtp-host
--smtp-port - 25 smtp-port
--smtp-user - smtp-user
--smtp-password - smtp-password
--failure-email if email enabled failure-email
--execution-delay - 30 execution-delay
--valid-domains - null valid-domains
--redis-host - 127.0.0.1 redis-host
--redis-port - 6379 redis-port
--redis-ssl - false redis-ssl
--redis-timeout - 5000 redis-timeout
--redis-password - - redis-password
--redis-clustered - false redis-clustered
--project-name - - project-name
--external-file-path - - external-file-path
--debug-mode - false debug-mode
--timeseries-completeness - 60 timeseries-completeness
--http-client-timeout - 20000 http-client-timeout
--backup-redis-db-path - null backup-redis-db-path
--druid-brokers-list-file - null druid-brokers-list-file
--truststore-path - null truststore-path
--truststore-type - jks truststore-type
--truststore-password - null truststore-password
--keystore-path - null keystore-path
--keystore-type - jks keystore-type
--keystore-password - null keystore-password
--key-dir - null key-dir
--cert-dir - null cert-dir
--https-hostname-verification - true https-hostname-verification
--custom-ssl-context-provider-class - DefaultSslContextProvider custom-ssl-context-provider-class
--custom-secret-provider-class - DefaultSecretProvider custom-secret-provider-class
--prophet-url - 127.0.0.1:4080 prophet-url
--prophet-timeout - 120000 prophet-timeout
--prophet-principal - prophet-principal prophet-principal

help

Prints commandline argument help message.

config

Path to a Sherlock configuration file, where the above configuration may be specified. Config arguments in the file override commandline arguments.

version

Version of sherlock.jar to display on the UI

egads-config-filename

Path to a custom EGADS configuration file. If none is specified, the default configuration is used.

port

Port on which to host the Spark application.

interval-minutes

Number of historic data points to use for detection on time-series every minute.

interval-hours

Number of historic data points to use for detection on hourly time-series.

interval-days

Number of historic data points to use for detection on daily time-series.

interval-weeks

Number of historic data points to use for detection on weekly time-series.

interval-months

Number of historic data points to use for detection on monthly time-series.

enable-email

Enable the email service. This enables users to receive email anomaly report notifications.

from-mail

The handle's FROM email displayed to email recipients.

reply-to

The handle's REPLY TO email where replies will be sent.

smtp-host

The email service's SMTP HOST.

smtp-port

The email service's SMTP PORT. The default value is 25.

smtp-user

The email service's SMTP USER.

smtp-password

The email service's SMTP PASSWORD.

failure-email

A dedicated email which may be set to receive job failure notifications.

execution-delay

Sherlock periodically pings Redis to check scheduled jobs. This sets the ping delay in seconds. Jobs are scheduled with a precision of one minute.

valid-domains

A comma-separated list of valid domains to receive emails, e.g. 'yahoo,gmail,hotmail'. If specified, Sherlock will restrict who may receive emails.

redis-host

The Redis backend hostname.

redis-port

The Redis backend port.

redis-ssl

Whether Sherlock should connect to Redis via SSL.

redis-timeout

The Redis connection timeout.

redis-password

The password to use when authenticating to Redis.

redis-clustered

Whether the Redis backend is a cluster.

project-name

Name of the project to display on UI.

external-file-path

Specify the path to external files for Spark framework via this argument.

debug-mode

Debug mode enables debug routes. Ex. '/DatabaseJson' (shows redis data as json dump). Look at com.yahoo.sherlock.App for more details.

timeseries-completeness

This defines minimum fraction of datapoints needed in the timeseries to consider it as a valid timeseries o/w sherlock ignores such timeseries. (default value 60 i.e. 0.6 in fraction)

http-client-timeout

HttpClient timeout can be configured using this(in millis). (default value 20000)

backup-redis-db-path

Backup redis DB at given file path as json dump of indices and objects. Backup is done per day at midnight. Default this parameter is null i.e. no buckup. However, BGSAVE command is run at midnight to save redis local dump.

druid-brokers-list-file

Specify the path to an access control list file of permitted druid broker hosts for querying. Format: <host1>:<port>,<host2>:<port>... (default null i.e any host is allowed)

truststore-path

Path to specify truststore location for mTLS connections. (default null)

truststore-type

Param to specify truststore type for mTLS connections. (default jks)

truststore-password

Param to specify truststore password for mTLS connections. (default null)

keystore-path

Path to specify keystore location for mTLS connections. (default null)

keystore-type

Param to specify keystore type for mTLS connections. (default jks)

keystore-password

Param to specify keystore password for mTLS connections. (default null)

key-dir

Param to specify key directory containing multiple keys(for different clusters) for mTLS connections (default null). This is used when Principal Name is given in druid cluster form. It looks for filename containing Principal Name under this dir. If --key-dir and --cert-dir values are same then the filename should also contain the identifier key for private key file and cert for public key file.

cert-dir

Param to specify cert directory containing multiple certs(for different clusters) for mTLS connections (default null)." This is used when Principal Name is given in druid cluster form. It looks for file name containing Principal Name under this dir. If --key-dir and --cert-dir values are same then the filename should also contain the identifier key for private key file and cert for public key file.

https-hostname-verification

Param to enable/disable https hostname verification for mTLS connections. (default true i.e. hostname verification enabled)

custom-ssl-context-provider-class

Param to specify custom ssl context provider class for mTLS connections. (default com.yahoo.sherlock.utils.DefaultSslContextProvider which returns SSLContext with validation)

custom-secret-provider-class

Param to specify custom secret provider class for passwords. (default com.yahoo.sherlock.utils.DefaultSecretProvider which returns secrets specified from CLISettings)

prophet-url

API endpoint of a running Prophet Service. (default 127.0.0.1:4080 which include both url and port)

prophet-timeout

Timeout for querying the Prophet Service. (default 120000 milliseconds)

prophet-principal

The Kubernetes principal that the Prophet Service is located. (default prophet-principal)

Getting started

It is suggested to use Java8 and Maven 3.3 to develop Sherlock.

Further Development

Adding a new anomaly detector to Sherlock

Currently, Sherlock supports two detector pipelines (Egads/Prophet). Both pipelines use Egads' anomaly detection module for anomaly detection. The Egads pipeline conducts both time series forecasting and anomaly detection via Egads anomaly detection library. On the other hand, the Prophet pipeline allows Sherlock to query forecasted time series from a Prophet web service. After that, the Prophet pipeline performs anomaly detection via Egads' anomaly detection module. If the developer wants to add a new anomaly detector to Sherlock, the developer should look at the abstract class service/DetectorAPIService.java, and implement a new detector class that extends DetectorAPIService. More specifically, developers should implement abstract methods detectAnomaliesAndForecast and detectAnomalies. The two abstract methods are elaborated in sections below.

Developing the instant detection feature

Sherlock allows the user to perform an instant anomaly detection, which is accessible via the /Flash-Query endpoint. The endpoint is linked to method processInstantAnomalyJob under Routes.java, which calls method detectWithResults under DetectorService.java. Method detectWithResults checks which detector the user wants to use, assign the corresponding DetectorAPIService instance, and calls the instance's detectAnomaliesAndForecast method. Method detectAnomaliesAndForecast does anomaly detection and returns the original time series, expected time series, and the anomaly points. The combined results are displayed via the /Flash-Query/ProcessAnomalyReport endpoint.

Developing the Job Scheduling feature

Sherlock allows the user to schedule anomaly detection jobs that run routinely. Regarding the job scheduling, Sherlock uses JobScheduler.java to maintain a Priority Queue stored in Redis. Every time the user adds a job, Sherlock puts the job into via method scheduleJob with the job's next run time as the priority. Sherlock keeps checking the current system time, and pops the Priority Queue as required via method consumeAndExecuteTasks. For the actual detection, method consumeAndExecuteTasks executes a job that is due, which eventually goes to method runDetection under DetectorService.java. Method runDetection checks which detector the user wants to use, assign the corresponding DetectorAPIService instance, and calls the instance's detectAnomalies method. Method detectAnomalies does anomaly detection and returns anomaly points because job reports display only detected anomaly points.

Understanding TimeSeries/Anomaly format used in Sherlock

All current pipelines use TimeSeries and Anomaly classes defined in Egads heavily. To gain a better understanding of those formats, developers should read TimeSeries.java/Anomaly.java defined in the Egads repository.

Committers

Jigar Patel, [email protected]

Jeff Niu, [email protected]

Contributors

Josh Walters, [email protected]

Stephan Stiefel, Stephan3555

Han Xu, hanxu12

License

Code licensed under the GPL v3 License. See LICENSE file for terms.

sherlock's People

Contributors

hanxu12 avatar jigs1993 avatar jlleitschuh avatar mogball avatar quiet-listener avatar singhpk234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sherlock's Issues

Unknown option: --smtp-password

I downloaded the jar file from here -

When I pass stmp password int he cli I get the following error
Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: --smtp-password

Here is what my command look like.

java -Dlog4j.configuration=file:/home/ubuntu/sherlock/sherlock/src/main/resources/log4j.properties -jar sherlock-1.5 --version 1.5 --project-name "Metrics and Monitoring" --port 3000 --enable-email --failure-email "[email protected]" --from-mail "[email protected]" --reply-to "[email protected]" --smtp-host "smtp.outlook.office365.com" --smtp-port 587 --smtp-password "passowrd" --redis-host "127.0.0.1" --redis-port 6379 --egads-config-filename /home/ubuntu/sherlock/sherlock/src/main/resources/egads_config.ini

Abnormal percentage deviation

FYI I'm referring to : https://github.com/yahoo/sherlock/blob/master/src/main/java/com/yahoo/sherlock/model/AnomalyReport.java#L272

int percentageDeviation = (int) (((interval.actualVal - interval.expectedVal) / interval.expectedVal) * 100);

Whenever the interval.expectedVal = 0.0f then, no matter what is the value of interval.actualVal we always get
percentageDeviation = 2147483647; // max value that can fit in int(32-bit signed integer)

Is it the expected behaviour or do we need to handle this case ?

Error Generating Reports: java.lang.ArrayIndexOutOfBoundsException: 1

I've been using Sherlock for a few days, and it seems to be working fine for some time.
I'm generating hourly reports, and it works for a few hours. However, after a day or two, the reports start to fail, throwing a java.lang.ArrayIndexOutOfBoundsException: 1 error.

I've looked at the logs and this is the error log:

32893 [INFO ] 2018-09-30 12:30:01,105 com.yahoo.sherlock.store.redis.LettuceAnomalyReportAccessor - Getting anomaly reports for job [4] with frequency [hour]
32894 [ERROR] 2018-09-30 12:30:01,108 com.yahoo.sherlock.Routes - Error while viewing job report!
32895 java.lang.ArrayIndexOutOfBoundsException: 1
32896     at com.yahoo.sherlock.store.redis.LettuceAnomalyReportAccessor.decodeAndSetTimestamp(LettuceAnomalyReportAccessor.java:336)
32897     at com.yahoo.sherlock.store.redis.LettuceAnomalyReportAccessor.getAnomalyReports(LettuceAnomalyReportAccessor.java:311)
32898     at com.yahoo.sherlock.store.redis.LettuceAnomalyReportAccessor.getAnomalyReportsForJob(LettuceAnomalyReportAccessor.java:119)
32899     at com.yahoo.sherlock.Routes.viewJobReport(Routes.java:626)
32900     at spark.TemplateViewRouteImpl$1.handle(TemplateViewRouteImpl.java:66)
32901     at spark.http.matching.Routes.execute(Routes.java:61)
32902     at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:126)
32903     at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
32904     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
32905     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
32906     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
32907     at org.eclipse.jetty.server.Server.handle(Server.java:517)
32908     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
32909     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
32910     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
32911     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
32912     at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
32913     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
32914     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
32915     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
32916     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
32917     at java.lang.Thread.run(Thread.java:748)

I've looked at the redis logs and they are not showing any errors. I'm not sure how to fix it.
Any ideas what going on?

Run a job on defined endTime

Hello folks,

I am trying to run a job with Sherlock on event time data that implies that at run time I have not all the data. I therefore would like to run a daily job, which query druid until two days before the run time. But it does not seem to work. When I query druid by setting in my query "intervals": "ZonedDateTime.now().minusDays(18),ZonedDateTime.now().minusDays(2)" it seems that Sherlock still queries on the run time.

In Flash query, we have the possibility to change the end Time of the query in the UI. Something strange to me is that when I set in the query Druid: "intervals": "ZonedDateTime.now().minusDays(18),ZonedDateTime.now().minusDays(2)" and I change in the UI the end Date of the query and set a day different from ZonedDateTime.now().minusDays(2) , Sherlock will consider the endDate defined in the UI. Does that mean that Sherlock does not take into account the values set in the intervals of query Druid?

In the setting of the jobs, it is not possible to set the End Date (which is normal because this date will change every day) as in the Flash Query. But it seems that the end Date run each day for the job is actually Date.now() even if in my intervals of the query Druid, I have set ZonedDateTime.now().minusDays(2) which is what I need. Have you got any idea how I could run a job that returns an anomaly detection 2 days before the current date?

Thanks all for your help

log4j vulnerability

Hi, I saw sherlock demoed at the 2021 Druid conference and it really stoked my interest. I haven't used it yet because I noticed the log4j version is within the range of versions vulnerable to the JNDI lookup vulnerability that was discovered earlier this year(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228). I was curious: is the corresponding lookup feature currently disabled in sherlock and/or are there are plans to upgrade to log4j2.15 or later?
Thanks!

[Request] Release jar file

It will be great if users can directly download the jar file from tag release instead of compiling itself

Failed to collect dependencies at com.yahoo.egads:egads:jar:0.4.0

Tried to run the make file. Got an error like this:

C:...\sherlock>make jar
mvn clean checkstyle:check package
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.yahoo.sherlock:sherlock >---------------------
[INFO] Building sherlock 1.12-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from bintray-yahoo-maven: https://yahoo.bintray.com/maven/com/yahoo/egads/egads/0.4.0/egads-0.4.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.057 s
[INFO] Finished at: 2021-09-20T10:34:08+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sherlock: Could not resolve dependencies for project com.yahoo.sherlock:sherlock:jar:1.12-SNAPSHOT: Failed to collect dependencies at com.yahoo.egads:egads:jar:0.4.0: Failed to read artifact descriptor for com.yahoo.egads:egads:jar:0.4.0: Could not transfer artifact com.yahoo.egads:egads:pom:0.4.0 from/to bintray-yahoo-maven (https://yahoo.bintray.com/maven): authorization failed for https://yahoo.bintray.com/maven/com/yahoo/egads/egads/0.4.0/egads-0.4.0.pom, status: 403 Forbidden -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
make: *** [Makefile:7: jar] Error 1

any idea how to solve this?

my Apache Maven version is 3.8.2 (latest)

Training possible ?

Hi @ALL,

is it possible to train Sherlock/EGADS with data from the past to get better results in the future ?
I think I heard somethingh like that in a video, but I can't find any Howto or hint in the menus.

Thanks a lot !

Bye, Dirk

Error: Requested page not found. [404]

Hi,
I've been desperately trying to set up a job in Sherlock, but I keep getting a "Requested page not found. [404]" error when trying to get flash results like you can see in the following screenshot.
Screenshot from 2021-09-23 14-45-14
I get the following error in the logs of Sherlock

image

When requesting the series from Druid in the shell with the following command curl -X POST 'http://localhost:8082/druid/v2/?pretty' -H 'Content-Type:application/json' -H 'Accept:application/json' -d @query.json, I don't have any issues. I attached the result I get with my query in this TXT-file query_with_response.txt. What could possibly be the issue here?

Jobs goin to error

Hello guys;
I am new in Sherlock, I have got some issues with the installation, when I create a new job the job is going to error without further information. My druid is stand-alone server so I use broker port 8082 my server is debian 10/11 and my java is 11.0 but I install java 8 in order to see if that solve the problem.

Any idea about where is the mistake?
Regards and thanks in advance

[Security] Java (Maven): Use of insecure protocol to download/upload artifacts

Hi Security Team,

The build files indicate that this project is resolving dependencies over HTTP instead of HTTPS. Any of these artifacts could have been MITM to maliciously compromise them and infect the build artifacts that were produced. Additionally, if any of these JARs or other dependencies were compromised, any developers using these could continue to be infected past updating to fix this.

Description:

This attack leverages the build infrastructure loading dependencies over HTTP without any other sort of integrity check to allow them to be maliciously compromised.

POC code has existed since 2014 to maliciously compromise a JAR file inflight.
See:

https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/

https://github.com/mveytsman/dilettante

Source Location

https://github.com/yahoo/sherlock/blob/5d1bf481255eda73837a2f61f2b72e4d704c822a/pom.xml

    <repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>bintray-yahoo-maven</id>
            <name>bintray</name>
            <url>http://yahoo.bintray.com/maven</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>bintray-yahoo-maven</id>
            <name>bintray-plugins</name>
            <url>http://yahoo.bintray.com/maven</url>
        </pluginRepository>
    </pluginRepositories>

References :

  1. https://serverfault.com/a/153065
  2. https://security.stackexchange.com/a/12050
  3. https://thenextweb.com/insights/2017/12/11/comcast-continues-to-inject-its-own-code-into-websites-you-visit/#
  4. https://medium.com/bugbountywriteup/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb
  5. github/codeql#2413
  6. GHSA-rcj2-vvjx-87pm
  7. GHSA-jwqm-c9f2-2cq3

This vulnerability has a CVSS v3.0 Base Score of 8.1/10

https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

unable to build jar

Hi,

Thanks for this amazing library. I was trying to build this. got following error. Please help me to resolve this. Also after build. what command should run to get the UI as you showed in the Demo.

Error: Could not resolve dependencies for project com.yahoo.sherlock:sherlock:jar:1.7-SNAPSHOT: Could not find artifact com.sun:tools:jar:0 at specified path /Library/Java/JavaVirtualMachines/openjdk-13.0.1.jdk/Contents/Home/../lib/tools.jar

FlashQuery is not returning any results

Hello, I am trying to experiment with this utility to see if it helps some of our use cases and having trouble running a Timeseries query, i am able to run the Timeseries query against my druid instance using post man, however when i run the same query in flash query UI, i get zero results back. Any help is appreciated in this regard.
Attached is the JSON req and resp used in postman.
SharlockQuestion.txt
Parameters on Falsh Query Screen:
Sherlock_localhost

I am using Druid version 0.17.0

[Request] Update to jdk8u181

When compiling with the latest jdk8 version, making jar will fail with following error:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:54 min
[INFO] Finished at: 2018-11-30T10:42:36+00:00
[INFO] Final Memory: 43M/615M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project sherlock: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /sherlock && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=/sherlock/target/jacoco.exec -jar /sherlock/target/surefire/surefirebooter6254102860528815040.jar /sherlock/target/surefire/surefire345989798278468220tmp /sherlock/target/surefire/surefire_02363878781743491197tmp
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Makefile:7: recipe for target 'jar' failed
make: *** [jar] Error 1`

That is a known issue fixed already by Surefire in 3.0.0-M1
See furthermore: https://issues.apache.org/jira/browse/SUREFIRE-1588

Workaround for users at the moment:

  • use at least jdk8u118
  • use command: make jar-no-test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.