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

Writing custom rules to apply on Dockerfile? #660

Open
JaneX8 opened this issue Dec 5, 2024 · 2 comments
Open

Writing custom rules to apply on Dockerfile? #660

JaneX8 opened this issue Dec 5, 2024 · 2 comments
Labels

Comments

@JaneX8
Copy link

JaneX8 commented Dec 5, 2024

Describe the bug
Can I write custom rules that match Dockerfile? For docker-compose.yml files I suppose I can just use "applies_to": ["yaml"] but for Dockerfile (without file extension) is this possible?

@JaneX8 JaneX8 added the bug label Dec 5, 2024
@JaneX8
Copy link
Author

JaneX8 commented Dec 6, 2024

If this is not yet possible. Maybe a solution for custom rules could be another type of matcher. Not based on file extension but exact filename. This could be helpful for such cases like Dockerfile.

@gfs
Copy link
Contributor

gfs commented Dec 6, 2024

Have you tried with applies_to_file_regex? File types are determined by extension, so I'm not sure its possible to define a something in the languages.json (to use the regular applies_to field that would do this without code changes), but I think it should work when using the file regex.

https://github.com/microsoft/ApplicationInspector/blob/c84796ae8120f835165bc98d182fa9fb9540e87d/AppInspector.RulesEngine/Rule.cs#L83

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

No branches or pull requests

2 participants