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

@@ -2,7 +2,7 @@ package parser
import (
"encoding/xml"
"io/ioutil"
"io"
"os"
"strings"
@@ -41,7 +41,7 @@ func Parse(path string) ([]string, error) {
}
defer file.Close()
b, err := ioutil.ReadAll(file)
b, err := io.ReadAll(file)
if err != nil {
log.Warnf("Failed to read OWASP Dependency Check XML: %s", path)
return []string{}, nil

View File

@@ -5,7 +5,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
@@ -39,7 +38,7 @@ func main() {
}
trivyJSON = buf.Bytes()
} else {
if trivyJSON, err = ioutil.ReadFile(jsonFilePath); err != nil {
if trivyJSON, err = os.ReadFile(jsonFilePath); err != nil {
fmt.Printf("Failed to read file. err: %+v\n", err)
os.Exit(1)
}