Skip to content

Commit

Permalink
Initial Release
Browse files Browse the repository at this point in the history
  • Loading branch information
marshyski committed May 17, 2024
1 parent cdee143 commit 945b67a
Show file tree
Hide file tree
Showing 127 changed files with 5,530 additions and 4,103 deletions.
65 changes: 36 additions & 29 deletions .github/workflows/paradrop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,54 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set Up Golang
uses: actions/setup-go@v5
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v4
go-version: ">=1.22.3"

- name: Build paradrop-agent Binary
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.20.0
cd agent && make lint && make
- name: Set Up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install Python Dependencies
run: |
make pip
run: make pip

- name: Run Linters
run: |
make lint
run: make lint

- name: Provision Paradrop Stack with Seed Data
run: |
make elk
# Tests not working in GH Action seed data isn't working
# - name: Test with Python unittest
# run: |
# make pytest
run: make local

- name: Build API and UI Containers
run: |
make cbuilds
- name: Test with Python unittest
run: make pytest

- name: Run Vulnerability Scanner on Paradrop_api image
uses: aquasecurity/trivy-action@0.5.1
- name: Run Vulnerability Scanner On paradrop-api Image
uses: aquasecurity/trivy-action@master
with:
image-ref: paradrop_api
image-ref: paradrop-api
exit-code: 0
severity: HIGH,CRITICAL,UNKNOWN,LOW,MEDIUM
- name: Run Vulnerability Scanner on Paradrop_ui image
uses: aquasecurity/trivy-action@0.5.1
severity: HIGH,CRITICAL,MEDIUM

- name: Run Vulnerability Scanner On paradrop-ui Image
uses: aquasecurity/trivy-action@master
with:
image-ref: paradrop_ui
image-ref: paradrop-ui
exit-code: 0
severity: HIGH,CRITICAL,UNKNOWN,LOW,MEDIUM
severity: HIGH,CRITICAL,MEDIUM

- name: Run Vulnerability Scanner On paradrop-docs Image
uses: aquasecurity/trivy-action@master
with:
image-ref: paradrop-docs
exit-code: 0
severity: HIGH,CRITICAL,MEDIUM
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ vendor
*.deb
.vagrant*
*.box
paradrop-agent

# macOS Specific
.DS_Store
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ UI_NAME := paradrop_ui

.PHONY: api elk superlinter develop docs

default: docker
default: local

mkcert:
openssl req -x509 -newkey rsa:4096 -nodes -keyout ui/localhost.key -out ui/localhost.pem -days 365 -sha256 -subj '/CN=127.0.0.1' -addext 'subjectAltName=IP:127.0.0.1'
Expand All @@ -15,9 +15,9 @@ npm:
docs:
cd docs && npm install

docker: npm mkcert docs
local: npm mkcert docs
sudo docker compose down --remove-orphans
sudo URL='https:\/\/127.0.0.1' docker compose up --build -d
sudo URL='https:\/\/localhost:8443' docker compose up --build -d
sleep 60
cd ./elk && ./seed.sh

Expand Down
109 changes: 76 additions & 33 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,63 +1,106 @@
<p align="center">
<img width="214" height="42" src="./ui/static/assets/logo-red.png">
<img width="214" height="42" src="./ui/static/assets/logo-red.png" alt="paradrop">
</p>

<h3 align="center">Simple, Easy Infrastructure Scanning</h3>
<h2 align="center">Cybersecurity Asset Management</h2>

---
[![Demo][demo_url_img]][demo_url]
[![Admin Docs][admin_doc_img]][admin_doc_url]
[![API Docs][api_doc_img]][api_doc_url]
[![License][repo_license_img]][repo_license_url]

## Provision Elasticsearch and Kibana Docker Containers With Seed Data
paradrop is an open source, cybersecurity asset management tool that collects operating system information, including configurations, security settings, resource metrics, and installed and running software. The paradrop UI provides accessible, searchable, and filterable views on the data the paradrop agent collects from supported platforms. Our end goal is to build an easily customizable solution that provides methods to automate United States Government challenges around System Security Plans (SSP), Authorization to Operate (ATO), and Software Bill of Materials (SBOMs).

From your local terminal in the paradrop directory:
## ⚡️ Quick start

```sh
cd elk
sudo ./seed.sh
> 🐳 **Docker Compose** Method
> First install NodeJS 18.x, Make, cURL and Docker
```bash
make local
```

## Access Elasticsearch and Kibana
> 🖥️ **Vagrant** Method
Kibana - open your browser to <http://localhost:5601/>
```bash
vagrant up
```

Username: `admin`
Go to https://localhost:8443/ui/

Password: `dtYe2cKY2YtyBEJ49a`
## 📖 Docs

The same username and password is used to access Elasticsearch.
**Main Docs**: https://demo.paradrop.io/docs

Example GET request:
**Swagger API Docs**: https://demo.paradrop.io/apidocs/

```sh
curl -k -u 'admin:dtYe2cKY2YtyBEJ49a' -H 'Content-Type: application/json' 'https://localhost:9200/'
```
## ⚙️ Development

## Lint Code
### `Opensearch`
Elasticsearch compatible database also works

From your local terminal in the paradrop directory:
> 🔔 Requires cURL, Make and Docker
```sh
./lint.sh
```bash
make elk
```

## Build API Docker Container
### `api`
Python Flask API

