> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 5.4 Security Risks and Required Actions

> Security Risks and Required Actions for ReportGeneratorTool.

This register turns the inspected main-branch findings into release acceptance criteria. A control closes only when an owner records implementation, validation results and deployment evidence.

## Release-blocking controls

| ID | Finding in main | Required outcome | Owner role |
| - | - | - | - |
| SEC-01 | Credentials committed in the Dockerfile and history | Revoke exposed credentials, verify old values fail, remove secret-bearing artifacts and enable secret scanning | Service operator |
| SEC-02 | No implemented workspace authorization in the starter | Authenticate callers and enforce workspace, device and recipient scope on every operation | API owner |
| SEC-03 | Full workflow and activity input can be logged | Remove raw-payload logging and verify no credential values appear in telemetry | API owner |
| SEC-04 | Request credentials are forwarded into durable input | Persist protected credential references instead of plaintext secrets | Workflow owner |
| SEC-05 | Caller-selected portal and logo destinations | Enforce destination policy, safe resolution and network egress boundaries | Platform owner |
| SEC-06 | Shared temporary directory and first-CSV selection | Isolate job files and prove concurrent jobs cannot read each other's files | Workflow owner |
| SEC-07 | Orchestrator catches failures without rethrowing | Persist explicit failure state and sanitized errors | Workflow owner |
| SEC-08 | Storage authorization and lifecycle are not established in source | Verify private storage, scoped identity, expiry and deletion | Service operator |

## Browser and network controls

Allow only server-approved portal and asset hosts and HTTPS destinations. Validate canonical hostnames, resolved addresses and redirect targets. Block loopback, private, link-local and metadata-service destinations through application checks and network egress policy. Revalidate each redirect rather than trusting the initial URL. Cover DNS changes and browser subresource requests; validating page.goto alone is insufficient. Bundle PDF styles locally to remove the current public-CDN dependency.

Run workers with least privilege and restrict access to secrets, the host filesystem and internal services. The current Chromium invocation disables its sandbox. Require a reviewed browser-isolation configuration and a representative workload test before production. Patch Chromium and Puppeteer together and record the tested browser version with the release artifact.

Destination controls follow [OWASP SSRF Prevention guidance](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html).

## Logging and monitoring controls

Use structured requestId, jobId, workspaceId, action, outcome and timestamp fields. Exclude authorization headers, cookies, passwords, connection strings, raw request bodies, PDFs and CSV contents. Minimize or pseudonymize device and recipient identifiers. Record authentication failures, authorization denials, key revocation, report downloads and recipient-policy failures. Restrict security-log access and protect records against unauthorized modification.

Logging controls follow [OWASP Logging guidance](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html).

## Required verification

* Invalid keys are rejected before a job is created.
* A key cannot list, poll, download or resend another workspace's report.
* Restricted recipients and device IDs are rejected server-side.
* URL tests cover internal addresses, redirects, DNS changes and malicious asset URLs.
* Sensitive-value canaries do not appear in logs or workflow history.
* Concurrent jobs use distinct temporary files and storage keys.
* Failure, cancellation and worker interruption leave cleanup evidence.
* Expired PDFs and metadata are deleted according to policy.
* Dependency and secret scans pass for the actual release artifact.
* A restore or rollback does not re-enable revoked credentials.

Source evidence: [src/functions/orchestrator\_reporting.js](https://github.com/TQKNG/automation/blob/27045ec413f88cd2227ab08e18ec76db3e8e3d34/src/functions/orchestrator_reporting.js) and [src/functions/shared/utils/reportService.js](https://github.com/TQKNG/automation/blob/27045ec413f88cd2227ab08e18ec76db3e8e3d34/src/functions/shared/utils/reportService.js).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.