Comments (10)
Pretty neat! What do you need the json output for? Wondering if we can find a tool that allows you to output to multiple types, not just json.
from nancy.
Pretty neat! What do you need the json output for? Wondering if we can find a tool that allows you to output to multiple types, not just json.
i think you are onto something with multiple types of output. I assume the ask for JSON is to have something that is a little more machine readable make producing a slack message or something like that from the output. But also something that comes to mind is maybe a csv format that could be sent off to security teams when nancy finds a vulnerability.
from nancy.
The use case I'm looking for is somewhat similar to what @zendern has mentioned. The output in JSON format makes it more readable and with future requirements arising for sending/using this data in JSON format increases flexibility as most languages/frameworks support JSON. Nonetheless, it will be useful to everyone in many use cases. cc @DarthHater
from nancy.
Thinking about picking this up some time this week @DarthHater. Probably was going to do something like so. Thoughts??
- Introduce a new
-output
flag, defaulting totext
to be backwards compatible. -output
would allow for the following outputs.text
,json
,csv
and maybetable
text
- would look exactly as it does today- implementation wise it would just be extracting out what we have currently in here to now return a struct.
- Using that struct we would simple just create classes to do the different output formats. I know you mentioned finding a library to do it for us but I've yet to find one but should be simple enough to just use mostly what go provides and use what we have. And if we decided
table
makes sense maybe pull in that library.
text
- being what we have in auditlog.go basicallyjson
- using https://golang.org/pkg/encoding/json/ b/c we will just have a struct nowcsv
- using https://golang.org/pkg/encoding/csv/- maybe
table
- using https://github.com/olekukonko/tablewriter to give a fancy table formatted output
from nancy.
All of that sounds great, I'm wondering if we should do HTML instead of table (so someone can create an artifact, similar to CSV).
I was more curious if you could use logrus to output everything, since it takes different formatters, and can use an io.Writer
https://github.com/sirupsen/logrus
from nancy.
All of that sounds great, I'm wondering if we should do HTML instead of table (so someone can create an artifact, similar to CSV).
I was more curious if you could use logrus to output everything, since it takes different formatters, and can use an
io.Writer
That seems like a reasonable library to try to use. Looking at it on the surface JSON, TEXT, CSV should be pretty straightforward. Whereas an HTML table might be more interesting/harder to do with that library.
from nancy.
Hi! Is there any way that I could lend a hand in getting this merged & released?
from nancy.
@tweedge if you want to take a look at the merge conflicts on the pr that would help it along quicker. If not I'll try to get to it some time this week.
Also a set of eyes/any feedback on the new output formats could help as well to make sure we have what you might need/be looking for.
from nancy.
I'll see if I can jump in. I'm doing some Nancy work right now anyways, and I'd love to get another @zendern classic merged in :)
from nancy.
@DarthHater the merge conflicts in #57 should be good to go now if you want to take a peek.
from nancy.
Related Issues (20)
- Add SARIF support HOT 1
- fix dpkg warning: missing 'Maintainer' field
- TLS Handsake Timeout error HOT 2
- Nancy produces invalid JSON again and again [bug] HOT 1
- False positive due to circular dependency HOT 4
- Homebrew: Calling bottle :unneeded is deprecated HOT 3
- Running nancy in Azure DevOps requires bash to be present in the image HOT 4
- Nancy does not respect replace directive HOT 1
- Replace directive is based on the to be replaced module path not the one which replacing it HOT 4
- Q. has any thought been given to scanning for core library vulnerabilities? HOT 2
- go install does not work - complains about replace directive HOT 3
- Install failed with go 1.18 on darwin HOT 3
- Wrong brew tap on gonancy.dev HOT 1
- Is returning 500 error when accessing OSS Index HOT 20
- Update version string to have "v" prefix expected by OSSIndex
- Task execution failure HOT 1
- Subpackages with different versions are incorrectly flagged HOT 8
- Readme: Relation to govulncheck HOT 3
- Wrongly reports runc 1.1.5 as vulnerable
- Fails to install because of github.com/golang/dep
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nancy.