microsoft/power-platform-skills / plugins/power-pages/skills/audit-permissions
audit-permissions
VerifiedAudits existing table permissions on a Power Pages site by analyzing them against site code and Dataverse metadata, then GRADES the configuration with deterministic 1–5 scores across 3 security/usability/correctness categories (9 dimensions). Detection is anchored by a recurring-issue catalog so findings and severities stay consistent run-to-run. Generates an HTML report with an at-a-glance verdict and per-category scores in the Overview plus a single list of **major/minor** issues (each major issue labelled permissions-only or upstream-caused with a short justification), and suggested fixes. Use when the user wants to review, verify, check, score, or grade table permissions for security issues. Supports SPA and PAC-downloaded non-SPA sites.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 77.5 KB |
| assets/audit-report.html | other | 27.8 KB |
| references/non-spa-site-workflow.md | markdown | 15.5 KB |
| scripts/collect-non-spa-permission-evidence.js | script | 16.2 KB |
| scripts/query-table-lookups.js | script | 1.9 KB |
| scripts/query-table-relationships.js | script | 1.7 KB |
| scripts/validate-audit.js | script | 3.3 KB |
scripts/validate-audit.js
View on GitHub#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const {
approve,
block,
runValidation,
findProjectRoot,
} = require('../../../scripts/lib/validation-helpers');
const { validateReport } = require('../../../scripts/lib/audit-report-validation');
// Telemetry is best-effort, so it is loaded only when a completion is actually
// recorded. A top-level require would make report validation and the
// PostToolUse(Skill) hook depend on the telemetry module: any load failure
// (missing file, syntax error, partial install) would crash this script before
// validateReport runs. Loading here keeps that failure inside the caller's try.
function completeRun(...args) {
return require('../../../scripts/emit-audit-permissions-telemetry').completeRun(...args);
}
function fail(error) {
const message = error instanceof Error ? error.message : String(error);
process.stderr.write(`Audit validation failed: ${message}\n`);
process.exit(1);
}
const reportFlagIndex = process.argv.indexOf('--report');
const positionalReport = process.argv.slice(2).find((argument) => !argument.startsWith('-'));
if (reportFlagIndex >= 0 && (!process.argv[reportFlagIndex + 1] || process.argv[reportFlagIndex + 1].startsWith('-'))) {
fail(new Error('Usage: validate-audit.js --report <path>'));
}
const explicitReport = reportFlagIndex >= 0 ? process.argv[reportFlagIndex + 1] : positionalReport;
const runFlagIndex = process.argv.indexOf('--auditRunId');
const dataFlagIndex = process.argv.indexOf('--data');
const auditRunId = runFlagIndex >= 0 ? process.argv[runFlagIndex + 1] : null;
const dataPath = dataFlagIndex >= 0 ? process.argv[dataFlagIndex + 1] : null;
if (explicitReport) {
try {
const reportPath = path.resolve(explicitReport);
const summary = validateReport(reportPath);
let telemetryStatus = 'not_requested';
if (auditRunId && dataPath) {
try {
// completeRun downgrades to a metrics_validation failure when the source
// data cannot be reconciled with the report, so report what was recorded.
const completion = completeRun({
runId: auditRunId,
outcome: 'success',
data: path.resolve(dataPath),
report: reportPath,
});
telemetryStatus = completion.disabled
? 'disabled'
: completion.outcome === 'success' ? 'recorded_success' : 'recorded_failure';
} catch {
// A validated report remains successful even if optional telemetry fails.
telemetryStatus = 'failed';
}
}
process.stdout.write(`${JSON.stringify({
valid: true,
reportPath,
issueCounts: summary.issueCounts,
verdict: summary.verdict,
telemetryStatus,
})}\n`);
} catch (error) {
fail(error);
}
} else {
runValidation((cwd) => {
const projectRoot = findProjectRoot(cwd);
if (!projectRoot) approve();
const docsReport = path.join(projectRoot, 'docs', 'permissions-audit.html');
if (fs.existsSync(docsReport)) {
const content = fs.readFileSync(docsReport, 'utf8');
if (content.includes('__FINDINGS_DATA__') || content.includes('__INVENTORY_DATA__')) {
block('Audit report has unreplaced placeholders - data was not populated.');
}
}
// The hook fires before a new audit writes its report, so a missing report is valid.
approve();
});
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |