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

Provide detailed documentation for each rule #127

Open
mmlb opened this issue Apr 5, 2017 · 16 comments
Open

Provide detailed documentation for each rule #127

mmlb opened this issue Apr 5, 2017 · 16 comments

Comments

@mmlb
Copy link

mmlb commented Apr 5, 2017

It'd be great to have a shellcheck like wiki with some more info on each check, why its bad and what the possible fixes are. If this sounds like a good idea, I can start it off with the minimal info.

@gcmurphy
Copy link
Member

+1 Thanks for the suggestion. Will add this to the backlog.

@gcmurphy gcmurphy changed the title please add shellcheck like wiki Provide detailed documentation for each rule Jan 5, 2018
@ryboe
Copy link

ryboe commented Jul 10, 2018

Can this be given a higher priority? We currently have no idea if the issues reported by gas are real or worth fixing.

See staticcheck.io for inspiration, although a GitHub wiki would be more than enough.

@gcmurphy
Copy link
Member

Just as an update I've created the repository github.com/securego/securego.github.io and registered the securego.io domain for this purpose. I'm hoping to get some spare time to work on this soon.

@gcmurphy gcmurphy self-assigned this Jul 30, 2018
@alukyan
Copy link

alukyan commented Sep 12, 2018

Yes, this is needed. It looks like some rules are too broad to flag.
Example is G304 - gosec flags all lines where we read a file pointed by a variable, like contents, err := ioutil.ReadFile(cacheFile)
What is supposed fix? Hardcode the names?

@MVrachev
Copy link
Contributor

Indeed that's something I think would be great.
The way Bandit (open source security linter for Python) does it is great.
It gives you a field in the json generated output with more info:
image

It would be sooo useful if we have similar thing in Gosec.

@fawkesley
Copy link

What's the status of this issue? Is there any (draft?) content written anywhere? Thanks!

@MVrachev
Copy link
Contributor

I am helping with the documentation. We have documentation for a small subset of the rules you can read more here:
https://securego.io/

@ping035627
Copy link

@MVrachev, excuse me, about "G304: Potential file inclusion via variable ", "ioutil.ReadFile(filename)", what is the right way? I don't find it in https://securego.io/, thanks very much.

@MVrachev
Copy link
Contributor

Yes, we need to work more on the documentation.
I was really busy this last month but I will continue to work on the documentation.

@haroldHT
Copy link

@MVrachev @ping035627 HI, what is the right way to solve 'G304: Potential file inclusion via variable'?

@szuecs

This comment was marked as abuse.

@ccojocar
Copy link
Member

@MVrachev @gcmurphy What's the current status of the documentation? Some rules seem to have some guidelines https://securego.io/docs/rules/rule-intro.html. Are you actively working on adding more docs?

@MVrachev
Copy link
Contributor

I am slowly working on this when I have time.

@Jacalz
Copy link

Jacalz commented Jan 30, 2020

I would like this fixed too. I am having troubles figuring out how to actually fix G304 🙁

@dpritchett
Copy link

Googling G304 led me here. The answer is now added at https://securego.io/docs/rules/g304.html

The fix appears to be "wrap your file path string in a call to filepath.Clean(), e.g.

-                       loadResult.loadCachedJSON(cacheFilePath)
+                       loadResult.loadCachedJSON(filepath.Clean(cacheFilePath))

Thanks for gosec by the way, great tool!

@gliptak
Copy link

gliptak commented Apr 30, 2021

G110 is missing at https://securego.io/docs/rules/g110.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests