Commit e55e1d3
feat(power-pages): add security skills (#151)
* feat(security-review): add HTML report generation and supporting documentation
- Introduced a new HTML report template for security reviews, providing a structured overview of findings, scores, and recommendations.
- Created a script (`render-review.js`) to render the HTML report from JSON data files.
- Added documentation for the seven-step conversation flow used in the security review process.
- Included a glossary of technical terms relevant to the security review findings.
- Defined the data format for sections and findings to ensure consistency in report generation.
* feat(security-review): enhance security review flow and parallelize sub-skill execution
* Refactor manage-code-scan and manage-site-scan skills for clarity and consistency
- Updated terminology in SKILL.md files to replace "quick/deep" with "basic/advanced" for better understanding.
- Adjusted command parameters in commands.md to reflect new terminology.
- Removed get-security-score.js script as its functionality is no longer needed.
- Simplified start-deep-scan.js to eliminate unnecessary username/password parameters.
- Enhanced review-security skill to streamline user interactions and improve clarity in reporting.
- Updated HTML report to remove score display and adjust layout for better readability.
- Revised flow.md and section-data-format.md to align with the latest changes in skill behavior and reporting structure.
* fix(security-review): update terminology for clarity in security review steps
* refactor(manage-site-scan): update descriptions and remove quick scan script for clarity and consistency
* feat(security-review): add HTML report generation and supporting documentation
- Introduced a new HTML report template for the security review skill, providing a structured overview of findings, summaries, and next steps.
- Created a script to render the HTML report from JSON data, ensuring required keys are validated.
- Added documentation for the seven-step conversation flow used in the security review process.
- Included a glossary of technical terms relevant to the security review findings.
- Defined the data format for sections and findings to standardize report generation.
* Add scan-site skill and related scripts for Power Pages security scanning
- Implemented `scan-site` skill to perform security scans on deployed Power Pages sites.
- Created scripts for starting deep scans, polling scan status, and fetching latest reports.
- Added command reference documentation for the new scan-site functionality.
- Updated existing security review skill to integrate with the new scan-site capabilities.
- Introduced `run-trivy.js` script for scanning code dependencies and vulnerabilities.
* refactor(skills): remove progress tracking tables from manage-firewall, manage-headers, and scan-site skills for clarity
* refactor(manage-firewall, manage-headers, scan-code, scan-site, security-review): standardize JSON formatting and improve clarity in user prompts
* refactor(manage-firewall): enforce rule naming conventions and update examples for clarity
* Refactor firewall management scripts and documentation
- Deleted outdated rule cookbook documentation and replaced it with a new rule reference document that provides a comprehensive guide on creating and managing firewall rules.
- Updated scripts for deleting, enabling, disabling, and retrieving firewall rules to use the Power Platform API instead of the Admin API.
- Enhanced error handling and output formatting in the get-rules and get-status scripts.
- Modified set-rules script to accept inline JSON data for rule creation and updates, improving usability.
- Added timeout settings for rule deletion and creation to accommodate longer processing times.
* Refactor scan-site scripts to use Power Platform API; update command documentation and add scan reference schema
- Changed admin-api references to power-platform-api in scripts: get-latest-report.js, poll-deep-scan.js, start-deep-scan.js.
- Updated command documentation to reflect changes in output and usage.
- Added scan-reference.md for detailed schema of scan report and alert normalization.
- Improved error handling and response structures in get-latest-report.js and poll-deep-scan.js.
* Add headers reference documentation and remove obsolete scripts
- Created a new documentation file for headers reference detailing site settings and response headers in Power Pages.
- Removed the `inspect-headers.js` script as it is no longer needed.
- Removed the `scan-external-urls.js` script due to redundancy.
- Updated the `SKILL.md` and `commands.md` files to clarify rate limits and scan statuses.
- Adjusted severity mapping in `scan-reference.md` to align with API values.
* refactor(manage-headers): enhance security recommendations and clarify CSP directives
* refactor(manage-headers): update skill tracking instructions for clarity and brevity
* Refactor scan-code commands and tool installation documentation
- Simplified command descriptions and usage for `check-tools.js`, `run-opengrep.js`, and `run-trivy.js`.
- Updated output format to return JSON directly to stdout instead of writing to files.
- Removed the tool installation guide as a separate document; now users are instructed to install tools based on `check-tools.js` output.
- Enhanced error handling and timeout settings in `check-tools.js`, `run-opengrep.js`, and `run-trivy.js`.
- Adjusted the security review skill documentation to reflect changes in workflow and terminology.
* refactor(scan-code): update scan depth options and enhance trivy command flags
* refactor(security-review): improve clarity and consistency in documentation and remove obsolete glossary
* fix(scan-code): clarify description for Basic risk coverage in user prompts
* Refactor security review and scan report scripts
- Added a new script `render-review.js` to generate security review HTML reports from JSON data.
- Removed the obsolete `render-scan-report.js` script.
- Updated documentation in `manage-firewall` skill to reflect changes in JSON structure and usage.
- Standardized example usage across various scripts to replace `<guid>` with `<portal-id>`.
- Enhanced `run-opengrep.js` and `run-trivy.js` to output raw JSON directly, removing unnecessary parsing.
- Deleted the `section-data-format.md` reference file as it was no longer needed.
- Removed the old `render-review.js` script from the security review skill, consolidating functionality into the new script.
* Enhance scan-code and scan-site skills with unified JSON output and transformation scripts
- Updated scan-code skill to save raw JSON outputs from opengrep and trivy to temporary files, and introduced a new transform script to normalize findings into a unified format.
- Revised documentation for scan-code to reflect changes in output handling and normalization process.
- Added transform-report script for scan-site to convert deep-scan reports into a unified findings shape, including detailed severity mapping.
- Improved scan-site skill documentation to clarify the fetching and transformation of reports, including handling of empty report cases.
- Updated security-review skill to ensure findings are processed verbatim from transform scripts, with clear policies on severity and annotations for inventory sections.
* fix: update usage examples to replace <guid> with <portal-id> in scripts and documentation
* Refactor scan-code functionality: remove scripts and documentation
- Deleted the following scripts: check-tools.js, run-opengrep.js, run-trivy.js, transform-scan-code.js.
- Removed associated documentation from commands.md.
- Updated scan-site and security-review skills documentation to reflect changes in functionality and clarify usage.
- Adjusted the flow of the security-review skill to streamline the conversation steps and improve user experience.
* feat(security-review): integrate scan-code skill for local source and package vulnerability checks
- Added scan-code skill to scan local Power Pages projects for dependency vulnerabilities and code issues using npm audit and ESLint.
- Updated security-review skill to incorporate scan-code findings alongside live-site checks.
- Enhanced HTML report generation to include separate sections for package and code findings with verbatim severities.
- Modified existing styles and severity labels in the security review report template to accommodate new severities.
- Documented the scan-code skill with detailed usage instructions and workflow.
* Revert "feat(security-review): integrate scan-code skill for local source and package vulnerability checks"
This reverts commit 4c87aca.
* feat(security-review): enhance security review skill with improved flow and error handling
* Refactor scan-site and security-review skills for improved user experience and code clarity
- Updated SKILL.md for scan-site to streamline user options and remove unnecessary confirmation steps before scanning.
- Enhanced get-latest-report.js to improve error handling and modularize the main function.
- Refactored poll-deep-scan.js to introduce better timeout handling and improve readability.
- Simplified start-deep-scan.js by consolidating argument parsing and error handling.
- Transformed transform-report.js to improve report parsing and error messaging, ensuring better handling of malformed reports.
- Revised security-review SKILL.md to reduce phases from seven to six, clarifying workflow and user interactions.
- Updated flow.md to reflect changes in the security-review skill phases and improve clarity on user-facing beats.
* test(power-pages): address Copilot PR #151 review comments
Reconciles three doc inconsistencies and adds node:test coverage for
the four scripts Copilot flagged as untested.
Doc fixes:
- security-review SKILL.md § 3.1.2: skipped subagent placeholders
are now rendered without a severity field, matching the no-severity
policy in § 3.1.3. build-review-data.js's skippedSection() drops
severity:'info' and the totals.info bump.
- scan-site SKILL.md § 5.1 + transform-report.js: the empty status
now emits a single info finding (via new emptyReport() helper)
rather than an empty findings array, so review-mode output never
produces an empty section.
- security-review SKILL.md Constraints: the template reference now
points at scripts/lib/templates/security-review-report.html (the
real location) instead of the non-existent assets/.
New tests under scripts/tests/ (64 cases total, all passing):
- build-review-data.test.js: SECTION_MAP shape, SEVERITIES order,
buildSections behaviour (skipped without severity, totals
aggregation, unknown severities, empty dir, JSON-parse failures),
TZ-pinned formatGeneratedAt, and CLI surface (--help, missing
flags, --inputDir validation, --nextStepsFile folding).
- render-review.test.js: missing --output/--data exits, missing
data file, unparseable JSON, parameterised required-key
validation over all 6 keys (asserts stderr names the missing
key), and end-to-end render that verifies REPORT_NAME/SITE_NAME/
REVIEW_DATA-derived values reach the rendered HTML.
- power-platform-api.test.js: parseCliArgs, parseTimeoutMs (with
parameterised rejection of 'abc'/'0'/'-1'/'-0.5'/'NaN'/''),
hasErrorCode is status-agnostic, isFeatureUnsupported variants,
pollUntil happy/timeout/error paths plus a stub-clock test that
pins DEFAULT_POLL_INTERVAL_MS as the wired-up default and another
that asserts a caller-supplied intervalMs flows through.
- website.test.js: nextSkipFrom and recordIdOf edge cases plus
findWebsite pagination via @odata.nextLink, case-insensitive
match, non-advancing-server guard, request/context errors, and
empty-websiteId rejection. Uses require.cache injection to stub
the api module — documented Node API, restored in finally.
Full plugin suite: 984 tests pass, 0 fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Ramachandran R <ramacr@microsoft.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2c82e39 commit e55e1d3
37 files changed
Lines changed: 5474 additions & 28 deletions
File tree
- plugins/power-pages
- references
- scripts
- lib
- templates
- tests
- skills
- audit-permissions/assets
- deploy-site
- manage-firewall
- references
- scripts
- manage-headers
- references
- scripts
- scan-site
- references
- scripts
- security-review
- references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments