Skip to content

Commit

Permalink
update: libveinmind
Browse files Browse the repository at this point in the history
  • Loading branch information
d1nfinite committed May 26, 2022
1 parent 952ba0e commit 0710d58
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/veinmind-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
build-amd64-veinmind-malicious:
runs-on: ubuntu-18.04
container:
image: veinmind/go1.16:1.0.5-stretch
image: veinmind/go1.16:1.1.0-stretch
env:
CI_GOOS: linux
CI_GOARCH: amd64
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-18.04
container:
image: veinmind/go1.16:1.0.5-stretch
image: veinmind/go1.16:1.1.0-stretch
env:
CI_GOOS: linux
CI_GOARCH: amd64
Expand Down
4 changes: 2 additions & 2 deletions veinmind-asset/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM veinmind/go1.18:1.0.5-stretch as builder
FROM veinmind/go1.18:1.1.0-stretch as builder
WORKDIR /build
COPY . .
RUN sed -i 's/\.\.\/veinmind-common/\.\/veinmind-common/g' go.mod
RUN chmod +x script/build.sh && /bin/bash script/build.sh

FROM veinmind/base:1.0.5-stretch as release
FROM veinmind/base:1.1.0-stretch as release
WORKDIR /tool
COPY --from=builder /build/veinmind-asset .
RUN echo "#!/bin/bash\n\n./veinmind-asset \$*" > /tool/entrypoint.sh && chmod +x /tool/entrypoint.sh && chmod +x /tool/veinmind-asset
Expand Down
15 changes: 4 additions & 11 deletions veinmind-asset/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ func ScanImage(image api.Image, parallel int64) (model.ScanImageResult, error) {
var artifactOpt artifact.Option
var analysisOpt analyzer.AnalysisOptions

// 忽略存在seek的jar扫描和go binary扫描
// artifactOpt.DisabledAnalyzers = []analyzer.Type{
disableType := []analyzer.Type{
analyzer.TypeJar,
analyzer.TypeGoBinary,
}

var result []types.BlobInfo
ag := analyzer.NewAnalyzerGroup(artifactOpt.AnalyzerGroup, artifactOpt.DisabledAnalyzers)

Expand All @@ -63,10 +56,10 @@ func ScanImage(image api.Image, parallel int64) (model.ScanImageResult, error) {
if err != nil {
return nil, err
}
return AtempFile{file, nil}, nil
return file, nil
}

ag.AnalyzeFile(ctx, &wg, limit, res, "", path, info, open, disableType, analysisOpt)
ag.AnalyzeFile(ctx, &wg, limit, res, "", path, info, open, nil, analysisOpt)
return nil
})
wg.Wait()
Expand Down Expand Up @@ -104,10 +97,10 @@ func ScanImage(image api.Image, parallel int64) (model.ScanImageResult, error) {
if err != nil {
return nil, err
}
return AtempFile{file, nil}, nil
return file, nil
}

ag.AnalyzeFile(ctx, &wg, limit, res, "", path, info, open, disableType, analysisOpt)
ag.AnalyzeFile(ctx, &wg, limit, res, "", path, info, open, nil, analysisOpt)
return nil
})
wg.Wait()
Expand Down
5 changes: 2 additions & 3 deletions veinmind-asset/cmd/cli.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package main

