Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-1665 Host UIs on Spring Boot and add SSO authentication #1111

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
90b75c2
Add base projects for Hosting UIs in Spring
simonellistonball Jul 19, 2018
8443329
Packaging changes for the UIs
simonellistonball Jul 19, 2018
627d37c
Integrate SSO base to metron-rest and added test config
simonellistonball Jul 19, 2018
8247636
Clean up assembly build process based on new packaging of uis
simonellistonball Jul 19, 2018
bb83e0b
Fixed security test for UI settings
simonellistonball Jul 19, 2018
dd6f3fb
Added hosting applications for UIs
simonellistonball Jul 19, 2018
278f9cb
Removed nodejs from rpm build process
simonellistonball Jul 12, 2018
c2fde46
RPM changes for new hosting method
simonellistonball Jul 19, 2018
09a40b7
Package hosted versions in RPM
simonellistonball Jul 23, 2018
12b1b23
Simplified Zuul Error handling
simonellistonball Jul 23, 2018
1c1318c
Fixes for logout endpoint
simonellistonball Jul 30, 2018
923593d
Made PID_FOLDER explicit to avoid bug in spring boot launch
simonellistonball Jul 30, 2018
b0f1edd
Fixed redirect on Logout
simonellistonball Jul 30, 2018
b27a626
Added ability to handle expires and not before claims in JWT
simonellistonball Jul 31, 2018
499b581
Fix to the logout url generation
simonellistonball Jul 31, 2018
baacc24
Fixed redirect method
simonellistonball Jul 31, 2018
6400a50
Cleaned up imports
simonellistonball Jul 31, 2018
8e30074
Fixed redirect URL for Logout
simonellistonball Aug 1, 2018
9cff19f
Disable CSRF
simonellistonball Aug 2, 2018
5bb386a
initial commit
merrimanr Aug 22, 2018
a92488e
Removed accidental pom addition
simonellistonball Aug 23, 2018
d7f0ba5
Merge branch 'METRON-1665' of https://github.com/simonellistonball/me…
simonellistonball Aug 28, 2018
a3b43b0
Fixed whitespace
simonellistonball Aug 28, 2018
dcd9934
Pushed up spring boot version properties to interface pom
simonellistonball Aug 28, 2018
0a92343
Metron REST docs changes for new authentication method
simonellistonball Aug 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -23,3 +23,9 @@ temp/**
temp/**/*
metron-interface/metron-alerts/node/
repodata/

# Ignores for eclipse IDE
.springBeans
.factorypath
.vscode
.pydevproject
48 changes: 48 additions & 0 deletions dependencies_with_url.csv
Expand Up @@ -421,3 +421,51 @@ com.google.code.gson:gson:jar:2.8.2:compile,ASLv2,https://github.com/google/gson
com.zaxxer:HikariCP:jar:2.7.8:compile,ASLv2,https://github.com/brettwooldridge/HikariCP
org.hibernate.validator:hibernate-validator:jar:6.0.9.Final:compile,ASLv2,https://github.com/hibernate/hibernate-validator

