Skip to content

Commit

Permalink
Merge pull request #15 from VultureProject/dev
Browse files Browse the repository at this point in the history
Release 1.771
  • Loading branch information
KGuillemot authored Dec 3, 2020
2 parents 749b845 + 8e8dd9a commit 1122812
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crontab/vlt-sys/dump_mongodb_vulture.hour
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if mongod_status; then

DATE=`/bin/date +%Y-%m-%d_%H-%M`

/usr/local/bin/mongodump --gzip --db vulture --archive=/var/db/mongodb_dumps/vulture_dump_$DATE.archive --excludeCollection=monitor --ssl --sslPEMKeyFile /var/db/mongodb/mongod.pem --sslCAFile /var/db/mongodb/ca.pem --host $hostname --port 9091
/usr/local/bin/mongodump --gzip --db vulture --archive=/var/db/mongodb_dumps/vulture_dump_$DATE.archive --excludeCollection=monitor --ssl --sslPEMKeyFile /var/db/mongodb/mongod.pem --sslCAFile /var/db/mongodb/ca.pem --host $(hostname) --port 9091

if [ "$?" -ne 0 ]; then
echo "Something went wrong during mongodump."
Expand Down
2 changes: 1 addition & 1 deletion gui/models/modlog_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_format(self):
if isinstance(repo, MongoDBRepository):
return "@cee:{\\\"app_name\\\":\\\"%{app_name}e\\\",\\\"src_ip\\\":\\\"%a\\\",\\\"user\\\":\\\"%u\\\",\\\"time\\\":\\\"%{%Y-%m-%dT%H:%M:%S:%Z}t\\\",\\\"http_method\\\":\\\"%m\\\",\\\"requested_uri\\\":\\\"%U%q\\\",\\\"http_code\\\":%>s,\\\"incoming_protocol\\\":\\\"%H\\\",\\\"referer\\\":\\\"%{Referer}i\\\",\\\"user_agent\\\":\\\"%{User-agent}i\\\",\\\"size\\\":%B,\\\"bytes_received\\\":%I,\\\"bytes_sent\\\":%O,\\\"time_elapsed\\\":%D,\\\"country\\\":\\\"%{COUNTRY_CODE}e\\\",\\\"city\\\":\\\"%{CITY}e\\\",\\\"lat\\\":\\\"%{LATITUDE}e\\\",\\\"lon\\\":\\\"%{LONGITUDE}e\\\",\\\"reputation\\\":\\\"%{REPUTATION0}e,%{REPUTATION1}e,%{REPUTATION2}e,%{REPUTATION3}e,%{REPUTATION4}e\\\",\\\"owasp_top10\\\":\\\"%{owasp_top10}e\\\",\\\"reasons\\\":\\\"%{reasons}e\\\",\\\"threshold\\\":\\\"%{threshold}e\\\",\\\"score\\\":\\\"%{score}e\\\",\\\"authentication\\\":\\\"%{X-Authentication}n\\\",\\\"authentication_result\\\":\\\"%{X-Authentication-Result}n\\\"}"
elif isinstance(repo, ElasticSearchRepository):
return "@cee:{\\\"app_name\\\":\\\"%{app_name}e\\\",\\\"src_ip\\\":\\\"%a\\\",\\\"user\\\":\\\"%u\\\",\\\"time\\\":\\\"%{%Y-%m-%dT%H:%M:%S%z}t\\\",\\\"http_method\\\":\\\"%m\\\",\\\"requested_uri\\\":\\\"%U%q\\\",\\\"http_code\\\":%>s,\\\"incoming_protocol\\\":\\\"%H\\\",\\\"referer\\\":\\\"%{Referer}i\\\",\\\"user_agent\\\":\\\"%{User-agent}i\\\",\\\"size\\\":%B,\\\"bytes_received\\\":%I,\\\"bytes_sent\\\":%O,\\\"time_elapsed\\\":%D,\\\"country\\\":\\\"%{COUNTRY_CODE}e\\\",\\\"city\\\":\\\"%{CITY}e\\\",\\\"lat\\\":\\\"%{LATITUDE}e\\\",\\\"lon\\\":\\\"%{LONGITUDE}e\\\",\\\"reputation\\\":\\\"%{REPUTATION0}e,%{REPUTATION1}e,%{REPUTATION2}e,%{REPUTATION3}e,%{REPUTATION4}e\\\",\\\"owasp_top10\\\":\\\"%{owasp_top10}e\\\",\\\"reasons\\\":\\\"%{reasons}e\\\",\\\"threshold\\\":\\\"%{threshold}e\\\",\\\"score\\\":\\\"%{score}e\\\"}\\\"authentication\\\":\\\"%{X-Authentication}n\\\",\\\"authentication_result\\\":\\\"%{X-Authentication-Result}n\\\"}"
return "@cee:{\\\"app_name\\\":\\\"%{app_name}e\\\",\\\"src_ip\\\":\\\"%a\\\",\\\"user\\\":\\\"%u\\\",\\\"time\\\":\\\"%{%Y-%m-%dT%H:%M:%S%z}t\\\",\\\"http_method\\\":\\\"%m\\\",\\\"requested_uri\\\":\\\"%U%q\\\",\\\"http_code\\\":%>s,\\\"incoming_protocol\\\":\\\"%H\\\",\\\"referer\\\":\\\"%{Referer}i\\\",\\\"user_agent\\\":\\\"%{User-agent}i\\\",\\\"size\\\":%B,\\\"bytes_received\\\":%I,\\\"bytes_sent\\\":%O,\\\"time_elapsed\\\":%D,\\\"country\\\":\\\"%{COUNTRY_CODE}e\\\",\\\"city\\\":\\\"%{CITY}e\\\",\\\"lat\\\":\\\"%{LATITUDE}e\\\",\\\"lon\\\":\\\"%{LONGITUDE}e\\\",\\\"reputation\\\":\\\"%{REPUTATION0}e,%{REPUTATION1}e,%{REPUTATION2}e,%{REPUTATION3}e,%{REPUTATION4}e\\\",\\\"owasp_top10\\\":\\\"%{owasp_top10}e\\\",\\\"reasons\\\":\\\"%{reasons}e\\\",\\\"threshold\\\":\\\"%{threshold}e\\\",\\\"score\\\":\\\"%{score}e\\\",\\\"authentication\\\":\\\"%{X-Authentication}n\\\",\\\"authentication_result\\\":\\\"%{X-Authentication-Result}n\\\"}"

