agentleFS
ghivelyghively/infra-ops/skills/hsa-infrastructure/SKILL.md

hsa-infrastructure

Skill0 starsChanged 5 months agoMITView on GitHub

Use when authoring, reviewing, or auditing infrastructure in the High Security Area (HSA) — card personalization zone under PCI Card Production + PIN scope. Covers air-gap constraints, dual-control requirements, local-only inference, and HSA-specific Ansible/GitLab patterns.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never pulled from the internet on HSA hosts

    line 33
  2. Very specific:

    Never add tasks that fetch packages, images, or updates directly from the internet.

    line 35
  3. Very specific:

    Use ansible.builtin.copy to push pre-staged packages from a transfer share, not ansible.builtin.get_url pointing at a public mirror.

    line 36
  4. Very specific:

    No cloud model may process HSA-adjacent content.

    line 41
  5. Very specific:

    Every infrastructure change to an HSA host requires two distinct human approvers — not just the MR author.

    line 47
  6. Distinctive:

    Every HSA playbook must have a corresponding rollback play.

    line 168
  7. Very specific:

    Verify service state with ansible.builtin.assert

    line 175
  8. Very specific:

    Use: node scripts/hooks/dual-control-promotion-gate.js --check --id <id> --zone hsa --approvers <a>,<b> --citation "<ref>" before …

    line 181

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HSA Infrastructure Skill

When to Use

Load this skill for any task involving infrastructure in the High Security Area:

  • Planning changes to personalization system infrastructure
  • Reviewing Ansible playbooks or CI configs targeting HSA hosts
  • Auditing HSA infrastructure state
  • Writing change records for HSA zone changes

How It Works

This skill provides HSA-specific patterns, constraints, and examples that override or extend the base ansible-patterns and gitlab-cicd-pipeline skills for the air-gapped personalization zone. Load it alongside those skills; it takes precedence where rules conflict.

Core Constraints (non-negotiable)

Air-gap

The HSA has no direct internet access. Every artifact (playbook, role, CI component, container image, package) must be:

  1. Authored and tested in the corporate zone
  2. Transferred via the approved air-gap process (signed artifact + hash verification)
  3. Never pulled from the internet on HSA hosts

Never add tasks that fetch packages, images, or updates directly from the internet. Use ansible.builtin.copy to push pre-staged packages from a transfer share, not ansible.builtin.get_url pointing at a public mirror.

Local inference only

No cloud model may process HSA-adjacent content. All analysis of HSA infrastructure content must use the local Ollama lane (scripts/lib/ollama-router.js). The INFRAOPS_SENSITIVE_FAIL_CLOSED=1 default enforces this at the hook boundary.

Dual control

Every infrastructure change to an HSA host requires two distinct human approvers — not just the MR author. The dual-control-promotion-gate enforces this for instinct promotion. MR-level enforcement requires the GitLab HSA project to have a minimum approval count of 2 on protected branches. Verify this configuration is in place before proposing any HSA MR.

No CHD in agent context

This agent operates on infrastructure metadata only — file paths, config schemas, playbook structure, runner topology. It never reads or reasons about actual PAN, SAD, PIN blocks, key components, or HSM configuration. If a file contains those values, identify it by path and route to the local lane.

Ansible Patterns for the HSA Zone

Package management (air-gapped)

# CORRECT — push from staged share, no internet
- name: Install perso-agent package
  ansible.builtin.copy:
    src: "{{ transfer_share }}/packages/perso-agent-{{ version }}.rpm"
    dest: /tmp/perso-agent.rpm
    mode: '0600'
    owner: root

- name: Install from staged file
  ansible.builtin.yum:
    name: /tmp/perso-agent.rpm
    state: present

# WRONG — never in HSA
- name: Install perso-agent
  ansible.builtin.yum:
    name: perso-agent
    state: latest   # fetches from internet — BLOCKED in HSA

Service management

# Always use FQCN; always verify state explicitly
- name: Ensure personalization service is running
  ansible.builtin.systemd:
    name: perso-engine
    state: started
    enabled: true
    daemon_reload: true
  register: svc_state

- name: Verify service is active
  ansible.builtin.assert:
    that: svc_state.status.ActiveState == 'active'
    fail_msg: "perso-engine failed to start"

Configuration management

# Use templated configs; never hardcode endpoint addresses
- name: Deploy perso-engine config
  ansible.builtin.template:
    src: templates/perso-engine.conf.j2
    dest: /etc/perso-engine/engine.conf
    owner: perso
    group: perso
    mode: '0640'
    validate: /usr/bin/perso-engine --config-check %s
  notify: Restart perso-engine

GitLab CI/CD in the HSA Zone

HSA CI pipelines run on runners tagged hsa that are registered against the air-gapped internal GitLab instance (gitlab-hsa.example.com), not the corporate GitLab.

# .gitlab-ci.yml for HSA pipeline
stages:
  - syntax
  - check
  - deploy  # manual trigger only

variables:
  ANSIBLE_FORCE_COLOR: "0"
  ANSIBLE_HOST_KEY_CHECKING: "False"

syntax-check:
  stage: syntax
  tags: [hsa, ansible]
  script:
    - ansible-playbook --syntax-check site.yml
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

check-mode:
  stage: check
  tags: [hsa, ansible]
  script:
    - ansible-playbook --check --diff site.yml -i inventory/hsa/
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

deploy:
  stage: deploy
  tags: [hsa, deploy, ansible]
  when: manual
  environment:
    name: hsa-production
    url: https://gitlab-hsa.example.com
  script:
    - ansible-playbook site.yml -i inventory/hsa/
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
  needs:
    - job: check-mode

Rollback in the HSA Zone

Every HSA playbook must have a corresponding rollback play. Because the zone is air-gapped, rollbacks cannot pull updated packages — they must revert to the previously staged artifact or revert configuration via git.

Standard rollback pattern:

  1. Re-run the previous version playbook with --tags rollback
  2. Verify service state with ansible.builtin.assert
  3. Log rollback to governance ledger via change record

Instinct Promotion for HSA

HSA zone instincts require dual-control-promotion-gate (two distinct approvers). Use: node scripts/hooks/dual-control-promotion-gate.js --check --id <id> --zone hsa --approvers <a>,<b> --citation "<ref>" before submitting to /instinct-promote.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.