com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile,ASLv2,http://stephenc.github.io/jcip-annotations/
com.google.guava:guava:jar:15.0:compile,ASLv2,
com.netflix.archaius:archaius-core:jar:0.7.6:compile,ASLv2,https://github.com/Netflix/archaius
com.netflix.hystrix:hystrix-core:jar:1.5.12:compile,ASLv2,https://github.com/Netflix/Hystrix
com.netflix.hystrix:hystrix-javanica:jar:1.5.12:compile,ASLv2,https://github.com/Netflix/Hystrix
com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.5.12:compile,ASLv2,https://github.com/Netflix/Hystrix
com.netflix.hystrix:hystrix-serialization:jar:1.5.12:compile,ASLv2,https://github.com/Netflix/Hystrix
com.netflix.netflix-commons:netflix-commons-util:jar:0.3.0:compile
com.netflix.ribbon:ribbon-core:jar:2.2.5:compile,ASLv2,https://github.com/Netflix/ribbon
com.netflix.ribbon:ribbon-httpclient:jar:2.2.5:compile,ASLv2,https://github.com/Netflix/ribbon
com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.5:compile,ASLv2,https://github.com/Netflix/ribbon
com.netflix.ribbon:ribbon:jar:2.2.5:compile,ASLv2,https://github.com/Netflix/ribbon
com.netflix.zuul:zuul-core:jar:1.3.1:compile,ASLv2,https://github.com/Netflix/zuul
com.nimbusds:nimbus-jose-jwt:jar:4.41.2:compile,ASLv2,https://connect2id.com/products/nimbus-jose-jwt
commons-configuration:commons-configuration:jar:1.8:compile,ASLv2,http://commons.apache.org/
commons-lang:commons-lang:jar:2.3:compile,ASLv2,http://commons.apache.org/
io.micrometer:micrometer-core:jar:1.0.3:compile,ASLv2,http://micrometer.io/
io.reactivex:rxjava-reactive-streams:jar:1.2.1:compile,ASLv2,http://reactivex.io/
io.reactivex:rxjava:jar:1.2.0:compile,ASLv2,http://reactivex.io/
io.undertow:undertow-core:jar:1.4.23.Final:compile,ASLv2,http://undertow.io/
io.undertow:undertow-servlet:jar:1.4.23.Final:compile,ASLv2,http://undertow.io/
io.undertow:undertow-websockets-jsr:jar:1.4.23.Final:compile,ASLv2,http://undertow.io/
org.bouncycastle:bcpkix-jdk15on:jar:1.56:compile,MIT,https://www.bouncycastle.org/
org.bouncycastle:bcprov-jdk15on:jar:1.56:compile,MIT,https://www.bouncycastle.org/
org.glassfish:javax.el:jar:3.0.0:compile,Common Development and Distribution License (CDDL) v1.0
org.hdrhistogram:HdrHistogram:jar:2.1.10:compile,BSD 2-clause,http://hdrhistogram.org/
org.jboss.xnio:xnio-api:jar:3.3.8.Final:compile,ASLv2,http://xnio.jboss.org/
org.latencyutils:LatencyUtils:jar:2.0.3:compile,BSD 2-clause,http://latencyutils.org/
org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.1.RELEASE:compile,ASLv2,https://spring.io/projects/spring-boot
org.springframework.boot:spring-boot-actuator:jar:2.0.1.RELEASE:compile,ASLv2,https://spring.io/projects/spring-boot
org.springframework.boot:spring-boot-starter-actuator:jar:2.0.1.RELEASE:compile,ASLv2,https://spring.io/projects/spring-boot
org.springframework.boot:spring-boot-starter-undertow:jar:2.0.1.RELEASE:compile,ASLv2,https://spring.io/projects/spring-boot
org.springframework.cloud:spring-cloud-commons:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-context:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-netflix-archaius:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-netflix-core:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-netflix-ribbon:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-netflix-zuul:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-starter-netflix-archaius:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-starter-netflix-hystrix:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-starter-netflix-ribbon:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-starter-netflix-zuul:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.cloud:spring-cloud-starter:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
org.springframework.ldap:spring-ldap-core:jar:2.3.2.RELEASE:compile,ASLv2,https://spring.io/projects/spring-ldap
org.springframework.security:spring-security-crypto:jar:5.0.4.RELEASE:compile,ASLv2,https://spring.io/projects/spring-security
org.springframework.security:spring-security-ldap:jar:5.0.4.RELEASE:compile,ASLv2,https://spring.io/projects/spring-security
org.springframework.security:spring-security-rsa:jar:1.0.5.RELEASE:compile,ASLv2,https://spring.io/projects/spring-security
org.springframework.cloud:spring-cloud-commons:jar:2.0.0.RELEASE:compile,ASLv2,http://projects.spring.io/spring-cloud/
2 changes: 0 additions & 2 deletions metron-deployment/packaging/ambari/metron-mpack/README.md
Expand Up @@ -26,8 +26,6 @@ This allows you to easily install Metron using a simple, guided process. This a

* Installable Metron packages (either RPMs or DEBs) located in a repository on each host at `/localrepo`.

