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

Reapply "Add rules for pytorch config best practices" #64

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GrosQuildu
Copy link
Collaborator

@GrosQuildu GrosQuildu marked this pull request as draft July 8, 2024 08:11
Copy link
Collaborator Author

@GrosQuildu GrosQuildu left a comment

Choose a reason for hiding this comment

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

I would expand error message in all rules to describe what the problem is and what actions devs should take.
I would adjust categories, severities and impacts, as it seems we are overestimating/

And pls add tests: we can add artificial path to the included paths so tests can be detected. Also review CONTRIBUTING file for linting etc

@@ -0,0 +1,18 @@
rules:
- id: pytorch-allowed-urls
message: Allowing URLs via environment variables is enabled
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why is this bad? What is more secure alternative?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We set impact to medium, but I don't see exploit scenario

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If it's not always exploitable maybe let's set category to best-practice?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed, category should be best practice here; that was my intention with this rule but I didn't realize it was an available option. I'll make this change — in fact I think it applies to some other rules in here as well.

include:
- 'config.properties'
patterns:
- pattern-regex: |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is a strange bug that this rule will find issue in the following:

inference_address=https://127.0.0.1:8443




job_queue_size=2

May be semgrep's issue we may report

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

Successfully merging this pull request may close these issues.

2 participants