Skip to content

Commit 921b3e2

Browse files
committed
feat(sec): implement dynamic keyring injection for ledger provisioning
1 parent ac24a89 commit 921b3e2

2 files changed

Lines changed: 27 additions & 7 deletions

File tree

QuanuX-Infra/ansible/02-panopticon-observability.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
state: present
3737
update_cache: true
3838
environment:
39-
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "QuanuxMasterPassword123!"
39+
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "{{ opensearch_admin_password }}"
4040

4141
- name: Configure OpenSearch network host
4242
lineinfile:
@@ -50,12 +50,6 @@
5050
regexp: '^#?discovery\.type:'
5151
line: "discovery.type: single-node"
5252

53-
- name: Disable OpenSearch security plugin internally
54-
lineinfile:
55-
path: /etc/opensearch/opensearch.yml
56-
regexp: '^#?plugins\.security\.disabled:'
57-
line: "plugins.security.disabled: true"
58-
5953
- name: Enable and restart OpenSearch service
6054
systemd:
6155
name: opensearch

QuanuX-Infra/cli/habitat_commands.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,31 @@ def equip(target: str = typer.Argument(..., help="Ansible inventory target (e.g.
3131
console.print("[bold red]Habitat Equip Failed.[/bold red] Playbook execution aborted.")
3232
raise typer.Exit(code=1)
3333

34+
@app.command("observe")
35+
def observe(target: str = typer.Argument("all", help="Ansible inventory target (e.g., panopticon_ledger)")):
36+
"""
37+
Deploys the Panopticon Observability Stack (Ledger, Buffer, and Shadow Node).
38+
Expects QUANUX_OS_PASS in the environment for OpenSearch native security.
39+
"""
40+
console.print(f"[bold cyan]Initiating Observability Protocol for:[/bold cyan] {target}")
41+
try:
42+
ansible_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../ansible"))
43+
playbook_path = os.path.join(ansible_dir, "02-panopticon-observability.yml")
44+
45+
cmd = [
46+
"ansible-playbook",
47+
"-i", "dynamic_inventory.py",
48+
playbook_path,
49+
"--limit", target,
50+
"-e", "opensearch_admin_password={{ lookup('env', 'QUANUX_OS_PASS') }}"
51+
]
52+
53+
console.print(f"[dim]Executing: {' '.join(cmd)}[/dim]")
54+
subprocess.run(cmd, cwd=ansible_dir, check=True)
55+
console.print("[bold green]Success:[/bold green] Panopticon Observability Matrix activated.")
56+
except subprocess.CalledProcessError:
57+
console.print("[bold red]Observability Deployment Failed.[/bold red] Playbook execution aborted; verify QUANUX_OS_PASS is exported.")
58+
raise typer.Exit(code=1)
59+
3460
if __name__ == "__main__":
3561
app()

0 commit comments

Comments
 (0)