Skip to content

[INT-2037] Qualys v3.4.0: Relax QID regex + Add editable Custom Type - #21

Closed
deeedub wants to merge 15 commits into
support/v1from
int-2037-qualys-v3-4-0-qid-regex-custom-type
Closed

[INT-2037] Qualys v3.4.0: Relax QID regex + Add editable Custom Type#21
deeedub wants to merge 15 commits into
support/v1from
int-2037-qualys-v3-4-0-qid-regex-custom-type

Conversation

@deeedub

@deeedub deeedub commented Jun 12, 2026

Copy link
Copy Markdown

Summary

This PR implements two changes targeting the v1 CMS store release (v3.4.0) of the Qualys integration. Both changes are branched from commit ad992165 (tag 3.3.3).

Linear ticket: https://linear.app/polarity/issue/INT-2037


Feature 1 — QID Regex Relaxation

Updates the QID custom type regex to support all common spacing variants:

Format Before After
QID:12345
QID: 12345
QID 12345
QID : 12345

config/config.jsoncustomTypes[0].regex:

  • Before: (?:QID|qid):\s*\d{1,8}
  • After: (?:QID|qid)(?:\s*:\s*|\s+)\d{1,8}

src/getLookupResults.ts — QID value extraction:

  • Replaced flow(split(':'), last, trim)(entity.value) with regex-based extraction: (/(?:QID|qid)(?:\s*:\s*|\s+)(\d{1,8})/i.exec(entity.value)?.[1] ?? entity.value)
  • This correctly handles the new spacing variants and removes the now-unused trim import

Feature 2 — Editable Custom Type

Adds a second custom type entry (customType) that admins can configure with their own regex pattern. The integration extracts the numeric QID from each match using the new customTypeValueRegex option.

Files changed:

  • config/config.json — added customType entry to customTypes array; added customTypeValueRegex option
  • src/getLookupResults.ts — added customType branch: applies options.customTypeValueRegex (default \d+$) to extract numeric QID
  • src/querying/queryHostDetectionListForAllEntities.tsqidEntities filter now includes customType entities
  • src/constants.tsQUERY_PATHS_BY_TYPE.customType = QUERY_PATHS_BY_TYPE.qid (enables asset/vulnerability queries for customType)
  • src/validateOptions.ts — added validateCustomTypeValueRegex export; validates regex syntax when option is non-empty
  • src/integration.ts — wires validateCustomTypeValueRegex into the validateOptions pipeline

Versioning

  • package.json: 4.0.03.4.0 (v1 CMS store requires 3.x versioning)

Packaging Note

Releases must be built with npm ci --omit=dev --no-bin-links + tar -h to dereference symlinks and prevent unsafe_symlink errors on customer servers.

sarus and others added 12 commits May 13, 2026 21:10
- Convert integration.js to TypeScript (src/integration.ts)
- Replace postman-request with polarity-integration-utils
- Convert Ember/Handlebars component to Lit web component (web-components/details.ts)
- Update config.json (runtimeVersion 2, dataTypes, webComponents)
- Fix credential leakage in error logging (security review)
- Sanitize parseErrorToReadableJSON to strip auth from serialized errors
- Remove v1 files (integration.js, config/config.js, components/, templates/, styles/)
- Version 4.0.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The closing tag </pi-external-link was split across two lines, causing a
literal > to render after each external link in link lists. Restructure
the template so the closing bracket stays on the same line as the tag
name, and add a prettier-ignore comment to prevent reformatting.

Addresses PR review feedback for #18

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Server tests (17):
- startup initialization
- doLookup with valid host detection results
- doLookup returning null for empty/miss results
- Multiple entity handling
- Ignored IP filtering (127.0.0.1, etc.)
- Request options verification
- Error propagation (API errors, non-Error throws)
- QID custom type entity support
- validateOptions for all fields and URL validation

Web component tests (16):
- Renders host detection data correctly
- Handles empty/undefined details gracefully
- Key-value pair rendering
- Title fields with showLabelAndValue
- Date formatting
- Collapsible list items (collapsed by default)
- HTML content in expandable sections
- Copy button presence
- Section breaks
- Single tab vs multi-tab rendering
- Empty tab filtering
- Copyable fields with copy button
- External links via pi-external-link
- List of links rendering

Also adds resolve aliases to vitest.config.ts to fix
polarity-integration-utils ESM resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Initial V2 Framework Release
@CitadelOfBlairs

CitadelOfBlairs commented Jun 12, 2026

Copy link
Copy Markdown

Snyk checks have failed. 1 issues have been found so far.

Status Scan Engine Critical High Medium Low Total (1)
Open Source Security 0 0 1 0 1 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@deeedub
deeedub changed the base branch from master to support/v1 June 12, 2026 15:19
@deeedub deeedub closed this Jun 12, 2026
@deeedub deeedub reopened this Jun 12, 2026
@deeedub deeedub closed this Jun 12, 2026
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.

3 participants