raijin-server 0.2.30__py3-none-any.whl → 0.2.32__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of raijin-server might be problematic. Click here for more details.

raijin_server/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """Pacote principal do CLI Raijin Server."""
2
2
 
3
- __version__ = "0.2.30"
3
+ __version__ = "0.2.32"
4
4
 
5
5
  __all__ = ["__version__"]
@@ -150,23 +150,28 @@ def _uninstall_kong(ctx: ExecutionContext) -> None:
150
150
  )
151
151
 
152
152
  run_cmd(
153
- ["kubectl", "delete", "namespace", "kong", "--ignore-not-found"],
153
+ ["kubectl", "delete", "namespace", "kong", "--ignore-not-found", "--wait=false"],
154
154
  ctx,
155
155
  check=False,
156
156
  )
157
157
 
158
- # Remove CRDs do Kong tambem
159
- crds = _check_orphan_crds(ctx)
160
- if crds:
161
- typer.echo(f"Removendo {len(crds)} CRDs do Kong...")
162
- for crd in crds:
163
- run_cmd(
164
- ["kubectl", "delete", "crd", crd, "--ignore-not-found"],
165
- ctx,
166
- check=False,
167
- )
158
+ # Remove CRDs do Kong diretamente (mais confiável)
159
+ typer.echo("Removendo CRDs do Kong...")
160
+ run_cmd(
161
+ ["sh", "-c", "kubectl get crd -o name | grep konghq.com | xargs -r kubectl delete --ignore-not-found"],
162
+ ctx,
163
+ check=False,
164
+ )
165
+
166
+ # Aguarda namespace terminar de deletar
167
+ typer.echo("Aguardando limpeza completa...")
168
+ run_cmd(
169
+ ["kubectl", "wait", "--for=delete", "namespace/kong", "--timeout=60s"],
170
+ ctx,
171
+ check=False,
172
+ )
168
173
 
169
- time.sleep(5)
174
+ time.sleep(3)
170
175
 
171
176
 
172
177
  def _wait_for_kong_ready(ctx: ExecutionContext, timeout: int = 180) -> bool:
@@ -43,7 +43,8 @@ def _write_authorized_keys(username: str, content: str, ctx: ExecutionContext) -
43
43
 
44
44
  ssh_dir.mkdir(parents=True, exist_ok=True)
45
45
  os.chmod(ssh_dir, 0o700)
46
- auth_file.write_text(AUTHORIZED_KEYS_TEMPLATE.format(key=content.strip()))
46
+ normalized_key = content.replace("\r\n", "\n").strip() # normaliza CRLF de chaves geradas no Windows
47
+ auth_file.write_text(AUTHORIZED_KEYS_TEMPLATE.format(key=normalized_key))
47
48
  os.chmod(auth_file, 0o600)
48
49
  run_cmd(["chown", "-R", f"{username}:{username}", str(ssh_dir)], ctx)
49
50
 
@@ -69,12 +70,16 @@ def run(ctx: ExecutionContext) -> None:
69
70
  username = typer.prompt("Usuario administrativo para SSH", default="adminops")
70
71
  ssh_port = typer.prompt("Porta SSH", default="22")
71
72
  sudo_access = typer.confirm("Adicionar usuario ao grupo sudo?", default=True)
73
+ extra_users = typer.prompt(
74
+ "Usuarios adicionais permitidos (opcional, separados por espaco)", default=""
75
+ ).strip()
72
76
  pubkey_path = typer.prompt(
73
- "Arquivo com chave publica (ENTER para ~/.ssh/id_ed25519.pub)",
74
- default=str(Path.home() / ".ssh/id_ed25519.pub"),
77
+ "Arquivo com chave publica ou authorized_keys existente",
78
+ default=str(Path.home() / ".ssh/authorized_keys"),
75
79
  )
76
80
 
77
81
  public_key = _load_public_key(pubkey_path)
82
+ allow_users = " ".join(part for part in [username, extra_users] if part).strip()
78
83
 
79
84
  _ensure_user(username, ctx)
80
85
  if sudo_access:
@@ -91,7 +96,10 @@ PasswordAuthentication no
91
96
  PermitEmptyPasswords no
92
97
  ChallengeResponseAuthentication no
93
98
  UsePAM yes
94
- AllowUsers {username}
99
+ KbdInteractiveAuthentication no
100
+ PubkeyAuthentication yes
101
+ AuthorizedKeysFile %h/.ssh/authorized_keys
102
+ AllowUsers {allow_users}
95
103
  AuthenticationMethods publickey
96
104
  X11Forwarding no
97
105
  ClientAliveInterval 300
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: raijin-server
3
- Version: 0.2.30
3
+ Version: 0.2.32
4
4
  Summary: CLI para automacao de setup e hardening de servidores Ubuntu Server.
5
5
  Home-page: https://example.com/raijin-server
6
6
  Author: Equipe Raijin
@@ -1,4 +1,4 @@
1
- raijin_server/__init__.py,sha256=RBohu5QPizLjIo2M7DnX6GpWDLUuqvHB16Gzb8HDoZM,95
1
+ raijin_server/__init__.py,sha256=lY1Zh0BpnKR_Xt80B_ZQ1POl97fFJCV6ne3tDgd4-64,95
2
2
  raijin_server/cli.py,sha256=2m7q1znMLbBdnUwN6oOUrCZXEqC2e7SfbjYkymbP4lQ,37884
3
3
  raijin_server/config.py,sha256=QNiEVvrbW56XgvNn5-h3bkJm46Xc8mjNqPbvixXD8N0,4829
4
4
  raijin_server/healthchecks.py,sha256=lzXdFw6S0hOYbUKbqksh4phb04lXgXdTspP1Dsz4dx8,15401
@@ -18,7 +18,7 @@ raijin_server/modules/hardening.py,sha256=4hz3ifkMhPlXa2n7gPxN0gitQgzALZ-073vuU3
18
18
  raijin_server/modules/harness.py,sha256=uWTxTVJlY_VB6xi4ftMtTSaIb96HA8WJQS-RbyxU45M,5391
19
19
  raijin_server/modules/istio.py,sha256=o0K5-Fw4LRs-kbAVgwzYxHzEt_aPFJG8suqOqvg2748,7297
20
20
  raijin_server/modules/kafka.py,sha256=n7ZpLPWv6sKBJhdBiPe7VgeDB24YiCIOWvOQkWwt03Y,5664
21
- raijin_server/modules/kong.py,sha256=KKS9HZF-6Q-ZtJBpBNvWZN6L4YR45iiVR0KiYB1nSz8,13229
21
+ raijin_server/modules/kong.py,sha256=eDSagvEP9_BCs9pZ-pCVs1BDdlYOoJfY5PnUSiTvvgc,13416
22
22
  raijin_server/modules/kubernetes.py,sha256=9E6zV0zGQWZW92NVpxwYctpi-4JDmi6YzF3tKRI4HlU,13343
23
23
  raijin_server/modules/loki.py,sha256=aNiUpnOFppZMXoQwYhn7IoPMzwUz4aHi6pbiqj1PRjc,5022
24
24
  raijin_server/modules/metallb.py,sha256=uUuklc_RsQ-W2qDVRMQAxQm9HKGEqso444b1IwBpM6w,8554
@@ -29,7 +29,7 @@ raijin_server/modules/observability_ingress.py,sha256=Fh1rlFWueBNHnOkHuoHYyhILmp
29
29
  raijin_server/modules/prometheus.py,sha256=wT9jdcC-8vVysVKgMR5isGbxxpvGFPRf7fhMAGd9kJU,10761
30
30
  raijin_server/modules/sanitize.py,sha256=_RnWn1DUuNrzx3NnKEbMvf5iicgjiN_ubwT59e0rYWY,6040
31
31
  raijin_server/modules/secrets.py,sha256=d4j12feQL8m_4-hYN5FfboQHvBc75TFeGno3OzrXokE,9266
32
- raijin_server/modules/ssh_hardening.py,sha256=oQdk-EVnEHNMKIWvoFuZzI4jK0nNO8IAY4hkB4pj8zw,4025
32
+ raijin_server/modules/ssh_hardening.py,sha256=yTPvgHv3T0j0ayXoc-kN7YVe3SISi1yKnwipPb3bk_Y,4445
33
33
  raijin_server/modules/traefik.py,sha256=crEYIqAidAhh_H93qIvCbTtJ7BjO-3ef77alLc_--Gg,3535
34
34
  raijin_server/modules/velero.py,sha256=yDtqd6yUu0L5wzLCjYXqvvxB_RyaAoZtntb6HoHVAOo,5642
35
35
  raijin_server/modules/vpn.py,sha256=hF-0vA17VKTxhQLDBSEeqI5aPQpiaaj4IpUf9l6lr64,8297
@@ -38,9 +38,9 @@ raijin_server/scripts/checklist.sh,sha256=j6E0Kmk1EfjLvKK1VpCqzXJAXI_7Bm67LK4ndy
38
38
  raijin_server/scripts/install.sh,sha256=Y1ickbQ4siQ0NIPs6UgrqUr8WWy7U0LHmaTQbEgavoI,3949
39
39
  raijin_server/scripts/log_size_metric.sh,sha256=Iv4SsX8AuCYRou-klYn32mX41xB6j0xJGLBO6riw4rU,1208
40
40
  raijin_server/scripts/pre-deploy-check.sh,sha256=XqMo7IMIpwUHF17YEmU0-cVmTDMoCGMBFnmS39FidI4,4912
41
- raijin_server-0.2.30.dist-info/licenses/LICENSE,sha256=kJsMCjOiRZE0AQNtxWqBa32z9kMAaF4EUxyHj3hKaJo,1105
42
- raijin_server-0.2.30.dist-info/METADATA,sha256=prMsN_Rip_CpEeAxq3Lxiulydtm6Sj4BkidyuaLbzUQ,22476
43
- raijin_server-0.2.30.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
44
- raijin_server-0.2.30.dist-info/entry_points.txt,sha256=3ZvxDX4pvcjkIRsXAJ69wIfVmKa78LKo-C3QhqN2KVM,56
45
- raijin_server-0.2.30.dist-info/top_level.txt,sha256=Yz1xneCRtsZOzbPIcTAcrSxd-1p80pohMXYAZ74dpok,14
46
- raijin_server-0.2.30.dist-info/RECORD,,
41
+ raijin_server-0.2.32.dist-info/licenses/LICENSE,sha256=kJsMCjOiRZE0AQNtxWqBa32z9kMAaF4EUxyHj3hKaJo,1105
42
+ raijin_server-0.2.32.dist-info/METADATA,sha256=Uxzf8i6E1zxhjsJsPZOrqSw4tlSyQLqCRzXBtLX3H0E,22476
43
+ raijin_server-0.2.32.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
44
+ raijin_server-0.2.32.dist-info/entry_points.txt,sha256=3ZvxDX4pvcjkIRsXAJ69wIfVmKa78LKo-C3QhqN2KVM,56
45
+ raijin_server-0.2.32.dist-info/top_level.txt,sha256=Yz1xneCRtsZOzbPIcTAcrSxd-1p80pohMXYAZ74dpok,14
46
+ raijin_server-0.2.32.dist-info/RECORD,,