* A [Node.js](https://nodejs.org/en/download/package-manager/) repository installed on the host running the Management and Alarm UI.

### Quick Start

1. Build the Metron MPack. Execute the following command from the project's root directory.
Expand Down
Expand Up @@ -421,9 +421,6 @@
<package>
<name>metron-rest</name>
</package>
<package>
<name>nodejs</name>
</package>
<package>
<name>metron-config</name>
</package>
Expand Down
3 changes: 0 additions & 3 deletions metron-deployment/packaging/docker/ansible-docker/Dockerfile
Expand Up @@ -58,8 +58,5 @@ RUN yum -y install asciidoc rpm-build rpm2cpio tar unzip xmlto zip rpmlint make
# create a .bashrc for root, enabling the cpp 11 toolset
RUN touch /root/.bashrc \
&& cat '/opt/rh/devtoolset-4/enable' >> /root/.bashrc
# install node so that the node dependencies can be packaged into the RPMs
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
RUN yum -y install nodejs
WORKDIR /root

4 changes: 0 additions & 4 deletions metron-deployment/packaging/docker/deb-docker/Dockerfile
Expand Up @@ -26,8 +26,4 @@ RUN apt-get update && apt-get install -y \
dpkg-dev \
gettext

# install nodejs so that the node dependencies can be packaged into the DEBs
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN apt-get install -y nodejs

WORKDIR /root
Expand Up @@ -27,6 +27,3 @@
# the working directory containing all of the files to
# be packaged will be passed as the only argument to this script.
#

# package the 'production' node dependencies
npm install --prefix="${PACKAGE_WORKDIR}/${METRON_HOME}/web/expressjs" --only=production
4 changes: 0 additions & 4 deletions metron-deployment/packaging/docker/rpm-docker/Dockerfile
Expand Up @@ -27,7 +27,3 @@ RUN mv apache-maven-3.2.5 /opt/maven
RUN ln -s /opt/maven/bin/mvn /usr/bin/mvn
RUN yum -y install asciidoc rpm-build rpm2cpio tar unzip xmlto zip rpmlint && yum clean all
WORKDIR /root

# install node so that the node dependencies can be packaged into the RPMs
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
RUN yum -y install gcc-c++ make nodejs
97 changes: 19 additions & 78 deletions metron-deployment/packaging/docker/rpm-docker/SPECS/metron.spec
Expand Up @@ -53,10 +53,10 @@ Source6: metron-indexing-%{full_version}-archive.tar.gz
Source7: metron-pcap-backend-%{full_version}-archive.tar.gz
Source8: metron-profiler-%{full_version}-archive.tar.gz
Source9: metron-rest-%{full_version}-archive.tar.gz
Source10: metron-config-%{full_version}-archive.tar.gz
Source10: metron-config-host-%{full_version}-archive.tar.gz
Source11: metron-management-%{full_version}-archive.tar.gz
Source12: metron-maas-service-%{full_version}-archive.tar.gz
Source13: metron-alerts-%{full_version}-archive.tar.gz
Source13: metron-alerts-host-%{full_version}-archive.tar.gz
Source14: metron-performance-%{full_version}-archive.tar.gz

%description
Expand All @@ -77,7 +77,11 @@ rm -rf %{_builddir}/*
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{metron_home}
mkdir -p %{buildroot}/etc/init.d

# make PID locations for metron uis
mkdir -p %{buildroot}/var/run/metron-alerts
mkdir -p %{buildroot}/var/run/metron-config
mkdir -p %{buildroot}/var/run/metron-rest

# copy source files and untar
tar -xzf %{SOURCE0} -C %{buildroot}%{metron_home}
Expand All @@ -96,12 +100,6 @@ tar -xzf %{SOURCE12} -C %{buildroot}%{metron_home}
tar -xzf %{SOURCE13} -C %{buildroot}%{metron_home}
tar -xzf %{SOURCE14} -C %{buildroot}%{metron_home}

install %{buildroot}%{metron_home}/bin/metron-management-ui %{buildroot}/etc/init.d/
install %{buildroot}%{metron_home}/bin/metron-alerts-ui %{buildroot}/etc/init.d/

# allows node dependencies to be packaged in the RPMs
npm install --prefix="%{buildroot}%{metron_home}/web/expressjs" --only=production

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

%package common
Expand Down Expand Up @@ -435,41 +433,12 @@ This package installs the Metron Management UI %{metron_home}
%defattr(-,root,root,755)
%dir %{metron_root}
%dir %{metron_home}
%dir %{metron_home}/config
%dir %{metron_home}/bin
%dir %{metron_home}/web
%dir %{metron_home}/web/expressjs
%dir %{metron_home}/web/expressjs/node_modules
%dir %{metron_home}/web/expressjs/node_modules/.bin
%dir %{metron_home}/web/management-ui
%dir %{metron_home}/web/management-ui/assets
%dir %{metron_home}/web/management-ui/assets/ace
%dir %{metron_home}/web/management-ui/assets/ace/snippets
%dir %{metron_home}/web/management-ui/assets/fonts
%dir %{metron_home}/web/management-ui/assets/fonts/Roboto
%dir %{metron_home}/web/management-ui/assets/images
%dir %{metron_home}/web/management-ui/license
%{metron_home}/bin/metron-management-ui
/etc/init.d/metron-management-ui
%attr(0755,root,root) %{metron_home}/web/expressjs/node_modules/*
%attr(0755,root,root) %{metron_home}/web/expressjs/node_modules/.bin/*
%attr(0755,root,root) %{metron_home}/web/expressjs/server.js
%attr(0644,root,root) %{metron_home}/web/expressjs/package.json
%attr(0644,root,root) %{metron_home}/web/management-ui/favicon.ico
%attr(0644,root,root) %{metron_home}/web/management-ui/index.html
%attr(0644,root,root) %{metron_home}/web/management-ui/*.js
%attr(0644,root,root) %{metron_home}/web/management-ui/*.js.gz
%attr(0644,root,root) %{metron_home}/web/management-ui/*.ttf
%attr(0644,root,root) %{metron_home}/web/management-ui/*.svg
%attr(0644,root,root) %{metron_home}/web/management-ui/*.eot
%attr(0644,root,root) %{metron_home}/web/management-ui/*.woff
%attr(0644,root,root) %{metron_home}/web/management-ui/*.woff2
%attr(0644,root,root) %{metron_home}/web/management-ui/assets/ace/*.js
%attr(0644,root,root) %{metron_home}/web/management-ui/assets/ace/LICENSE
%attr(0644,root,root) %{metron_home}/web/management-ui/assets/ace/snippets/*.js
%attr(0644,root,root) %{metron_home}/web/management-ui/assets/fonts/Roboto/LICENSE.txt
%attr(0644,root,root) %{metron_home}/web/management-ui/assets/fonts/Roboto/*.ttf
%attr(0644,root,root) %{metron_home}/web/management-ui/assets/images/*
%attr(0644,root,root) %{metron_home}/web/management-ui/license/*
%dir %{metron_home}/lib
%attr(0755,root,root) %{metron_home}/lib/metron-config-host-%{full_version}.jar
%attr(0755,root,root) %{metron_home}/bin/metron-config.sh


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -504,46 +473,18 @@ This package installs the Metron Alerts UI %{metron_home}
%defattr(-,root,root,755)
%dir %{metron_root}
%dir %{metron_home}
%dir %{metron_home}/config
%dir %{metron_home}/bin
%dir %{metron_home}/web
%dir %{metron_home}/web/alerts-ui
%dir %{metron_home}/web/alerts-ui/assets
%dir %{metron_home}/web/alerts-ui/assets/ace
%dir %{metron_home}/web/alerts-ui/assets/fonts
%dir %{metron_home}/web/alerts-ui/assets/fonts/Roboto
%dir %{metron_home}/web/alerts-ui/assets/images
%{metron_home}/bin/metron-alerts-ui
/etc/init.d/metron-alerts-ui
%attr(0755,root,root) %{metron_home}/web/expressjs/alerts-server.js
%attr(0644,root,root) %{metron_home}/web/alerts-ui/favicon.ico
%attr(0644,root,root) %{metron_home}/web/alerts-ui/index.html
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.bundle.css
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.js
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.ttf
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.svg
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.jpg
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.eot
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.woff
%attr(0644,root,root) %{metron_home}/web/alerts-ui/*.woff2
%attr(0644,root,root) %{metron_home}/web/alerts-ui/3rdpartylicenses.txt
%attr(0644,root,root) %{metron_home}/web/alerts-ui/assets/ace/*.js
%attr(0644,root,root) %{metron_home}/web/alerts-ui/assets/ace/LICENSE
%attr(0644,root,root) %{metron_home}/web/alerts-ui/assets/fonts/font.css
%attr(0644,root,root) %{metron_home}/web/alerts-ui/assets/fonts/Roboto/LICENSE.txt
%attr(0644,root,root) %{metron_home}/web/alerts-ui/assets/fonts/Roboto/*.ttf
%attr(0644,root,root) %{metron_home}/web/alerts-ui/assets/images/*

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%dir %{metron_home}/lib
%attr(0755,root,root) %{metron_home}/lib/metron-alerts-host-%{full_version}.jar
%attr(0755,root,root) %{metron_home}/bin/metron-alerts.sh

%post config
chkconfig --add metron-management-ui
chkconfig --add metron-alerts-ui

%preun config
chkconfig --del metron-management-ui
chkconfig --del metron-alerts-ui
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

%changelog
* Thu Jul 19 2018 Apache Metron <dev@metron.apache.org> - 0.5.1
- Added new UI hosting methods
* Thu Feb 1 2018 Apache Metron <dev@metron.apache.org> - 0.4.3
- Add Solr install script to Solr RPM
* Tue Sep 25 2017 Apache Metron <dev@metron.apache.org> - 0.4.2
Expand Down
4 changes: 2 additions & 2 deletions metron-deployment/packaging/docker/rpm-docker/pom.xml
Expand Up @@ -174,7 +174,7 @@
</includes>
</resource>
<resource>
<directory>${metron_dir}/metron-interface/metron-config/target/</directory>
<directory>${metron_dir}/metron-interface/metron-config-host/target/</directory>
<includes>
<include>*.tar.gz</include>
</includes>
Expand All @@ -186,7 +186,7 @@
</includes>
</resource>
<resource>
<directory>${metron_dir}/metron-interface/metron-alerts/target/</directory>
<directory>${metron_dir}/metron-interface/metron-alerts-host/target/</directory>
<includes>
<include>*.tar.gz</include>
</includes>
Expand Down
24 changes: 24 additions & 0 deletions metron-interface/metron-alerts-host/.gitignore
@@ -0,0 +1,24 @@
/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/