Skip to content

Commit

Permalink
Fix fluentbit build #745
Browse files Browse the repository at this point in the history
  • Loading branch information
noboruma committed Dec 14, 2022
1 parent 80853f3 commit f662840
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 36 deletions.
2 changes: 1 addition & 1 deletion deepfence_agent/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ building_image(){
fi

echo "Building Fluentbit deepfence output plugin"
docker run --rm -it -v $(pwd):/go/src/github.com/deepfence/deepfence_agent:rw --net=host $IMAGE_REPOSITORY/deepfence_agent_build_ce:${DF_IMG_TAG:-latest} bash -x /home/deepfence/deepfence-out-plugin-build.sh
docker run --rm -it -v $(pwd)/../deepfence_server_client:/go/src/github.com/deepfence/deepfence_server_client -v $(pwd)/../deepfence_utils:/go/src/github.com/deepfence/deepfence_utils -v $(pwd):/go/src/github.com/deepfence/deepfence_agent:rw --net=host $IMAGE_REPOSITORY/deepfence_agent_build_ce:${DF_IMG_TAG:-latest} bash -x /home/deepfence/deepfence-out-plugin-build.sh
build_result=$?
if [ $build_result -ne 0 ]
then
Expand Down
8 changes: 2 additions & 6 deletions deepfence_agent/build/deepfence-out-plugin-build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/bin/bash

cp -R tools/apache/fluentbit/out_deepfence /tmp
cd /tmp/out_deepfence
cd tools/apache/fluentbit/out_deepfence
make

cd /go/src/github.com/deepfence/deepfence_agent
cp /tmp/out_deepfence/out_deepfence.so ./tools/apache/fluentbit/out_deepfence/
cd -
4 changes: 2 additions & 2 deletions deepfence_agent/tools/apache/fluentbit/out_deepfence/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ all:
go mod tidy -v && go build -buildmode=c-shared -o out_deepfence.so

clean:
rm -rf *.so *.h *~
rm -rf ./*.so ./*.h

docker:
docker build -t fluentbit:deepfence .

run: all
$(FLUENT_BIT) -c local-fluent-bit.conf
$(FLUENT_BIT) -c local-fluent-bit.conf
50 changes: 23 additions & 27 deletions deepfence_ingester/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,29 @@ import (
)

type Secret struct {
DocId string `json:"doc_id"`
Timestamp string `json:"@timestamp"`
Count int `json:"count,omitempty"`
Reason string `json:"reason"`
Resource string `json:"resource"`
Status string `json:"status"`
Region string `json:"region"`
AccountID string `json:"account_id"`
Group string `json:"group"`
Service string `json:"service"`
Title string `json:"title"`
ComplianceCheckType string `json:"compliance_check_type"`
CloudProvider string `json:"cloud_provider"`
NodeName string `json:"node_name"`
NodeID string `json:"node_id"`
ScanID string `json:"scan_id"`
Masked string `json:"masked"`
Type string `json:"type"`
ControlID string `json:"control_id"`
Description string `json:"description"`
Severity string `json:"severity"`
}

type SecretStruct struct {
Rule map[string]interface{} `json:"Rule"`
Severity map[string]interface{} `json:"Severity"`
Match map[string]interface{} `json:"Match"`
DocId string `json:"doc_id"`
Timestamp string `json:"@timestamp"`
Count int `json:"count,omitempty"`
Reason string `json:"reason"`
Resource string `json:"resource"`
Status string `json:"status"`
Region string `json:"region"`
AccountID string `json:"account_id"`
Group string `json:"group"`
Service string `json:"service"`
Title string `json:"title"`
ComplianceCheckType string `json:"compliance_check_type"`
CloudProvider string `json:"cloud_provider"`
NodeName string `json:"node_name"`
NodeID string `json:"node_id"`
ScanID string `json:"scan_id"`
Masked string `json:"masked"`
Type string `json:"type"`
ControlID string `json:"control_id"`
Description string `json:"description"`
Rule map[string]interface{} `json:"Rule"`
Severity map[string]interface{} `json:"Severity"`
Match map[string]interface{} `json:"Match"`
}

func (s *BulkProcessor) processSecrets(tenantID string, secret []byte) {
Expand Down

0 comments on commit f662840

Please sign in to comment.