diff --git a/doc/conf.py b/doc/conf.py index e19990c26..a8818ec15 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -59,9 +59,9 @@ # built documents. # # The short X.Y version. -version = u'2.4.4' +version = u'2.4.5' # The full version, including alpha/beta/rc tags. -release = u'2.4.4-1' +release = u'2.4.5-1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/hubblestack/__init__.py b/hubblestack/__init__.py index 0d6ef5fbd..25cb3b498 100644 --- a/hubblestack/__init__.py +++ b/hubblestack/__init__.py @@ -1 +1 @@ -__version__ = '2.4.4' +__version__ = '2.4.5' diff --git a/hubblestack/hangtime/__init__.py b/hubblestack/hangtime/__init__.py new file mode 100644 index 000000000..064dbd557 --- /dev/null +++ b/hubblestack/hangtime/__init__.py @@ -0,0 +1,11 @@ +try: + import signal + + # windows (et al?) has no concept of signal.SIGALRM force the issue here + # and, if applicable, load a fake timer wrapper + + assert signal.SIGALRM > 0 + from linux_itimers import HangTime, hangtime_wrapper + +except: + from fake import HangTime, hangtime_wrapper diff --git a/hubblestack/hangtime/fake.py b/hubblestack/hangtime/fake.py new file mode 100644 index 000000000..f5b7c332b --- /dev/null +++ b/hubblestack/hangtime/fake.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +''' +Defanged fake timer setup that pretends to do all the things HangTime would do +(by arguments); but actually does nothing at all. + +The decorator in particular doesn't even attempt to load the HangTime wrapper +around code. +''' + +class HangTime(object): + def __init__(self, msg="hang timeout detected", timeout=300, tag=None, repeats=False, decay=1.0): + pass + + def __repr__(self): + return "FakeHT({:0.2f}s, tag={})".format(self.timeout, self.tag) + + def restore(self, ended=False): + pass + + def fire_timer(self, *sig_param): + pass + + def __enter__(self): + return self + + def __exit__(self, e_type, e_obj, e_tb): + pass + + +def hangtime_wrapper(**ht_kw): + def _decorator(actual): + return actual + return _decorator diff --git a/hubblestack/hangtime.py b/hubblestack/hangtime/linux_itimers.py similarity index 100% rename from hubblestack/hangtime.py rename to hubblestack/hangtime/linux_itimers.py diff --git a/pkg/amazonlinux2016.09/Dockerfile b/pkg/amazonlinux2016.09/Dockerfile index a27444431..c8fc89d0d 100644 --- a/pkg/amazonlinux2016.09/Dockerfile +++ b/pkg/amazonlinux2016.09/Dockerfile @@ -125,8 +125,8 @@ RUN yum install -y ruby ruby-devel rpmbuild rpm-build rubygems gcc make \ #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git ENV HUBBLE_SRC_PATH=/hubble_src diff --git a/pkg/centos6/Dockerfile b/pkg/centos6/Dockerfile index 292f1cd36..1e5dc4b8a 100644 --- a/pkg/centos6/Dockerfile +++ b/pkg/centos6/Dockerfile @@ -127,8 +127,8 @@ RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \ #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git ENV HUBBLE_SRC_PATH=/hubble_src diff --git a/pkg/centos7/Dockerfile b/pkg/centos7/Dockerfile index a9a3f66c3..1f06863f4 100644 --- a/pkg/centos7/Dockerfile +++ b/pkg/centos7/Dockerfile @@ -124,8 +124,8 @@ RUN yum install -y ruby ruby-devel rpmbuild rpm-build rubygems gcc make \ #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git ENV HUBBLE_SRC_PATH=/hubble_src diff --git a/pkg/coreos/Dockerfile b/pkg/coreos/Dockerfile index 807133761..6a29b258e 100644 --- a/pkg/coreos/Dockerfile +++ b/pkg/coreos/Dockerfile @@ -136,9 +136,9 @@ RUN pip -v install -r pyinstaller-requirements.txt #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/debian7/Dockerfile b/pkg/debian7/Dockerfile index 5941b4a96..430287931 100644 --- a/pkg/debian7/Dockerfile +++ b/pkg/debian7/Dockerfile @@ -163,9 +163,9 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \ #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/debian8/Dockerfile b/pkg/debian8/Dockerfile index 463b59265..61d40f7f1 100644 --- a/pkg/debian8/Dockerfile +++ b/pkg/debian8/Dockerfile @@ -145,9 +145,9 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \ #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/debian9/Dockerfile b/pkg/debian9/Dockerfile index beb27c25f..2a6fc6f9e 100644 --- a/pkg/debian9/Dockerfile +++ b/pkg/debian9/Dockerfile @@ -140,9 +140,9 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \ #pyinstaller start #commands specified for ENTRYPOINT and CMD are executed when the container is run, not when the image is built #use the following variables to choose the version of hubble -ENV HUBBLE_CHECKOUT=v2.4.4 +ENV HUBBLE_CHECKOUT=v2.4.5 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4 +ENV HUBBLE_VERSION=2.4.5 ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/amazonlinux2016.09/Dockerfile b/pkg/dev/amazonlinux2016.09/Dockerfile index 487998834..1581dd37d 100644 --- a/pkg/dev/amazonlinux2016.09/Dockerfile +++ b/pkg/dev/amazonlinux2016.09/Dockerfile @@ -128,7 +128,7 @@ RUN yum install -y ruby ruby-devel rpmbuild rpm-build rubygems gcc make \ #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/centos6/Dockerfile b/pkg/dev/centos6/Dockerfile index 6c58382d3..ea3b7ed04 100644 --- a/pkg/dev/centos6/Dockerfile +++ b/pkg/dev/centos6/Dockerfile @@ -130,7 +130,7 @@ RUN yum install -y rpmbuild rpm-build gcc make rh-ruby23 rh-ruby23-ruby-devel \ #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/centos7/Dockerfile b/pkg/dev/centos7/Dockerfile index 04d67226a..1db47db30 100644 --- a/pkg/dev/centos7/Dockerfile +++ b/pkg/dev/centos7/Dockerfile @@ -127,7 +127,7 @@ RUN yum install -y ruby ruby-devel rpmbuild rpm-build rubygems gcc make \ #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/coreos/Dockerfile b/pkg/dev/coreos/Dockerfile index 1e9852548..37f6c1fc7 100644 --- a/pkg/dev/coreos/Dockerfile +++ b/pkg/dev/coreos/Dockerfile @@ -139,7 +139,7 @@ RUN pip -v install -r pyinstaller-requirements.txt #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/debian7/Dockerfile b/pkg/dev/debian7/Dockerfile index 290b2e2c2..49cca71fc 100644 --- a/pkg/dev/debian7/Dockerfile +++ b/pkg/dev/debian7/Dockerfile @@ -166,7 +166,7 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \ #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/debian8/Dockerfile b/pkg/dev/debian8/Dockerfile index 63d947395..b4648dd34 100644 --- a/pkg/dev/debian8/Dockerfile +++ b/pkg/dev/debian8/Dockerfile @@ -148,7 +148,7 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \ #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/dev/debian9/Dockerfile b/pkg/dev/debian9/Dockerfile index 47f2cd1a5..c4c87de8b 100644 --- a/pkg/dev/debian9/Dockerfile +++ b/pkg/dev/debian9/Dockerfile @@ -143,7 +143,7 @@ RUN apt-get install -y ruby ruby-dev rubygems gcc make \ #use the following variables to choose the version of hubble ARG HUBBLE_CHECKOUT=develop ARG HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git -ENV HUBBLE_VERSION=2.4.4_develop +ENV HUBBLE_VERSION=2.4.5_develop ENV HUBBLE_ITERATION=1 ENV HUBBLE_SRC_PATH=/hubble_src ENV _HOOK_DIR="./pkg/" diff --git a/pkg/windows/dockerfile b/pkg/windows/dockerfile index 02d95c618..741239108 100644 --- a/pkg/windows/dockerfile +++ b/pkg/windows/dockerfile @@ -3,8 +3,10 @@ # To build an image: 1. copy pkg/windows/pyinstaller-requirements.txt & to directory with this Dockerfile # 2. docker build -t . # The resulting image is ready to run the pyinstaller on container start and drop hubble.exe -# in a local directory. Mount /data volume into a directory on the host to access the package. -# To run the container: docker run -it --rm -v :c:\data +# in a local directory. Mount c:\data volume into a directory on the host to access the package. +# To run the container: +# 3. Copy over any other items you want to include with hubble and place them in /opt +# 4. docker run -it --rm -v :c:\data #build docker image from windowscore FROM microsoft/windowsservercore #Needed to just work @@ -13,9 +15,9 @@ ENV CHOCO_URL=https://chocolatey.org/install.ps1 #All the variables used for salt ENV SALT_SRC_PATH='C:/temp/salt/' ENV SALT_GIT_URL=https://github.com/saltstack/salt -ENV SALT_CHECKOUT=v2018.3.0 +ENV SALT_CHECKOUT=v2018.11 #All the variables used for hubble -ENV HUBBLE_CHECKOUT=v2.2.4-2 +ENV HUBBLE_CHECKOUT=v2.4.5 ENV HUBBLE_GIT_URL=https://github.com/hubblestack/hubble.git ENV HUBBLE_SRC_PATH='C:/temp/hubble/' ENV _HOOK_DIR='./pkg/' @@ -54,7 +56,7 @@ RUN powershell.exe -Command pip install -r pyinstaller-requirements.txt; #Move portable git to a new location RUN powershell.exe -Command New-Item C:/temp/hubble/PortableGit -ItemType Directory; \ - Copy-Item -Path C:/tools/git -Destination C:/temp/hubble/PortableGit -Recurse; + Copy-Item -Path C:/tools/git/* -Destination C:/temp/hubble/PortableGit/ -Recurse; # Modify gitfs fix for incorrect path variables until fix has been upstreamed RUN powershell.exe -Command If (!(Test-Path C:/Python27/Lib/site-packages/salt)) {Copy-Item C:/temp/salt/salt -Destination C:/Python27/Lib/site-packages/ -Recurse -Force}; \ @@ -78,8 +80,13 @@ CMD powershell.exe -Command Push-Location C:/temp/hubble; \ Move-Item hubble.conf -Destination ./hubble/dist/hubble/etc/hubble/; \ Move-Item 'hubble/PortableGit' -Destination './hubble/dist/hubble/' -Force; \ Move-Item 'C:/ProgramData/chocolatey/lib/NSSM/tools/nssm.exe' -Destination './hubble/dist/hubble/' -Force; \ - Move-Item 'C:/ProgramData/osquery/osqueryi.exe' -Destination './hubble/pkg/' -Force; \ + Move-Item 'C:/ProgramData/osquery/osqueryi.exe' -Destination './hubble/dist/hubble/' -Force; \ + If (Test-Path C:/data/hubble.conf) {Copy-Item C:/data/hubble.conf -Destination ./hubble/dist/hubble/etc/hubble/ -Force}; \ + If (Test-Path C:/data/opt) {Copy-Item C:/data/opt -Destination './hubble/dist/hubble/' -Recurse -Force}; \ #Build the installer Push-Location 'C:/Program Files (x86)/NSIS'; \ ./makensis.exe /DHubbleVersion="$env:HUBBLE_CHECKOUT" 'C:/temp/hubble/pkg/windows/hubble-Setup.nsi'; \ - Copy-Item C:/temp/hubble/pkg/windows/Hubble*exe -Destination C:/data/ \ No newline at end of file + Get-FileHash -Path C:/temp/hubble/pkg/windows/Hubble*exe -Algorithm SHA256 ^| Out-File C:/temp/hubble/pkg/windows/hubble_windows.sha256; \ + Copy-Item C:/temp/hubble/pkg/windows/Hubble*exe -Destination C:/data/; \ + Copy-Item C:/temp/hubble/pkg/windows/hubble_windows.sha256 -Destination C:/data/; +