forked from jccardonar/NetFlow-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flowgen_wrapper.sh: support domain names
Create a wrapper script to support domain names to specify the collector.
- Loading branch information
Showing
2 changed files
with
13 additions
and
2 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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#### Base Image: Debian 12 (Bookworm) | ||
FROM debian:bookworm-slim as builder | ||
|
||
RUN apt-get update && apt-get -y install gcc make | ||
RUN apt-get update && apt-get -y install gcc make dnsutils | ||
COPY * /tmp/ | ||
RUN cd tmp && make && ls -la | ||
RUN apt-get -y clean && rm -rf /var/lib/apt/lists/* | ||
|
||
FROM debian:bookworm-slim | ||
COPY --from=builder /tmp/flowgen /usr/bin/ | ||
ENTRYPOINT ["/usr/bin/flowgen"] | ||
COPY --from=builder /tmp/flowgen_wrapper.sh /usr/bin/ | ||
ENTRYPOINT ["/usr/bin/flowgen_wrapper.sh"] |
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,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Attempt to resolve domain name | ||
IP=$(dig +short ${@: -1}) | ||
|
||
#Print resolution | ||
echo "Sending flow records to ${IP}..." | ||
flowgen ${@:1:$#-1} ${IP} |