[INT-2037] Qualys v3.4.0: Relax QID regex + Add editable Custom Type - #21
Closed
deeedub wants to merge 15 commits into
Closed
[INT-2037] Qualys v3.4.0: Relax QID regex + Add editable Custom Type#21deeedub wants to merge 15 commits into
deeedub wants to merge 15 commits into
Conversation
- 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>
v2 Migration: qualys
Initial V2 Framework Release
…dd customTypeValueRegex option
⛔ Snyk checks have failed. 1 issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(tag3.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:
QID:12345QID: 12345QID 12345QID : 12345config/config.json—customTypes[0].regex:(?:QID|qid):\s*\d{1,8}(?:QID|qid)(?:\s*:\s*|\s+)\d{1,8}src/getLookupResults.ts— QID value extraction: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)trimimportFeature 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 newcustomTypeValueRegexoption.Files changed:
config/config.json— addedcustomTypeentry tocustomTypesarray; addedcustomTypeValueRegexoptionsrc/getLookupResults.ts— addedcustomTypebranch: appliesoptions.customTypeValueRegex(default\d+$) to extract numeric QIDsrc/querying/queryHostDetectionListForAllEntities.ts—qidEntitiesfilter now includescustomTypeentitiessrc/constants.ts—QUERY_PATHS_BY_TYPE.customType = QUERY_PATHS_BY_TYPE.qid(enables asset/vulnerability queries for customType)src/validateOptions.ts— addedvalidateCustomTypeValueRegexexport; validates regex syntax when option is non-emptysrc/integration.ts— wiresvalidateCustomTypeValueRegexinto thevalidateOptionspipelineVersioning
package.json:4.0.0→3.4.0(v1 CMS store requires 3.x versioning)Packaging Note
Releases must be built with
npm ci --omit=dev --no-bin-links+tar -hto dereference symlinks and preventunsafe_symlinkerrors on customer servers.