From your local terminal in the paradrop directory:
> 🔔 Requires Python >=3.10.
```sh
sudo ./start.sh
```bash
make api
```

## Build UI Docker Container
### `ui`
Bootstrap 5 & CoreUI Static HTML/CSS/JS

> 🔔 Requires Python 3.x or serve static assets from build UI directory.
```bash
make ui
```

From your local terminal in the paradrop directory:
### `agent`
Golang Agent (Windows/Linux/Darwin/amd64/arm64 supported)
> 🔔 Requires Go >=1.22
```sh
cd ui
sudo ./start.sh
```bash
cd agent
make
```

## Default Username and Password In paradrop_users Index

Username/Email: `admin@paradrop.io`
## 🚧 Project Status

The paradrop tool is early in development, and we're still building more documentation to help you deploy across different architectures, accelerate iterating on changes, and enhance security controls this year.

We hope you star this project, engage with us, and check back when you can for further updates coming soon.


## ⚠️ License

[`paradrop`][repo_url] is free and open source software licensed under
the [GNU General Public License v3.0][repo_license_url]


<!-- Links -->
[admin_doc_url]: https://demo.paradrop.io/docs

[repo_license_url]: https://github.com/Metrostar/paradrop/blob/main/COPYING

[repo_url]: https://github.com/MetroStar/paradrop

[repo_license_img]: https://img.shields.io/badge/license-GPLv3-purple?style=for-the-badge&logo=none

[admin_doc_img]: https://img.shields.io/badge/admin_docs-click_here-blue?style=for-the-badge&logo=none

[api_doc_img]: https://img.shields.io/badge/api_docs-click_here-pink?style=for-the-badge&logo=none

[api_doc_url]: https://demo.paradrop.io/apidocs/

[demo_url]: https://demo.paradrop.io/ui/login/

Password: `Paradrop789!`
[demo_url_img]: https://img.shields.io/badge/demo-click_here-red?style=for-the-badge&logo=none
92 changes: 79 additions & 13 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,90 @@

Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.hostname = "ubuntu22"
config.vm.hostname = "paradrop-ubuntu22-1"
config.vm.provider "virtualbox" do |v|
v.name = "ubuntu22"
v.memory = 4096
v.cpus = 2
v.name = "paradrop-ubuntu22-1"
v.memory = 8192
v.cpus = 4
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]
end
config.vm.network "forwarded_port", guest: 443, host: 8443
config.vm.network "forwarded_port", guest: 8443, host: 8443
config.vm.network "forwarded_port", guest: 9200, host: 9200
config.vm.network "forwarded_port", guest: 9300, host: 9300
config.vm.synced_folder ".", "/home/vagrant/paradrop"
config.vm.network "forwarded_port", guest: 5601, host: 5601
config.vm.synced_folder ".", "/paradrop", SharedFoldersEnableSymlinksCreate: true
config.vm.provision "shell", inline: <<-SHELL
apt-get update -y
apt-get upgrade -y
apt-get install -y curl nodejs npm python3-pip python3-dev docker.io docker-compose make
systemctl enable docker
systemctl start docker
# Setup Elastic sysctl Params
sysctl -w vm.max_map_count=262144
sysctl -w vm.swappiness=10
sysctl -w net.ipv4.tcp_retries2=5
# Setup Security File Limits
cat <<'EOF' >/etc/security/limits.d/99-limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
* soft stack unlimited
* hard stack unlimited
root soft stack unlimited
root hard stack unlimited
EOF
# Setup NodeJS v18
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
# Setup Base Packages
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 clamav libopenscap8 dmidecode
# Setup Docker
curl -fsSL https://get.docker.com -o ./get-docker.sh
sh ./get-docker.sh
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
# Setup paradrop-agent
mkdir -p /etc/paradrop
cat <<'EOF'>/etc/paradrop/paradrop-agent.yaml
api_url: https://localhost:8443/v1/add-host
api_username: admin@paradrop.io
api_token: b97a81c5-3c2b-4a96-8881-38af26dc8407
api_insecure_ssl: true
tags: ["app=paradrop-agent-vagrant","health=https://localhost:8443/v1/health"]
oscap_xccdf_xml: "/usr/share/scap-security-guide/ssg-ubuntu2204-ds.xml"
EOF
cp -f /paradrop/paradrop-agent /usr/bin/
# timeout 15 paradrop-agent -d
# Restart
systemctl reboot
SHELL
end
end
6 changes: 3 additions & 3 deletions paradrop-agent/.gitignore → agent/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ _testmain.go
*.exe
*.test
*.prof
cmon
cmon.yml
cmon-*
paradrop-agent
paradrop-agent.yml
paradrop-agent-*
vendor
*.rpm
*.deb
Expand Down
2 changes: 1 addition & 1 deletion paradrop-agent/Dockerfile → agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ RUN trivy fs -f table --exit-code 0 --no-progress /app/
# App Container
FROM gcr.io/distroless/base
COPY --from=security /app/ /app/
CMD ["/app/cmon", "-d"]
CMD ["/app/paradrop-agent", "-d"]
2 changes: 1 addition & 1 deletion paradrop-agent/Dockerfile-pkgs → agent/Dockerfile-pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ RUN apt-get update && apt-get install \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN gem install --no-document fpm
COPY ./packaging /packaging
COPY ./cmon /
COPY ./paradrop-agent /
WORKDIR /packaging
RUN /packaging/package.sh ${VER}
Loading

0 comments on commit 945b67a

Please sign in to comment.