-
Notifications
You must be signed in to change notification settings - Fork 53
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
solana: add 'dylint' security linting tool #232
Conversation
nice! can you actually add a CI action to this PR so we know when we're done with all the fixes? |
@kcsongor I made an attempt in the latest commit. I don't have experience with GitHub Actions so please let me know if there's a more optimal way of adding these checks. EDIT: Looks like it's working, but actually failing because RUSTFLAGS is set to 'Deny' for clippy warnings -- which is good! But not what we want right now. I'm working on adding a manual override to Allow warnings on only the EDIT2: Actually my first edit makes no sense. That will basically silence the warnings... not what we want. |
7c82116
to
57ee005
Compare
An option would be to set this up as a separate CI action as opposed to putting it into the other solana tests, so it can just be optionally ignored. That being said, these all seem false positives to me, and looking at the other lints it looks like they mostly check for stuff that's otherwise enforced by anchor already. |
Hm, you're right. I was under the impression that they were more Anchor-specific but they do appear to be more targeted toward raw Solana. And agreed that the existing warnings appear to be false positives. I think there's some value in including the tool anyway, in case there is some change that includes a true positive. It adds some noise but in my opinion it's acceptable. It probably shouldn't block PRs so I'm happy to create a separate CI target that is non-blocking but still reports warnings. |
Thinking about this a bit more -- if we do decide to keep the action (which I can see might be a good idea), we should enforce it in CI. Individual false positives can always be silenced on a case by case basis, but if they're left in then over time we'll just stop looking at the output and true positives might easily slip through. That would be very embarrassing 😅 |
Cool that makes sense to me. I'll do my best to resolve all the false positives so this is as painless for others as possible |
57ee005
to
512573c
Compare
Add support for the dylint tool. Configures Cargo.toml to use lints designed to help identify issues in Solana/Anchor code.
512573c
to
7fc8445
Compare
Closing in favour of #234, which will add comments rather than linting. The dylint rules are more appropriate for a plain Solana project, not one that uses Anchor |
Add support for the dylint tool. Configures Cargo.toml to use lints designed to help identify issues in Solana/Anchor code.
This tool adds extra functionality to
clippy
to allow it to flag security issues for us:Integrating this tool could provide helpful, proactive security benefits.
I think it would be good for us to resolve these warnings or else mark them explicitly as false positives and thereby have clippy ignore them.
After that initial effort is done, we can integrate this tool into CI. We can upgrade from warnings to errors, and optionally choose to have our CI pipeline reject any unaddressed discoveries.