Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the XML output #240

Merged
merged 1 commit into from
Nov 7, 2016
Merged

Conversation

gleentea
Copy link
Contributor

@gleentea gleentea commented Nov 1, 2016

Add the XML output in order to facilitate cooperation with other tools.

@kotakanbe
Copy link
Member

kotakanbe commented Nov 2, 2016

Please fix glide.lock

diff --git a/glide.lock b/glide.lock
index 103a827..1742371 100644
--- a/glide.lock
+++ b/glide.lock
@@ -69,7 +69,7 @@ imports:
 - name: github.com/k0kubun/pp
   version: f5dce6ed0ccf6c350f1679964ff6b61f3d6d2033
 - name: github.com/kotakanbe/go-cve-dictionary
-  version: 4daeddcd31acdf75cf8454ec976718a09e9640f6
+  version: 70989b6709c3102924ad8c8483e9bdc99bcb598b
   subpackages:
   - config
   - db

@gleentea gleentea force-pushed the feature/report-xml branch 2 times, most recently from 2dfb2f5 to 5f6d806 Compare November 2, 2016 06:24
)

const (
VulsOpenTag = "<vulsreport>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change const name to vulsOpenTag, vulsCloseTag

Lint error is Occurred.

➜  vuls git:(xml) make lint

report/xml.go:15:2: exported const VulsOpenTag should have comment (or a comment on this block) or be unexported

)

// XMLDirs array of xml files path.
type XMLDirs []string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XML Dirs is unused.
Please remove this.

return fmt.Errorf("Failed to Marshal to XML: %s", err)
}

allBytes := bytes.Join([][]byte{[]byte(xml.Header + VulsOpenTag), xmlBytes, []byte(VulsCloseTag)},[]byte{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply go fmt to format this source code.

$ cd /path/to/vuls
$ make fmt

@@ -700,11 +703,11 @@ Defaults:vuls !requiretty
| empty password | - | |
| with password | required | or use ssh-agent |

## -report-json , -report-text option
## -report-json , -report-text , -report-xml option

結果をファイルに出力したい場合に指定する。出力先は、`$PWD/result/current/`
`all.(json|txt)`には、全サーバのスキャン結果が出力される。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません、all.jsonは廃止されたので、all.jsonの下りを削除していただけますか。(私の修正漏れです)


At the end of the scan, scan results will be available in the `$PWD/result/current/` directory.
`all.(json|txt)` includes the scan results of all servers and `servername.(json|txt)` includes the scan result of the server.
`all.(json|txt)` includes the scan results of all servers and `servername.(json|txt|xml)` includes the scan result of the server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all.json no kudari wo keshite kudasai

add struct tag for encoding/xml

update README

update glide.lock
@gleentea
Copy link
Contributor Author

gleentea commented Nov 4, 2016

I applied golint/gofmt and update README.
Please re-review PR.

@kotakanbe kotakanbe merged commit 159f261 into future-architect:master Nov 7, 2016
@kotakanbe
Copy link
Member

LGTM :)
Many Thanks!

@gleentea gleentea deleted the feature/report-xml branch November 7, 2016 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants