feat(cti): add Cyber Threat Intelligence info (#1442)

* feat(cti): add Cyber Threat Intelligence info

* chore: replace io/ioutil as it is deprecated

* chore: remove --format-csv in stdout writer

* chore(deps): go get go-cti@v0.0.1

* feat(cti): update cti dict(support MITRE ATT&CK v11.1)

* chore(deps): go get go-cti@master
This commit is contained in:
MaineK00n
2022-06-15 08:08:12 +00:00
committed by GitHub
parent 86b60e1478
commit 5234306ded
28 changed files with 4406 additions and 109 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"flag"
"fmt"
"io/ioutil"
"io/fs"
"os"
"path/filepath"
"strings"
@@ -49,8 +49,8 @@ func (p *HistoryCmd) Execute(_ context.Context, _ *flag.FlagSet, _ ...interface{
return subcommands.ExitFailure
}
for _, d := range dirs {
var files []os.FileInfo
if files, err = ioutil.ReadDir(d); err != nil {
var files []fs.DirEntry
if files, err = os.ReadDir(d); err != nil {
return subcommands.ExitFailure
}
var hosts []string

View File

@@ -265,7 +265,6 @@ func (p *ReportCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}
// report
reports := []reporter.ResultWriter{
reporter.StdoutWriter{
FormatCsv: p.formatCsv,
FormatFullText: p.formatFullText,
FormatOneLineText: p.formatOneLineText,
FormatList: p.formatList,

View File

@@ -4,7 +4,7 @@ import (
"context"
"flag"
"fmt"
"io/ioutil"
"io"
"os"
"path/filepath"
"strings"
@@ -127,7 +127,7 @@ func (p *ScanCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{})
if 0 < len(f.Args()) {
servernames = f.Args()
} else if config.Conf.Pipe {
bytes, err := ioutil.ReadAll(os.Stdin)
bytes, err := io.ReadAll(os.Stdin)
if err != nil {
logging.Log.Errorf("Failed to read stdin. err: %+v", err)
return subcommands.ExitFailure