-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specify dockerfiles and docker-compose files and integrate
- Loading branch information
Showing
20 changed files
with
220 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Basic Checks | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * *' # every day at midnight | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Set up loopback interfaces | ||
run: | | ||
sudo ifconfig lo:1 192.168.100.1 up | ||
sudo ifconfig lo:2 192.168.100.2 up | ||
- name: Start Listener | ||
run: | | ||
touch nc_output.txt | ||
(nc -u -l -k 9991 | hexdump -C > nc_output.txt & echo $! > listener_pid.txt) & | ||
echo "$!" > listener_pid.txt | ||
sleep 5s | ||
echo "Listener PID:" | ||
cat listener_pid.txt | ||
echo "Listener Output:" | ||
cat nc_output.txt | ||
- name: Debug IP Configuration | ||
run: | | ||
ip a | ||
- name: Run main.py | ||
run: | | ||
sudo env PATH="$PATH" python main.py -v -t examples/ipfix-traffic.yml | ||
- name: Stop Listener | ||
run: | | ||
pid=$(cat listener_pid.txt) | ||
sudo kill -SIGINT $pid | ||
sleep 5s | ||
echo "Listener Output:" | ||
cat nc_output.txt | ||
- name: Preprocess Hexdump Output | ||
run: | | ||
awk '{print substr($0, 11, 47)}' nc_output.txt | tr -d ' \n' > nc_output_cleaned.txt | ||
echo "Listener Output Cleaned:" | ||
cat nc_output_cleaned.txt | ||
- name: Count Packets | ||
run: | | ||
packet_count=$(grep -o '000a' nc_output_cleaned.txt | wc -l) | ||
echo $packet_count > packet_count.txt | ||
- name: Check Packet Count | ||
run: | | ||
packet_count=$(cat packet_count.txt) | ||
echo "Packet Count: $packet_count" | ||
if [ "$packet_count" -eq 6 ]; then | ||
echo "Success: 6 packets received." | ||
else | ||
echo "Error: Expected 6 packets but found $packet_count." | ||
exit 1 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
version: '3' | ||
|
||
networks: | ||
test_network: | ||
external: true | ||
|
||
services: | ||
nfacctd: | ||
image: pmacct/nfacctd:v1.7.9 | ||
container_name: nfacctd | ||
volumes: | ||
- ./nfacctd.conf:/etc/pmacct/nfacctd.conf | ||
- ./tmp/logs:/var/log/pmacct | ||
networks: | ||
test_network: | ||
ipv4_address: 192.168.100.100 | ||
ipv6_address: cafe::100 | ||
|
||
nfacctd-bgp: | ||
image: pmacct/nfacctd:v1.7.9 | ||
container_name: nfacctd-bgp | ||
volumes: | ||
- ./nfacctd-bgp.conf:/etc/pmacct/nfacctd.conf | ||
- ./tmp/logs:/var/log/pmacct | ||
networks: | ||
test_network: | ||
ipv4_address: 192.168.100.101 | ||
ipv6_address: cafe::101 | ||
|
||
nfacctd-bmp: | ||
image: pmacct/nfacctd:v1.7.9 | ||
container_name: nfacctd-bmp | ||
volumes: | ||
- ./nfacctd-bmp.conf:/etc/pmacct/nfacctd.conf | ||
- ./tmp/logs:/var/log/pmacct | ||
networks: | ||
test_network: | ||
ipv4_address: 192.168.100.102 | ||
ipv6_address: cafe::102 | ||
|
||
pmtelemetryd-tcp-json: | ||
image: pmacct/pmtelemetryd:v1.7.9 | ||
container_name: pmtelemetryd-tcp-json | ||
volumes: | ||
- ./pmtelemetryd-tcp-json.conf:/etc/pmacct/pmtelemetryd.conf | ||
- ./tmp/logs:/var/log/pmacct | ||
networks: | ||
test_network: | ||
ipv4_address: 192.168.100.200 | ||
ipv6_address: cafe::200 | ||
|
||
pmtelemetryd-udp-notif: | ||
image: pmacct/pmtelemetryd:v1.7.9 | ||
container_name: pmtelemetryd-udp-notif | ||
volumes: | ||
- ./pmtelemetryd-udp-notif.conf:/etc/pmacct/pmtelemetryd.conf | ||
- ./tmp/logs:/var/log/pmacct | ||
networks: | ||
test_network: | ||
ipv4_address: 192.168.100.201 | ||
ipv6_address: cafe::201 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
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,22 @@ | ||
--- | ||
version: '3' | ||
|
||
networks: | ||
test_network: | ||
external: true | ||
|
||
services: | ||
traffic-reproducer: | ||
image: traffic-reproducer:latest | ||
container_name: traffic-reproducer | ||
volumes: | ||
- ./examples:/pcap/traffic-reproducer.conf | ||
networks: | ||
test_network: | ||
ipv4_address: 192.168.100.1 | ||
ipv6_address: cafe::1 | ||
environment: | ||
- ADDITIONAL_IPV4_LIST=${ADDITIONAL_IPV4_LIST} | ||
- ADDITIONAL_IPV6_LIST=${ADDITIONAL_IPV6_LIST} | ||
|
||
# TODO: add additional ip6 as list directly here... |
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,18 @@ | ||
#!/bin/bash | ||
|
||
ip a | ||
|
||
# Add more IPv4 addresses | ||
for ip in ${ADDITIONAL_IPV4_LIST}; do | ||
ip addr add $ip dev eth0 | ||
done | ||
|
||
# Add more IPv6 addresses | ||
for ip in ${ADDITIONAL_IPV6_LIST}; do | ||
ip -6 addr add $ip dev eth0 | ||
done | ||
|
||
ip a | ||
|
||
# Execute the original entrypoint | ||
exec "$@" |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -29,5 +29,5 @@ tcp_generic: | |
dport: | ||
- 10005 | ||
collector: | ||
ip: cafe::100 | ||
ip: cafe::200 | ||
port: 10005 |
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 |
---|---|---|
|
@@ -29,5 +29,5 @@ udp_generic: | |
dport: | ||
- 10003 | ||
collector: | ||
ip: 192.168.100.100 | ||
ip: 192.168.100.201 | ||
port: 10003 |