최신 글
-
error "could be both a local file and a tracking branch."
개요git checkout을 하는 과정에서 github actions이나 git cli를 사용할 때 아래와 같은 에러가 발생하는 경우상황could be both a local file and a tracking branch.원인'git checkout'을 통해 branch를 변경할 경우 명시적인 명령어 'git switch' 를 추천한다참고https://git-scm.com/docs/git-switch
2025.03.07 18:02 -
gov-ncloud Cloud DB for PostgreSQL 데이터베이스 생성 하는 방법
개요어떤 철학과 무슨 의도를 갖고 만든 건지는 모르겠지만, gov-ncloud Cloud DB for PostgreSQL에서 최초 생성된 database 말고 추가적으로 database를 생성하는 방법은 정말 찾기 힘들었다. 방법아래와 같이 DB Service 상세보기를 누르면 나온다. 스크린샷
2025.02.26 20:16 -
PostgreSQL dump & restore
개요PostgreSQL dump & restore 관련 명령어 dump & restore# sudo dnf install -y https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/postgresql14-14.13-1PGDG.rhel8.x86_64.rpm# psql -h -p 5432 -U user -d Password for user user: psql (14.13, server 13.15)Type "help" for help.database=> \l List of databases Name | Owner | Encoding | Coll..
2025.02.26 20:03 -
Rocky Linux 8에 PostgreSQL client 설치 및 삭제 방법
개요Rocky Linux 8에 PostgreSQL client 설치 방법 설치 및 삭제 방법## PostreSQL Repository 추가# sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm## 설치하려는 버전의 PostreSQL Module 활성화# sudo dnf module enable postgresql:12## 설치# sudo dnf install -y postgresql## 삭제# sudo dnf remove postgresql# sudo dnf module reset postgresql## 다른 버전 Module 활성화# s..
2025.02.26 17:43 -
MySQL Dump, Restore 관련 필요한 명령어
개요MySQL을 운영할 때 필요한 작업중에는 MySQL dump 및 restore 작업이 있다. 이에 관련된 명령어를 정리해봤다. 명령어## mysql database create 확인show create database ;## mysql table create 확인show create table ;## mysql schema dump 명령어 예시mysqldump -u -h -p \ --no-data --skip-comments \ --skip-set-charset \ --skip-add-drop-table \ --skip-add-locks \ --skip-disable-keys \ --skip-triggers \ --skip-routines \ --set-gtid-purged=OF..
2025.02.26 16:25 -
object storage object url (ncloud, AWS)
개요Amazon S3와 Naver Cloud Platform(NCP) Object Storage는 객체에 접근하기 위한 두 가지 URL 형식을 제공Path-Style과 Virtual Host-Style URL 형식• Amazon S3:Path-Style URL: https://s3.{region}.amazonaws.com/{bucket-name}/{object-key} Virtual Host-Style URL: https://{bucket-name}.s3.{region}.amazonaws.com/{object-key}• Naver Cloud Platform Object Storage:Path-Style URL: https://{region}.object.ncloudstorage.com/{bucket-na..
2025.02.17 12:00 -
AWS CloudWatch Logs insights query
개요AWS CloudWatch Logs insights query를 잘 사용하면 AWS CloudWatch Logs를 잘 사용할 수 있다. 쿼리1 >> 10초 이상 RDS slow queryfields @timestamp, @message| filter @message like /Query_time:/| parse @message /Query_time: (?\d+\.\d+)/| filter queryTime > 10| sort @timestamp desc| limit 20 비고적절히 만들어진 Query는 Saved queries를 통해 저장 해 놓으면 한번에 불러와서 사용 가능하다.
2025.02.12 16:03 -
AWS Web Console account 다중 로그인
개요AWS Web Console에서 account를 1개 이상 사용할 경우 브라우저를 다르게 하거나 시크릿 모드를 통해서 해야하는 불편함이 있었는데, 최근에 다중 로그인이 기능이 출시되면서 상당히 편해지고 좋아졌습니다. (2025년 1월 16일) 방법AWS Console을 로그인 한 후 우 상단의 Account의 드롭박스에서 "Turn on multi-session support"를 활성화한 후 Session 추가를 통해 1개 이상의 Account가 다중으로 로그인된 후 Switching을 통해 관리가 가능하다. 참고https://aws.amazon.com/ko/about-aws/whats-new/2025/01/aws-management-console-simultaneous-sign-in-multiple..
2025.01.21 12:29 -
telepresence를 이용한 터널링 방법
개요k8s context로 접속하기 위해 telepresence를 통해 접근하는 방법과 client vpn 없이 AWS VPC에 접근하는 방법 설치 (OSS)https://www.telepresence.io/docs/install/client 사용방법## telepresence 기존 세션 제거# telepresence quit## telepresence 접속# telepresence connect ## 현재 k8s context에 해당하는 VPC internal routing 추가 # sudo route add $(aws ec2 describe-vpcs --region $(kubectl config current-context | awk -F':' '{print $4}') --vpc-ids $(aws e..
2025.01.17 23:39 -
ArgoCD AutoSync interval
개요ArgoCD Application에서 AutoSync 기능을 enable 하면 기본값으로 180초 주기로 확인해서 Sync를 한다. 그 값을 확인하는 방법과 변경하는 방법에 대한 정리 확인 방법kubectl get configmap argocd-cm -n argocd -o jsonpath='{.data.timeout\.reconciliation}{"\n"}' 변경 방법kubectl patch configmap argocd-cm -n argocd --type merge -p '{"data":{"timeout.reconciliation":"60s"}}' 바로 적용하는 방법Application >> Refresh 버튼을 누르면 바로 Sync가 동작한다. 참고https://github.com/argoproj..
2024.12.31 16:31
Security Principal
-
MFA 환경에서 AWS CLI 사용 하기
개요 MFA 환경에서 AWS CLI 사용 하려면, session token과 임시 AWS Access key와 Secret key가 필요하다. 방법 # aws sts get-session-token --duration-seconds 10000 --serial-number "arn:aws:iam::111111111:mfa/mfa_user" --token-code 123456 { "Credentials": { "AccessKeyId": "ABCDQWEQWEQWEQWE", "SecretAccessKey": "YWEesaldkjsadlkgjasgsdgsadgsadgsadgsadg", "SessionToken": "sadfsdfsdfsadf/asdfsadfsdfsadfsadf/v//////////sdfgdsfgd..
2024.02.19 18:22 -
VPC endpoint for dynamodb 사용 하기
개요 VPC endpoint for S3 처럼 VPC endpoint for dynamodb 를 사용하면 DynamoDB를 접근을 AWS 내부 네트워크를 통해 접속하여서 보안에도 강점이 있고, 비용 최적화에도 도움이 된다. 간단한 설정을 통해 사용가능 하지만 간과하는 경우가 많다. 사용 방법 VPC endpoint "com.amazonaws..dynamodb" 를 생성한 후 적절한 VPC의 Routing tables에 추가만 하면 된다. 참고 https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/vpc-endpoints-dynamodb.html
2024.02.19 16:23 -
EBS Snapshots BPA(Block Public Access)
- 개요 EBS Snapshot이 예기치 못하게 Public으로 공개되서 악의적인 접근을 원천 차단 - 방법 AWS Console >> EC2 Settings >> Data protection and security >> Block public access for EBS snapshots >> Manage >> check >> Block all public sharing // Block new public sharing - 비고 Default : off have to set Per Region and Per Orgs(Account) - 참고 https://aws.amazon.com/ko/about-aws/whats-new/2023/11/amazon-elastic-block-store-public-acce..
2023.12.29 15:36 -
AMI BPA(Block Public Access) 설정
- 개요 AMI를 운영할 때 혹시 모를 Public Access 사태를 미연에 방지 - 방법 AWS Console >> EC2 Settings >> Block public access for AMIs >> Manage >> check - 비고 Default : off Per Region, Per Orgs(Account) 따로 설정 기존 AMI는 직접 변경해줘야하며 신규 생성되는 AMI에만 적용됨 The request can take up to 10 minutes to be configured. - Reference https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-updating https://docs.aws.amazon.com/..
2023.09.22 16:24 -
Security Policy (ELB, Cloudfront)
- 개요 기본적인 보안 가이드를 준수하려면 필수 - Cloudfront - Security policy (2023년 10월 기준) TLSv1.2_2021 - ELB - Security policy (2023년 10월 기준) ALB : ELBSecurityPolicy-TLS13-1-2-2021-06 NLB : ELBSecurityPolicy-TLS13-1-2-2021-06* - reference https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html?icmpid=docs_cf_help_panel#DownloadDistValuesOriginSSLProtocols https://d..
2023.05.15 15:57 -
AWSCompromisedKeyQuarantineV2
- 개요 AWS 사용중에 Hacking 의심이나 외부 노출이 된 계정에 AWS에서 자동으로 policy를 할당해서 추가 피해를 막고 고객 대응을 유도하는 권한 - 내용 Denies access to certain actions, applied by the AWS team in the event that an IAM user's credentials have been compromised or exposed publicly. Do NOT remove this policy. Instead, please follow the instructions specified in the support case created for you regarding this event. { "Version": "2012-10-17..
2023.02.14 14:14 -
Cloudfront Origin Access Control
- 개요 CloudFront 접근 제어 및 보안 강화를 위한 방법으로 기존의 OAI 다음으로 나온 OAC에 대해 정리 했다. - Origin Access : Create control setting Signing behavior Sign requests (recommended) Create Bucket Policy -> Copy policy - S3 bucket policy { "Version": "2008-10-17", "Id": "PolicyForCloudFrontPrivateContent", "Statement": [ { "Sid": "AllowCloudFrontServicePrincipal", "Effect": "Allow", "Principal": { "Service": "cloudfront.a..
2022.10.14 10:23 -
Deletion Protection 삭제 방지 (EC2, ELB, RDS)
- 개요 예기치 못한 삭제나 테라폼등으로 삭제가 일어날 경우를 미연에 방지하기 위한 삭제 방지 기능을 적극 활용하는 것을 추천한다. - EC2 termination protection https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html - ELB Deletion protection https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-lo..
2022.08.08 16:09 -
개발 리소스, 개발 서버들 접근 제어 (IP Based ACL)
- 개요 클라우드 환경에서 보안을 강화할 수 있는 방법중에 제일 기본은 IP 기반 제어다. 개발관려 리소스는 회사에서만 접근이 가능해여 하는 등 여러 가지 정책을 정하는 방법에 대해 정리 했다. 1. WAF 장점 : 많은 정책과 할 수 있는 것이 다양. 단점 : 유료, NLB 불가. https://docs.aws.amazon.com/waf/latest/developerguide/classic-web-acl-ip-conditions.html 2. Network ACL : VPC 및 Subnet 레벌 제어. 장점 : 설정하기 편하고 직관적이며, 무료. 단점 : VPC와 Subnet 설계가 ENV에 맞게 되어 있어야 하며, IP 갯수 제한. https://docs.aws.amazon.com/vpc/latest..
2022.08.05 17:41 -
AWS 에서 권장하는 보안 관련 링크
- 개요 실제 보안 사고를 경험 후 그걸 해결하는 과정에서 AWS support를 통해 공유 받은 보안 권장 링크 - IAM MFA https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_enable.html - Trusted Advisor https://docs.aws.amazon.com/awssupport/latest/user/get-started-with-aws-trusted-advisor.html - Billing Alert https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html#gs_c..
2022.07.22 09:21
-
Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
- 개요 ubuntu에서 패키지 목록을 업데이트할 때 아래와 같은 에러 발생 시 대처 방법이다. - 에러 메세지 Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. - 상황 $ sudo apt-get update Hit:1 https://apt.releases.hashicorp.com jammy InRelease Ign:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 InRelease Hit:3 http://security.ubuntu.com/ubuntu jammy-security..
2022.11.21 09:41 -
NAT 환경에서 공인 아이피 확인 하는 방법
개요 NAT 환경에서는 기본적인 방법으로 내가 사용하는 공인 아이피를 확인 하기 어렵다. 아래는 공인아이피를 CURL을 통해 확인하는 방법에 대해 정리했다. 확인방법 curl icanhazip.com curl ifconfig.me curl icanhazip.com curl ipinfo.io/ip curl ipecho.net/plain curl ident.me curl -s ipinfo.io/ip
2024.01.16 11:52 -
Editing "/etc/systemd/system/
.d/override.conf" canceled: temporary file is empty. - 개요 sudo systemctl edit >> Editing "/etc/systemd/system/sysstat-collect.timer.d/override.conf" canceled: temporary file is empty. - 해결 sudo systemctl --full edit - reference https://wiki.archlinux.org/title/systemd
2023.08.14 17:57