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: false postive - metadata service check templates #10543

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daffainfo
Copy link
Contributor

Added more matcher to metadata service check templates

@DhiyaneshGeek
Copy link
Member

Hi @daffainfo are these changes validated locally ?

@daffainfo
Copy link
Contributor Author

daffainfo commented Aug 16, 2024

@DhiyaneshGeek i didnt test all of the template but all of them are based from documentation between each services, for example:

We found that almost all metadata-* templates have very few matchers (only 1 - 2 words and the value matcher condition is or not and, this can lead to false positive result)

@DhiyaneshGeek
Copy link
Member

Hi @daffainfo

can you share a FP target over discord (#geekfreak)

Looking forward to see you there

Thanks

@daffainfo
Copy link
Contributor Author

@DhiyaneshGeek I can't give you the target because it is confidential but I can show you the reason why I need to change some of the matcher. I got some fp, especially when using metadata-google.yaml template. When I saw the matcher:

      - type: word
         part: body
         words:
           - "attributes"

The matcher only checks if there is an attribute string in the response body or not. And when using --debug to find why this template always producing false positive, my target returns a 404 status code and also has an attribute string in the response body which results in a false positive. And then, I checked other metadata-*.yaml template and it also has a very bad matcher, which relies on generic keywords like attributes etc
image

@DhiyaneshGeek
Copy link
Member

Hi @daffainfo

Is metadata-google.yaml is it running it on a GCP host itself ?

if there is something updated on the GCP Metadata documentation, we can review and update the template accordingly

Looking forward to hear back from you

Thanks

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

Successfully merging this pull request may close these issues.

2 participants