# Custom Vulnerability Check

**URL:** <https://discuss.rapid7.com/t/custom-vulnerability-check/13055>\
**Category:** InsightVM\
**Tags:** InsightVM, vulnerability-management\
**Created:** [June 20, 2022, 1:33pm UTC](https://discuss.rapid7.com/t/custom-vulnerability-check/13055 "2022-06-20T13:33:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/adrian/32/587_2.png) [@Adrian](https://discuss.rapid7.com/u/Adrian)\
**Post date:** [June 20, 2022, 1:33pm UTC](https://discuss.rapid7.com/t/custom-vulnerability-check/13055/1 "2022-06-20T13:33:52Z")

</div>

Hello! Can someone please help with a hint?  
I’m using the following custom vuln check but I get this error message when I check the results  
 ![image](https://forum-uploads-hub-prod-1-us-east-1-rapid7-com.s3.dualstack.us-east-1.amazonaws.com/original/2X/c/c61730c3753ba9fcafd9568c00023673a1c41818.png)

I’m not sure what is wrong here.  
 ![image](https://forum-uploads-hub-prod-1-us-east-1-rapid7-com.s3.dualstack.us-east-1.amazonaws.com/original/2X/c/c13de694128d51ead16b9bb3d99db3c2a3dc3537.png)

---

<div class="post-metadata">

**Author:** ![brian\_w\_gray](https://discuss.rapid7.com/user_avatar/discuss.rapid7.com/brian_w_gray/32/112_2.png) [@brian\_w\_gray](https://discuss.rapid7.com/u/brian_w_gray)\
**Post date:** [August 28, 2024, 7:28pm UTC](https://discuss.rapid7.com/t/custom-vulnerability-check/13055/2 "2024-08-28T19:28:42Z")

</div>

I know this is a really old topic but I can’t just leave these check questions un-answered. In this case the “scope” can only be `endpoint` or `node` based on the xml schema validation.

```bash
xmllint --noout --schema xsd/vulnerability-check.xsd remote-checks/cmty-macro-enabled-excel.vck
remote-checks/cmty-macro-enabled-excel.vck:1: element VulnerabilityCheck: Schemas validity error : Element 'VulnerabilityCheck', attribute 'scope': [facet 'enumeration'] The value 'check' is not an element of the set {'endpoint', 'node'}.
remote-checks/cmty-macro-enabled-excel.vck fails to validate

```

So going with something like setting scope to `endpoint` should validate properly.

- endpoint: Typically used if the check is meant for a specific device or host.
- node: Usually used if the check is for a network or broader scope.

```xml
<VulnerabilityCheck id="macro-enabled-excel" scope="endpoint">
  <WindowsRegistry>
    <registryKey name="HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\office\16.0\excel\security\XI4MacroWarningFollOwVBA" mustNotBePresent="1">
      <registryValue name="Macro Enabled">
        <regex cflags="REG_ICASE">.*</regex>
      </registryValue>
    </registryKey>
  </WindowsRegistry>
</VulnerabilityCheck>

```

```bash
xmllint --noout --schema xsd/vulnerability-check.xsd remote-checks/cmty-macro-enabled-excel.vck
remote-checks/cmty-macro-enabled-excel.vck validates

```
