Skip to content

Commit

Permalink
Add green status indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
marshyski committed Apr 11, 2024
1 parent b4bfa01 commit 26563bd
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 88 deletions.
20 changes: 17 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.hostname = "paradrop-ubuntu22-01"
config.vm.hostname = "paradrop-ubuntu22-1"
config.vm.provider "virtualbox" do |v|
v.name = "ubuntu22"
v.name = "paradrop-ubuntu22-1"
v.memory = 8192
v.cpus = 4
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
Expand Down Expand Up @@ -43,7 +43,7 @@ ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get update -y
ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get remove -y whoopsie apport apport-gtk ubuntu-report unattended-upgrades kerneloops plymouth thunderbird transmission-common cheese aisleriot gnome-mahjongg gnome-mines gnome-sudoku remmina mlocate
ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y curl jq vim net-tools dnsutils screen nodejs python3-pip python3-dev make unzip htop
ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y curl jq vim net-tools dnsutils screen nodejs python3-pip python3-dev make unzip htop clamav libopenscap8
# Setup Docker
curl -fsSL https://get.docker.com -o ./get-docker.sh
Expand All @@ -53,6 +53,20 @@ rm ./get-docker.sh
systemctl enable docker
systemctl restart docker
# Install Trivy Scanner
apt-get install wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
apt-get update
apt-get install trivy
# Install OpenScap Content Guides
wget -c https://github.com/ComplianceAsCode/content/releases/download/v0.1.72/scap-security-guide-0.1.72.zip
unzip scap-security-guide-0.1.72.zip
mkdir -p /usr/share/scap-security-guide
cp -rf scap-security-guide-0.1.72/* /usr/share/scap-security-guide/
rm -rf scap-security-guide-0.1.72*
# Install Python Deps
pip3 install -r /paradrop/api/requirements.txt
Expand Down
12 changes: 4 additions & 8 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def first_run() -> bool:
"normalizer": "lowercase_normalizer"
},
"updated_at": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"type": "keyword"
}
}
}
Expand Down Expand Up @@ -167,8 +166,7 @@ def first_run() -> bool:
"normalizer": "lowercase_normalizer"
},
"last_run": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"type": "keyword"
},
"docker_stopped": {
"type": "keyword",
Expand Down Expand Up @@ -491,12 +489,10 @@ def first_run() -> bool:
"normalizer": "lowercase_normalizer"
},
"created_at": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"type": "keyword"
},
"expire_at": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"type": "keyword"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions elk/clean_hosts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

curl -k -u 'admin:dtYe2cKY2YtyBEJ49a' -H 'Content-Type: application/json' -XPOST 'https://127.0.0.1:9200/paradrop_hosts/_delete_by_query?conflicts=proceed' -d '{"query":{"match_all": {}}}'
8 changes: 3 additions & 5 deletions elk/es_settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"analysis" : {
"analysis": {
"normalizer": {
"lowercase_normalizer": {
"type": "custom",
"filter": [
"lowercase"
]
"filter": ["lowercase"]
}
}
}
}
}
3 changes: 1 addition & 2 deletions elk/paradrop_audit_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"normalizer": "lowercase_normalizer"
},
"updated_at": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"type": "keyword"
}
}
}
3 changes: 1 addition & 2 deletions elk/paradrop_changes_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"normalizer": "lowercase_normalizer"
},
"changes_discovered": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"type": "keyword"
}
}
}
46 changes: 23 additions & 23 deletions elk/paradrop_event_triggers_mapping.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"properties": {
"event_name": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"event_impact": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"event_enable": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"send_alert": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"event_trigger": {
"type": "object",
"properties": {
"field": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"properties": {
"event_name": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"event_impact": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"event_enable": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"send_alert": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"event_trigger": {
"type": "object",
"properties": {
"field": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
}
}
}
Expand Down
15 changes: 6 additions & 9 deletions elk/paradrop_hosts_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"normalizer": "lowercase_normalizer"
},
"last_run": {
"type": "date",
"normalizer": "lowercase_normalizer"
"type": "keyword"
},
"docker_stopped": {
"type": "keyword",
Expand Down Expand Up @@ -69,8 +68,8 @@
"type": "long"
},
"docker_images": {
"type":"nested",
"include_in_parent": true,
"type": "nested",
"include_in_parent": true,
"properties": {
"name": {
"type": "keyword",
Expand All @@ -79,16 +78,16 @@
"size": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
},
"created": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
}
}
},
"docker_containers": {
"type":"nested",
"include_in_parent": true,
"type": "nested",
"include_in_parent": true,
"properties": {
"name": {
"type": "keyword",
Expand Down Expand Up @@ -163,7 +162,6 @@
}
}
}

}
},
"trivy": {
Expand Down Expand Up @@ -331,4 +329,3 @@
}
}
}

18 changes: 9 additions & 9 deletions elk/paradrop_reports_mapping.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"properties": {
"report_name": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"report_description": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
"properties": {
"report_name": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"report_description": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
}
}
}
}
47 changes: 22 additions & 25 deletions elk/paradrop_users_mapping.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
{
"properties": {
"email": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"role": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"last_signin": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"created_at": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"expire_at": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
}
"properties": {
"email": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"role": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"last_signin": {
"type": "keyword"
},
"created_at": {
"type": "keyword"
},
"expire_at": {
"type": "keyword"
}
}
}
2 changes: 1 addition & 1 deletion ui/event-triggers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ <h4 class="modal-title" id="modalTitle">Add Event Trigger</h4>
<option value="loaded_kernel_modules">loaded_kernel_modules</option>
<option value="memoryused_pct">memoryused_pct</option>
<option value="memoryfree_gb">memoryfree_gb</option>
<option value="ntp_running-bool">ntp_running -> bool</option>
<option value="ntp_running-bool">ntp_running</option>
<option value="openscap['error_total]">openscap['error_total]</option>
<option value="openscap['fail_total]">openscap['fail_total]</option>
<option value="openscap['informational_total']">openscap['informational_total']</option>
Expand Down
6 changes: 5 additions & 1 deletion ui/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ async function updateTable (tableColumnsSpecifications, dataCardsSpecifications,
// We want to add icon to the first column to show that more data are available on click
// If this is first column, add click icon
if (firstColumn) {
newColumn.innerHTML = '<span class="fa-solid fa-arrow-up-right-from-square ms-1 me-2 "></span>'
if (filter === 'hosts') {
newColumn.innerHTML = '<span class="fa-solid fa-circle text-success ms-1 me-2 "></span>'
} else {
newColumn.innerHTML = '<span class="fa-solid fa-arrow-up-right-from-square ms-1 me-2 "></span>'
}

// And then set firstColumn to false to have that icon only in the first column.
firstColumn = false
Expand Down

0 comments on commit 26563bd

Please sign in to comment.