Skip to content

fix: iptables 명령 예외 시 추가 규칙 롤백 - #169

Merged
MingJK merged 2 commits into
GSMSV:developfrom
junjuny0227:fix/issue-42-firewall-remainder
Sep 29, 2026
Merged

MingJK merged 2 commits into
GSMSV:developfrom
junjuny0227:fix/issue-42-firewall-remainder

Conversation

@junjuny0227

Copy link
Copy Markdown
Contributor

Summary

  • [code-review] firewall — PR #41에서 미뤄진 개선 사항 #42 잔여 원자성 오류: DNAT 추가 후 FORWARD SSH 명령에서 예외가 나면 기존에는 롤백 없이 종료하여 반쪽짜리 규칙이 남았습니다.
  • 수정: 명령 실행·종료 상태 조회 예외를 실패로 처리하여 기존 보상 롤백 경로로 보냅니다. 기본 포트 복원의 Lenient 정책과 삭제의 기존 정책은 변경하지 않았습니다.
  • 범위: GET 포트 조회는 이미 읽기 전용이고, 인증 코드 재발송은 새 레코드(attempts=0)를 만들기 때문에 별도 변경하지 않았습니다.

Test plan

  • SSH 명령 예외 회귀 테스트: 수정 전 실패 / 수정 후 통과
  • SECRET_KEY=local-test-only GATEWAY_PUBLIC_IP=192.0.2.1 python -m pytest tests/test_firewall_iptables.py tests/test_email_verification_reuse.py tests/test_auth_security.py -q — 35 passed, 1 skipped (로컬 Python 3.14)
  • ruff check . — 통과 (0.15.22)
  • git diff --check — 통과
  • 게이트웨이 실제 SSH/iptables 통합 검증 (로컬 환경에서 미수행)

Refs #42

@MingJK
MingJK merged commit 380a263 into GSMSV:develop Sep 29, 2026
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.

2 participants