question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Detect matches in build files (like pom.xml) only works if the tag contains Metadata

See original GitHub issue

Is your feature request related to a problem? Please describe. We are trying to create a custom rule that detects dependencies of our libraries in pom.xml or package.json. The rule looks like: { "name": "Our Framework: Java", "id": "OU000000", "description": "Our Framework: Java", "applies_to": [ "pom.xml" ], "tags":[ "Our.Framework.Java" ], "severity": "moderate", "patterns": [ { "pattern": "our-framework", "type": "string", "scopes": [ "all" ], "modifiers": ["i"], "confidence": "high" } ] }

But this rule never matches anything. I read in the documentation (https://github.com/microsoft/ApplicationInspector/wiki/3.5-Tags) that this rule will only work if the tag name contains Metadata. In fact, there are some buit-in rules that will never match anything like: { "name": "Development: Build Tool (Maven)", "id": "AI016800", "description": "Development: Build Tool (Maven)", "applies_to": [ "pom.xml" ], "tags": [ "Development.Build.Maven" ], "severity": "moderate", "patterns": [ { "pattern": "Maven", "type": "regex", "scopes": [ "code", "comment" ], "modifiers": [ "i" ], "confidence": "high" } ] } in https://github.com/microsoft/ApplicationInspector/blob/main/AppInspector/rules/default/frameworks/build.json

Describe the solution you’d like I think that if a rule explicitly applies to a build-type file (like pom.xml), it should match even if the Tag doesn’t contains Metadata, maintaining the restriction for rules that applies to other languages.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ismadirolascommented, Dec 2, 2021

It works. Thanks a lot @gfs !

1reaction
gfscommented, Dec 2, 2021

Please try the new build with the -A argument to see if this resolves your issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find maven-metadata.xml in local during release
I have a local Eclipse RCP project on my Windows machine. One of my remote repositories is used for development and the other...
Read more >
Introduction to build profiles - Apache Maven
Profiles can be activated in the Maven settings, via the <activeProfiles> section. This section takes a list of <activeProfile> elements, each containing a ......
Read more >
POM Reference - Maven
It is an XML representation of a Maven project held in a file named pom.xml . ... A project contains configuration files, as...
Read more >
Settings Reference - Maven
Maven's default settings.xml is a template with comments and examples so you can quickly tweak it to match your needs. Here is an...
Read more >
Troubleshooting AWS CodeBuild
Possible cause: CodeBuild-provided Java build environments include a file named settings. xml that is preinstalled in the build environment's /root/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found