-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from defensivedepth/launcher
Adds HH Launcher - osquery packaging
- Loading branch information
Showing
17 changed files
with
241 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Security Onion - Hybrid Hunter</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" /> | ||
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" /> | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
font-family: Arial, Helvetica, sans-serif; | ||
padding-left: 30px; | ||
padding right: 30px; | ||
} | ||
|
||
body { | ||
font-family: Arial, Helvetica, sans-serif; | ||
background-color: #2a2a2a; | ||
|
||
} | ||
a { | ||
color: #f2f2f2; | ||
text-align: left; | ||
padding: 0px; | ||
} | ||
/* Style the top navigation bar */ | ||
.topnav { | ||
overflow: hidden; | ||
background-color: #333; | ||
width: 1080px; | ||
} | ||
|
||
/* Style the topnav links */ | ||
.topnav a { | ||
float: left; | ||
display: block; | ||
color: #f2f2f2; | ||
text-align: center; | ||
padding: 14px 16px; | ||
text-decoration: none; | ||
} | ||
|
||
/* Change color on hover */ | ||
.topnav a:hover { | ||
background-color: #ddd; | ||
color: black; | ||
} | ||
|
||
/* Style the content */ | ||
.content { | ||
background-color: #2a2a2a; | ||
padding: 10px; | ||
padding-top: 20px; | ||
padding-left: 60px; | ||
color: #E3DBCC; | ||
width: 1080px; | ||
} | ||
|
||
/* Style the footer */ | ||
.footer { | ||
background-color: #2a2a2a; | ||
padding: 60px; | ||
color: #E3DBCC; | ||
width: 1080px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div class="topnav"> | ||
<a href="/kibana/" target="_blank">Kibana</a> | ||
<a href="/grafana/" target="_blank">Grafana</a> | ||
<a href="/fleet/" target="_blank">Fleet</a> | ||
<a href="/thehive/" target="_blank">TheHive</a> | ||
<a href="/packages/" target="_blank">Osquery Binaries</a> | ||
<a href="https://github.com/Security-Onion-Solutions/securityonion-saltstack/wiki/FAQ" target="_blank">FAQ</a> | ||
<a href="https://www.securityonionsolutions.com" target="_blank">Security Onion Solutions</a> | ||
<a href="https://blog.securityonion.net" target="_blank">Blog</a> | ||
</div> | ||
|
||
<div class="content"> | ||
|
||
<p><center><h1>Osquery Packages</h1></center><br> | ||
|
||
<h2>Notes</h2> | ||
<ul> | ||
<li>These packages are customized for this specific Fleet install and will only be generated after the Fleet setup script has been run. If you want vanilla osquery packages, you can get them directly from <a href="https://osquery.io/downloads">osquery.io</a></li> | ||
<li>Packages are not signed.</li> | ||
</ul> | ||
<BR> <h2>Downloads</h2> | ||
<ul> | ||
|
||
Generated: N/A | ||
<BR><BR>Packages: | ||
<li><a href="/packages/launcher.msi" download="msi-launcher.msi">MSI (Windows)</a></li> | ||
<li><a href="/packages/launcher.deb" download="deb-launcher.deb">DEB (Debian)</a></li> | ||
<li><a href="/packages/launcher.rpm" download="rpm-launcher.rpm">RPM (RPM)</a></li> | ||
<BR><BR>Config Files: | ||
<li><a href="/packages/launcher.flags" download="launcher.flags.txt">RPM & DEB Flag File</a></li> | ||
<li><a href="/packages/launcher-msi.flags" download="launcher-msi.flags.txt">MSI Flag File</a></li> | ||
</ul> | ||
|
||
<BR><h2>Known Issues</h2> | ||
<ul> | ||
<li>None</li> | ||
</ul> | ||
</p> | ||
</div> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#so-fleet-setup.sh $MasterIP $FleetEmail | ||
|
||
if [ ! "$(docker ps -q -f name=so-fleet)" ]; then | ||
echo "so-fleet container not running... Exiting..." | ||
exit 1 | ||
fi | ||
|
||
initpw=$(date +%s | sha256sum | base64 | head -c 16 ; echo) | ||
|
||
docker exec so-fleet fleetctl config set --address https://$1:443 --tls-skip-verify | ||
docker exec so-fleet fleetctl setup --email $2 --password $initpw | ||
|
||
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/options.yaml | ||
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/MacOS/osquery.yaml | ||
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/Windows/osquery.yaml | ||
docker exec so-fleet fleetctl apply -f /packs/hh/hhdefault.yml | ||
|
||
esecret=$(sudo docker exec so-fleet fleetctl get enroll-secret) | ||
|
||
#Concat fleet.crt & ca.crt - this is required for launcher connectivity | ||
cat /etc/pki/fleet.crt /etc/pki/ca.crt > /etc/pki/fleet-launcher.crt | ||
|
||
#Create the output directory | ||
mkdir /opt/so/conf/fleet/packages | ||
|
||
docker run \ | ||
--mount type=bind,source=/opt/so/conf/fleet/packages,target=/output \ | ||
--mount type=bind,source=/etc/pki/fleet-launcher.crt,target=/var/launcher/launcher.crt \ | ||
defensivedepth/hh-launcher "$esecret" "$1":8080 | ||
|
||
#Update timestamp on packages webpage | ||
sed -i "s@.*Generated.*@Generated: $(date '+%m%d%Y')@g" /opt/so/conf/fleet/packages/index.html | ||
|
||
echo "Fleet Setup Complete - Login here: https://$1" | ||
echo "Your username is $2 and your password is $initpw" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
{%- set MASTERIP = salt['pillar.get']('static:masterip', '') %} | ||
{%- set HIVEUSER = salt['pillar.get']('static:hiveuser', '') %} | ||
{%- set HIVEPASSWORD = salt['pillar.get']('static:hivepassword', '') %} | ||
{%- set HIVEKEY = salt['pillar.get']('static:hivekey', '') %} | ||
|
||
hive_init(){ | ||
sleep 60 | ||
HIVE_IP="{{MASTERIP}}" | ||
HIVE_USER="{{HIVEUSER}}" | ||
HIVE_PASSWORD="{{HIVEPASSWORD}}" | ||
SOCTOPUS_CONFIG="/opt/so/saltstack/salt/soctopus/files/SOCtopus.conf" | ||
|
||
# Migrate DB | ||
curl -v -k -XPOST "https://$HIVE_IP:/thehive/api/maintenance/migrate" | ||
|
||
# Generate unique ID for apikey | ||
HIVE_KEY="{{HIVEKEY}}" | ||
|
||
# Create intial TheHive user | ||
curl -v -k "https://$HIVE_IP/thehive/api/user" -H "Content-Type: application/json" -d "{\"login\" : \"$HIVE_USER\",\"name\" : \"$HIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$HIVE_PASSWORD\", \"key\": \"$HIVE_KEY\"}" | ||
|
||
# Update SOCtopus config with apikey value | ||
#sed -i "s/hive_key = .*/hive_key = $HIVE_KEY/" $SOCTOPUS_CONFIG | ||
|
||
# Check for correct authentication | ||
#curl -v -k -H "Authorization: Bearer $HIVE_KEY" "https://$HIVE_IP/thehive/api/user/$USER" | ||
|
||
touch /opt/so/state/thehive.txt | ||
|
||
} | ||
|
||
if [ -f /opt/so/state/thehive.txt ]; then | ||
exit 0 | ||
else | ||
hive_init | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.