core/security-governance-core/db/query.sql
Tiago Yamamoto a52bd4519d refactor: optimize Dockerfiles and documentation for core services
- Use Google Distroless images for all services (Go & Node.js).
- Standardize documentation with [PROJECT-NAME].md.
- Add .dockerignore and .gitignore to all projects.
- Remove docker-compose.yml in favor of docker run instructions.
- Fix Go version and dependency issues in observability, repo-integrations, and security-governance.
- Add Podman support (fully qualified image names).
- Update Dashboard to use Node.js static server for Distroless compatibility.
2025-12-30 13:22:34 -03:00

33 lines
776 B
SQL

-- name: CreateSecurityProfile :one
INSERT INTO security_profiles (name, risk_level)
VALUES ($1, $2)
RETURNING *;
-- name: CreatePolicy :one
INSERT INTO policies (name, description)
VALUES ($1, $2)
RETURNING *;
-- name: CreateControl :one
INSERT INTO controls (policy_id, name, description)
VALUES ($1, $2, $3)
RETURNING *;
-- name: CreateFinding :one
INSERT INTO findings (control_id, resource_id, status, details)
VALUES ($1, $2, $3, $4)
RETURNING *;
-- name: ListFindings :many
SELECT * FROM findings
WHERE status = $1;
-- name: CreateAuditLog :one
INSERT INTO audit_logs (actor_id, action, resource_type, resource_id, details)
VALUES ($1, $2, $3, $4, $5)
RETURNING *;
-- name: ListAuditLogs :many
SELECT * FROM audit_logs
ORDER BY timestamp DESC
LIMIT $1 OFFSET $2;