Skip to content

Commit eaa7d67

Browse files
authored
Merge pull request #444 from intelowlproject/develop
1.4.1
2 parents 66d966e + f583583 commit eaa7d67

File tree

8 files changed

+68
-12
lines changed

8 files changed

+68
-12
lines changed

docker/.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_GREEDYBEAR_VERSION="1.4.0"
1+
REACT_APP_GREEDYBEAR_VERSION="1.4.1"

docker/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Frontend
2-
FROM node:lts-alpine3.21 as frontend-build
2+
FROM node:lts-alpine3.21 AS frontend-build
33

44
WORKDIR /
55
# copy react source code
@@ -15,10 +15,10 @@ RUN PUBLIC_URL=/static/reactapp/ npm run build
1515
# Stage 2: Backend
1616
FROM python:3.11.9-alpine3.20
1717

18-
ENV PYTHONUNBUFFERED 1
19-
ENV DJANGO_SETTINGS_MODULE greedybear.settings
20-
ENV PYTHONPATH /opt/deploy/greedybear
21-
ENV LOG_PATH /var/log/greedybear
18+
ENV PYTHONUNBUFFERED=1
19+
ENV DJANGO_SETTINGS_MODULE=greedybear.settings
20+
ENV PYTHONPATH=/opt/deploy/greedybear
21+
ENV LOG_PATH=/var/log/greedybear
2222

2323
ARG WATCHMAN=false
2424

docker/Dockerfile_nginx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM library/nginx:1.27.3-alpine
22
RUN mkdir -p /var/cache/nginx /var/cache/nginx/feeds
33
RUN apk update && apk upgrade && apk add bash
4-
ENV NGINX_LOG_DIR /var/log/nginx
4+
ENV NGINX_LOG_DIR=/var/log/nginx
55
# this is to avoid having these logs redirected to stdout/stderr
66
RUN rm $NGINX_LOG_DIR/access.log $NGINX_LOG_DIR/error.log
77
RUN touch $NGINX_LOG_DIR/access.log $NGINX_LOG_DIR/error.log

frontend/src/components/feeds/tableColumns.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const feedsTableColumns = [
1313
maxWidth: 80,
1414
},
1515
{
16-
Header: "Feed type",
17-
accessor: "feed_type",
16+
Header: "Value",
17+
accessor: "value",
1818
maxWidth: 60,
1919
},
2020
{
21-
Header: "Value",
22-
accessor: "value",
21+
Header: "Feed type",
22+
accessor: "feed_type",
2323
maxWidth: 60,
2424
},
2525
{

greedybear/admin.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.contrib import admin, messages
66
from django.db.models import Q
77
from django.utils.translation import ngettext
8-
from greedybear.models import IOC, GeneralHoneypot
8+
from greedybear.models import IOC, CowrieSession, GeneralHoneypot
99

1010
logger = logging.getLogger(__name__)
1111

@@ -15,6 +15,13 @@
1515
# list_display = [field.name for field in Sensors._meta.get_fields()]
1616

1717

18+
@admin.register(CowrieSession)
19+
class CowrieSessionModelAdmin(admin.ModelAdmin):
20+
list_display = ["session_id", "start_time", "duration", "login_attempt", "credentials", "command_execution", "interaction_count", "source"]
21+
search_fields = ["source"]
22+
raw_id_fields = ["source"]
23+
24+
1825
@admin.register(IOC)
1926
class IOCModelAdmin(admin.ModelAdmin):
2027
list_display = [
@@ -25,13 +32,19 @@ class IOCModelAdmin(admin.ModelAdmin):
2532
"days_seen",
2633
"number_of_days_seen",
2734
"attack_count",
35+
"interaction_count",
2836
"related_urls",
2937
"scanner",
3038
"payload_request",
3139
"log4j",
3240
"cowrie",
3341
"general_honeypots",
42+
"ip_reputation",
43+
"asn",
44+
"destination_ports",
45+
"login_attempts",
3446
]
47+
search_fields = ["name"]
3548
filter_horizontal = ["general_honeypot", "related_ioc"]
3649

3750
def general_honeypots(self, ioc):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2.15 on 2025-02-10 12:58
2+
3+
from django.db import migrations
4+
5+
6+
def removeDdospot(apps, schema_editor):
7+
GeneralHoneypot = apps.get_model("greedybear", "GeneralHoneypot")
8+
ddospot = GeneralHoneypot.objects.get(name__iexact="Ddospot")
9+
IOC = apps.get_model("greedybear", "IOC")
10+
# do nothing if Ddospot is in active use
11+
if ddospot.active and IOC.objects.filter(general_honeypot=ddospot).exists():
12+
return
13+
ddospot.delete()
14+
15+
16+
class Migration(migrations.Migration):
17+
dependencies = [
18+
("greedybear", "0013_ioc_greedybear__name_b54897_idx"),
19+
]
20+
21+
operations = [migrations.RunPython(removeDdospot)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 4.2.17 on 2025-02-10 14:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("greedybear", "0014_auto_20250210_1258"),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name="cowriesession",
15+
index=models.Index(fields=["source"], name="greedybear__source__a3720f_idx"),
16+
),
17+
]

greedybear/models.py

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ class CowrieSession(models.Model):
6969
interaction_count = models.IntegerField(blank=False, null=False, default=0)
7070
source = models.ForeignKey(IOC, on_delete=models.CASCADE, blank=False, null=False)
7171

72+
class Meta:
73+
indexes = [
74+
models.Index(fields=["source"]),
75+
]
76+
7277

7378
class Statistics(models.Model):
7479
source = models.CharField(max_length=15, blank=False)

0 commit comments

Comments
 (0)