import (
"os"
"time"

"github.com/aquasecurity/fanal/types"
api "github.com/chaitin/libveinmind/go"
"github.com/chaitin/libveinmind/go/cmd"
Expand All @@ -14,6 +11,8 @@ import (
"github.com/chaitin/veinmind-tools/veinmind-asset/utils"
"github.com/chaitin/veinmind-tools/veinmind-common/go/service/report"
"github.com/spf13/cobra"
"os"
"time"
)

var results = []model.ScanImageResult{}
Expand Down
4 changes: 2 additions & 2 deletions veinmind-asset/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ replace github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-202204260343
require (
github.com/aquasecurity/fanal v0.0.0-20220424145104-2e3e0044128c
github.com/aquasecurity/go-dep-parser v0.0.0-20220422134844-880747206031
github.com/chaitin/libveinmind v1.0.7
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220426034314-a81ea749560f
github.com/chaitin/libveinmind v1.1.0
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220526023645-674f9dea184f
github.com/spf13/cobra v1.4.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
)
Expand Down
5 changes: 4 additions & 1 deletion veinmind-asset/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,11 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chaitin/libveinmind v1.0.7 h1:+kC6Z4y81I9erSmS9tchbOF8ymmBhCKoK82ZoVL4MuQ=
github.com/chaitin/libveinmind v1.0.7/go.mod h1:bUUjhkyZyZ9sTetpm5rOfj5TU3hr5moE3VQM+IgHrbw=
github.com/chaitin/libveinmind v1.1.0 h1:yqFpO1euqZGytN1wDPXJJ5hSAnbMGa5wb3ojf4yDLrQ=
github.com/chaitin/libveinmind v1.1.0/go.mod h1:bUUjhkyZyZ9sTetpm5rOfj5TU3hr5moE3VQM+IgHrbw=
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220526023645-674f9dea184f h1:hix53aJ0ujb23HN7U526T6t1d+8tkuhgx9ZPEAQwmPY=
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220526023645-674f9dea184f/go.mod h1:UdK75T5EhRBbCIaeJzjA3b9kly3uvTvzYITDzwHPQTA=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down
2 changes: 1 addition & 1 deletion veinmind-backdoor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM veinmind/python3:1.0.5-stretch
FROM veinmind/python3:1.1.0-stretch
WORKDIR /tool
ADD . .
RUN pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion veinmind-backdoor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
click==7.1.2
jsonpickle==2.1.0
veinmind==1.0.7
veinmind==1.1.0
2 changes: 1 addition & 1 deletion veinmind-basic/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/chaitin/veinmind-tools/veinmind-basic
go 1.17

require (
github.com/chaitin/libveinmind v1.0.7
github.com/chaitin/libveinmind v1.1.0
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220526023645-674f9dea184f
github.com/distribution/distribution v2.8.1+incompatible
github.com/pkg/errors v0.8.1
Expand Down
2 changes: 1 addition & 1 deletion veinmind-history/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM veinmind/python3:1.0.5-stretch
FROM veinmind/python3:1.1.0-stretch
WORKDIR /tool
ADD . .
RUN pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion veinmind-history/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
click==7.1.2
jsonpickle==2.1.0
pytoml==0.1.21
veinmind==1.0.7
veinmind==1.1.0
2 changes: 1 addition & 1 deletion veinmind-malicious/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM veinmind/base:1.0.5-stretch
FROM veinmind/base:1.1.0-stretch
# install clamav
COPY dockerfiles/sources.list /etc/apt/sources.list
RUN apt update && apt-get install -y clamav clamav-daemon && freshclam
Expand Down
2 changes: 1 addition & 1 deletion veinmind-malicious/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replace github.com/chaitin/veinmind-tools/veinmind-common/go v1.0.0 => ../veinmi
require (
code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5
github.com/VirusTotal/vt-go v0.0.0-20211209151516-855a1e790678
github.com/chaitin/libveinmind v1.0.7
github.com/chaitin/libveinmind v1.1.0
github.com/chaitin/veinmind-tools/veinmind-common/go v1.0.0
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/joho/godotenv v1.4.0
Expand Down
4 changes: 2 additions & 2 deletions veinmind-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM veinmind/go1.16:1.0.5-stretch as builder
FROM veinmind/go1.16:1.1.0-stretch as builder
WORKDIR /build
COPY . .
RUN sed -i 's/\.\.\/veinmind-common/\.\/veinmind-common/g' go.mod
Expand All @@ -10,7 +10,7 @@ FROM veinmind/veinmind-sensitive:latest as sensitive
FROM veinmind/veinmind-history:latest as history
FROM veinmind/veinmind-backdoor:latest as backdoor

FROM veinmind/python3:1.0.5-stretch as release
FROM veinmind/python3:1.1.0-stretch as release
WORKDIR /tool
COPY --from=builder /build/veinmind-runner .
COPY --from=weakpass /tool/veinmind-weakpass .
Expand Down
2 changes: 1 addition & 1 deletion veinmind-runner/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replace github.com/chaitin/veinmind-tools/veinmind-common/go v1.0.0 => ../veinmi
require (
github.com/BurntSushi/toml v0.3.1
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/chaitin/libveinmind v1.0.7
github.com/chaitin/libveinmind v1.1.0
github.com/chaitin/veinmind-tools/veinmind-common/go v1.0.0
github.com/containerd/containerd v1.6.4
github.com/distribution/distribution v2.8.1+incompatible
Expand Down
2 changes: 1 addition & 1 deletion veinmind-sensitive/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM veinmind/python3:1.0.5-stretch
FROM veinmind/python3:1.1.0-stretch
WORKDIR /tool
ADD . .
RUN pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion veinmind-sensitive/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ click==7.1.2
jsonpickle==2.1.0
python_magic==0.4.25
pytoml==0.1.21
veinmind==1.0.7
veinmind==1.1.0
4 changes: 2 additions & 2 deletions veinmind-weakpass/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM veinmind/go1.16:1.0.5-stretch as builder
FROM veinmind/go1.16:1.1.0-stretch as builder
WORKDIR /build
COPY . .
RUN sed -i 's/\.\.\/veinmind-common/\.\/veinmind-common/g' go.mod
RUN chmod +x script/build.sh && /bin/bash script/build.sh

FROM veinmind/base:1.0.5-stretch as release
FROM veinmind/base:1.1.0-stretch as release
WORKDIR /tool
COPY --from=builder /build/veinmind-weakpass .
RUN echo "#!/bin/bash\n\n./veinmind-weakpass \$*" > /tool/entrypoint.sh && chmod +x /tool/entrypoint.sh && chmod +x /tool/veinmind-weakpass
Expand Down
4 changes: 2 additions & 2 deletions veinmind-weakpass/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.16

require (
github.com/Jeffail/tunny v0.1.4
github.com/chaitin/libveinmind v1.0.7
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220519060236-8e2e62c000b9 // indirect
github.com/chaitin/libveinmind v1.1.0
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220519060236-8e2e62c000b9
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.3.0
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
Expand Down
4 changes: 2 additions & 2 deletions veinmind-weakpass/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chaitin/libveinmind v1.0.4 h1:pn4ow8JHTwTDNygieawEGk9k+r0MIEBYuUfVuzz73pk=
github.com/chaitin/libveinmind v1.0.4/go.mod h1:bUUjhkyZyZ9sTetpm5rOfj5TU3hr5moE3VQM+IgHrbw=
github.com/chaitin/libveinmind v1.0.7/go.mod h1:bUUjhkyZyZ9sTetpm5rOfj5TU3hr5moE3VQM+IgHrbw=
github.com/chaitin/libveinmind v1.1.0 h1:yqFpO1euqZGytN1wDPXJJ5hSAnbMGa5wb3ojf4yDLrQ=
github.com/chaitin/libveinmind v1.1.0/go.mod h1:bUUjhkyZyZ9sTetpm5rOfj5TU3hr5moE3VQM+IgHrbw=
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220519060236-8e2e62c000b9 h1:XG1J/H9RbBmXFw16RiCLFkO1Ee++8czk2oJ55P1ADUI=
github.com/chaitin/veinmind-tools/veinmind-common/go v0.0.0-20220519060236-8e2e62c000b9/go.mod h1:UdK75T5EhRBbCIaeJzjA3b9kly3uvTvzYITDzwHPQTA=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down

0 comments on commit 0710d58

Please sign in to comment.