separators = {
'space': ' ',
Expand Down
3 changes: 1 addition & 2 deletions gui/models/repository_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@ def test_connection(self):
session = Session()

if self.es_user and self.es_password:
request = Request("GET", url, headers={'Authorization': 'Basic {}'.format(
b64encode('{}:{}'.format(self.es_user, self.es_password).encode('utf8')))}).prepare()
request = Request("GET", url, auth=(self.es_user, self.es_password)).prepare()
else:
request = Request("GET", url).prepare()

Expand Down
4 changes: 2 additions & 2 deletions gui/models/template_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ def get_as_html(self):
:return: A string with pre-formatted html for the image
"""

return "<img src='data:image/{};base64,{}'/>".format(self.content.format.lower(), base64.b64encode(self.content.read()))
return "<img src='data:image/{};base64,{}'/>".format(self.content.format.lower(), base64.b64encode(self.content.read()).decode('utf8'))

def create_preview_html(self):
"""
Return a pre-formatted html containing the image.
:return: A string with pre-formatted html for the image
"""

return "data:image/{};base64,{}".format(self.content.format.lower(), base64.b64encode(self.content.read()))
return "data:image/{};base64,{}".format(self.content.format.lower(), base64.b64encode(self.content.read()).decode('utf8'))
6 changes: 3 additions & 3 deletions gui/views/cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ def sign(request):

# Find the internal CA's certificate and private key
internal = cluster.ca_certificate
ca_key = RSA.load_key_string(str(internal.key))
ca_cert = X509.load_cert_string(str(internal.cert))
ca_key = RSA.load_key_string(internal.key.encode('utf8'))
ca_cert = X509.load_cert_string(internal.cert.encode('utf8'))

# Get PKI next serial number
serial = cluster.ca_serial
Expand Down Expand Up @@ -512,7 +512,7 @@ def sign(request):
cluster.save()

# Store the certificate
cert.cert = crt.as_pem()
cert.cert = crt.as_pem().decode('utf8')
cert.name = str(crt.get_subject())
cert.status = 'V'
cert.issuer = str(internal.issuer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cd /tmp
/bin/rm -f /tmp/Vulture-LIBS.tar.gz

bsd_version=$(/usr/bin/uname -r | /usr/bin/cut -d '-' -f 1)
url="https://dl.vultureproject.org/$bsd_version$1/Vulture-LIBS.tar.gz"
url="https://download.vultureproject.org/v3/$bsd_version$1/Vulture-LIBS.tar.gz"

/bin/echo -n "[+] Downloading from '$url' ..."
/usr/local/bin/wget --no-check-certificate $url >>/tmp/installation.log 2>&1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# This migration script install newest Vulture-LIBS package
#
#

. /etc/rc.conf

if [ "$http_proxy" != "" ]
then
export https_proxy="http://$http_proxy"
export http_proxy="http://$http_proxy"
fi

cd /tmp

/bin/echo "[+] Updating Vulture-LIBS from branch \"$1\"..."
/bin/rm -f /tmp/Vulture-LIBS.tar.gz

bsd_version=$(/usr/bin/uname -r | /usr/bin/cut -d '-' -f 1)
url="https://download.vultureproject.org/v3/$bsd_version$1/Vulture-LIBS.tar.gz"

/bin/echo -n "[+] Downloading from '$url' ..."
/usr/local/bin/wget --no-check-certificate $url >>/tmp/installation.log 2>&1
/bin/echo "DONE"

cd /home/vlt-gui
/bin/rm -rf ./env
/usr/bin/tar xf /tmp/Vulture-LIBS.tar.gz
/usr/sbin/chown -R vlt-gui:vlt-gui /home/vlt-gui/

/bin/echo -n "[+] Installing Vulture libraries ..."
/bin/sh "/home/vlt-gui/lib-$bsd_version/install.sh"
/bin/echo "OK"

/bin/echo "[*] Update of Vulture-LIBS ended"

0 comments on commit 1122812

Please sign in to comment.