Skip to content

Security hardening 2026 07 - #2

Merged
krlex merged 11 commits into
mainfrom
security-hardening-2026-07
Jul 16, 2026
Merged

Security hardening 2026 07#2
krlex merged 11 commits into
mainfrom
security-hardening-2026-07

Conversation

@krlex

@krlex krlex commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Motivation

Changes

Testing

  • Existing tests pass locally
  • New tests added (where applicable)
  • Manual verification documented above

Notes for reviewers

Checklist

  • Commits are signed with a real name and email
  • CHANGELOG.md updated (under ## [Unreleased])
  • Documentation updated (README / docs/ / Pages) if behavior changed
  • No secrets, credentials, or internal hostnames committed

krlex added 11 commits July 5, 2026 10:22
RLS gate now aborts (500) when the tenant id cannot be installed instead
of running the request with global visibility. Strict gate resolves the
target org with the caller's RLS scope removed so cross-tenant objects are
actually visible, and defaults to deny when a covered resource's org
cannot be determined.
- Superuser / system_administrator / system_auditor grants from the source
  are now gated behind an explicit --grant-superusers opt-in and logged
  loudly; without it they are skipped, not silently applied.
- Custom credential-type injectors are no longer imported verbatim; they
  are dropped for an admin to re-approve unless --trust-injectors is given.
- Secrets are read from AWX_TOKEN / AWX_PASSWORD env vars in preference to
  argv, with a warning when passed on the command line.
- Warn when --insecure disables TLS verification while credentials flow.
get_or_create dropped the supplied admin_password on an existing username
and attached that (possibly other-tenant) account to the new org. Refuse
unless attach_existing_admin is explicitly set.
A JobTemplate's playbook field is user-editable; an absolute or ../ value
let the scanner run against arbitrary host paths. realpath and confine the
target to the project checkout.
…model

- EventLog carries its own organization_id but had no RLS policy; add it to
  the covered set with an idempotent migration (0209).
- Document that Project/WJT/Schedule/nodes are covered indirectly via their
  main_unifiedjobtemplate parent (org column was moved there in 0109), and
  that NULL organization_id is intentionally global — don't list always-owned
  tables that permit NULL.
- Document the required TENANCY_* enablement set for multi-tenant installs.
Associating an SSO login to an existing local account by matching email
enables cross-IdP account takeover when an IdP does not verify email
ownership. Associate by provider UID instead.
- Rate limiter no longer swallows Redis outages at debug level; logs loudly
  and honours TENANCY_RATE_LIMIT_FAIL_CLOSED (default open for availability).
- RLS policies use NULLIF(current_setting(...),'')::int so the empty 'no
  scope' sentinel can't raise on the ::int cast (migration 0210).
- pip-audit adapter rejects ../ or absolute requirements overrides.
Migration 0205 declares a NOT NULL description column on TenantQuotaEvent
and TenantIsolationEvent, but both models extend CreatedModifiedModel which
doesn't provide it, so every insert raised IntegrityError. Surfaced once the
strict isolation gate actually started blocking and tried to write its audit
event. Matches the migration state, so no new migration is needed.
@krlex
krlex merged commit 0ce8c15 into main Jul 16, 2026
2 checks passed
@krlex
krlex deleted the security-hardening-2026-07 branch July 30, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant