Remove hardump flag (#183)

Removed hardump flag and made it the default (and only) behavior.
This commit is contained in:
Nimrod Gilboa Markevich 2021-08-08 17:31:45 +03:00 committed by GitHub
parent 02e02718d2
commit 1cf9c29ef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 19 deletions

View File

@ -48,8 +48,6 @@ WORKDIR /app
COPY --from=builder ["/app/agent-build/mizuagent", "."] COPY --from=builder ["/app/agent-build/mizuagent", "."]
COPY --from=site-build ["/app/ui-build/build", "site"] COPY --from=site-build ["/app/ui-build/build", "site"]
COPY agent/start.sh .
# gin-gonic runs in debug mode without this # gin-gonic runs in debug mode without this
ENV GIN_MODE=release ENV GIN_MODE=release

View File

@ -1,2 +0,0 @@
#!/bin/bash
./mizuagent -i any -hardump -targets ${TAPPED_ADDRESSES}

View File

@ -577,7 +577,6 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac
"./mizuagent", "./mizuagent",
"-i", "any", "-i", "any",
"--tap", "--tap",
"--hardump",
"--api-server-address", fmt.Sprintf("ws://%s/wsTapper", apiServerPodIp), "--api-server-address", fmt.Sprintf("ws://%s/wsTapper", apiServerPodIp),
} }
if tapOutgoing { if tapOutgoing {

View File

@ -84,7 +84,6 @@ var staleTimeoutSeconds = flag.Int("staletimout", 120, "Max time in seconds to k
var memprofile = flag.String("memprofile", "", "Write memory profile") var memprofile = flag.String("memprofile", "", "Write memory profile")
// output // output
var dumpToHar = flag.Bool("hardump", false, "Dump traffic to har files")
var HarOutputDir = flag.String("hardir", "", "Directory in which to store output har files") var HarOutputDir = flag.String("hardir", "", "Directory in which to store output har files")
var harEntriesPerFile = flag.Int("harentriesperfile", 200, "Number of max number of har entries to store in each file") var harEntriesPerFile = flag.Int("harentriesperfile", 200, "Number of max number of har entries to store in each file")
@ -186,19 +185,12 @@ func (c *Context) GetCaptureInfo() gopacket.CaptureInfo {
func StartPassiveTapper(opts *TapOpts) (<-chan *OutputChannelItem, <-chan *OutboundLink) { func StartPassiveTapper(opts *TapOpts) (<-chan *OutputChannelItem, <-chan *OutboundLink) {
hostMode = opts.HostMode hostMode = opts.HostMode
var harWriter *HarWriter harWriter := NewHarWriter(*HarOutputDir, *harEntriesPerFile)
if *dumpToHar {
harWriter = NewHarWriter(*HarOutputDir, *harEntriesPerFile)
}
outboundLinkWriter := NewOutboundLinkWriter() outboundLinkWriter := NewOutboundLinkWriter()
go startPassiveTapper(harWriter, outboundLinkWriter) go startPassiveTapper(harWriter, outboundLinkWriter)
if harWriter != nil { return harWriter.OutChan, outboundLinkWriter.OutChan
return harWriter.OutChan, outboundLinkWriter.OutChan
}
return nil, outboundLinkWriter.OutChan
} }
func startMemoryProfiler() { func startMemoryProfiler() {
@ -321,10 +313,8 @@ func startPassiveTapper(harWriter *HarWriter, outboundLinkWriter *OutboundLinkWr
} }
} }
if *dumpToHar { harWriter.Start()
harWriter.Start() defer harWriter.Stop()
defer harWriter.Stop()
}
defer outboundLinkWriter.Stop() defer outboundLinkWriter.Stop()
var dec gopacket.Decoder var dec gopacket.Decoder