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

Fix security issues and warnings (and improve code styling) #893

Closed
sebastian-meyer opened this issue Jan 30, 2023 · 13 comments · Fixed by #1032, #1037, #1038, #1041 or #1043
Closed

Fix security issues and warnings (and improve code styling) #893

sebastian-meyer opened this issue Jan 30, 2023 · 13 comments · Fixed by #1032, #1037, #1038, #1041 or #1043
Assignees
Labels
⭐ development fund 2023 A candidate for the Kitodo e.V. development fund. 💰 funded A feature funded by the Kitodo e.V. development fund. 🛠 maintenance A task to keep the code up-to-date and manageable.

Comments

@sebastian-meyer
Copy link
Member

sebastian-meyer commented Jan 30, 2023

Description

We are using some industry-standard static code analyzers for code and security scanning like Dependabot, CodeQL and Codacy. Those tools produced a lot of warnings of different severities from "Note" to "High".

This proposal's goal is to fix at least all security related issues. Those are currently:

Furthermore there are a lot of code-style related issues. The issues with severity "Warning" or higher should at least be assessed and fixed if this can be done with reasonable effort (most of them are duplicates, i. e. multiple occurences of the same issue). Those are currently:

Related Issues

The security alerts can be found on the security tab.

Expected Benefits of this Development

This proposal would make Kitodo.Presentation more stable and secure. It would also eliminate the abundance of security messages, making it easier to identify new problems as they arise.

Estimated Costs and Complexity

The complexity is medium and the cost are low (2-3 days).

@sebastian-meyer sebastian-meyer added the ⭐ development fund 2023 A candidate for the Kitodo e.V. development fund. label Jan 30, 2023
@sebastian-meyer sebastian-meyer changed the title [FUND] Fix security issues and warnings [FUND] Fix security issues and warnings (and improve code styling) Feb 23, 2023
@stweil
Copy link
Member

stweil commented Mar 9, 2023

Only "members" of the Kitodo organization or the repository can see the security related pages which are mentioned above. I was member in 2017, but obviously removed later.

@sebastian-meyer
Copy link
Member Author

Access can only be granted to admins, members with push rights and specific user groups. I'd have to create a user group and add all current outside collaborators to that group... :o(

@stweil
Copy link
Member

stweil commented Mar 10, 2023

It's not a real problem for me personally, because my fork runs the same security checks and reports them (so the whole GitHub concept of hiding the security reports is strange and wasting energy for unnecessary computations).

@sebastian-meyer sebastian-meyer added the 🛠 maintenance A task to keep the code up-to-date and manageable. label Mar 20, 2023
@sebastian-meyer
Copy link
Member Author

Votes: 11

@sebastian-meyer sebastian-meyer added the 💰 funded A feature funded by the Kitodo e.V. development fund. label Apr 20, 2023
@sebastian-meyer sebastian-meyer changed the title [FUND] Fix security issues and warnings (and improve code styling) Fix security issues and warnings (and improve code styling) Jul 21, 2023
@frank-ulrich-weber
Copy link
Collaborator

Can you please give me access to the security tab to fix the issues and warnings? Thanks!

@stweil
Copy link
Member

stweil commented Sep 11, 2023

It's usually sufficient to fork the repository and use the security tab in your own fork (see my comment above). Then you can either use the fixes which are generated by CodeQL or manual fixes to create a pull request.

@sebastian-meyer
Copy link
Member Author

Can you please give me access to the security tab to fix the issues and warnings? Thanks!

I've granted you the security manager role. You should be able to access the security tab now.

@frank-ulrich-weber
Copy link
Collaborator

Thanks Stefan and Sebastian, that helps a lot!

@frank-ulrich-weber
Copy link
Collaborator

I think I'm blind, but now I see 40 security issues on my current fork of the kitodo-presentation master: What do I have to do/configure to see the same amount of issues? How can I apply the same checks on a branch? I think I yust need a hint... Thanks!

@stweil
Copy link
Member

stweil commented Feb 3, 2024

GitHub code scanning currently reports 7 warnings and more than 6000 notes for the master branch.

@sebastian-meyer
Copy link
Member Author

I don't see any notes and of the warnings we decided to ignore all that are reported for the 3D viewer javascripts (because those are still in a prototypical state and under heavy development). I've forwarded them to the developers and they will take care of those.
So, for me this looks fine, now.

@stweil
Copy link
Member

stweil commented Feb 27, 2024

I don't see any notes

Then go to settings/security_analysis and look for "Code scanning" and "Protection rules". There you can set the alert severity levels. Set both levels to "any" to get all the notes, too. Not all kinds of notes are useful, but some of them are.

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