well-known 디렉토리와 securty.txt 그리고 humans.txt

간혹 웹 페이지를 들여다보면 .well-known 디렉토리를 만나게됩니다. 제 사이트도 올 1월에 security.txt를 추가했었는데, 그 땐 단순히 보안 취약점이나 이슈에 대한 제보를 위해서 만들었었습니다. 오늘은 이 .well-known 디렉토리의 의미와 어떻게 사용되는지 조금더 살펴볼까 합니다.

.well-known?

well-known 디렉토리는 RF8785 에 명시된 공식적인 URI입니다.

Abstract
   This memo defines a path prefix for "well-known locations",
   "/.well-known/", in selected Uniform Resource Identifier (URI)
   schemes.

어떻게 보면 robots.txt와 유사한 이 디렉토리는 사용자에게 제공하면 좋은 정보들을 모아놓는 디렉토리라고 생각하시면 될 것 같습니다. 일반적으로 security.txt, humans.txt, acme-challenge/, pki-validation/hash-value.txt 등이 사용됩니다.

여기서 acme는 let’s encrypt 인증서에서 사용되고 pki-validation은 AutoSSL 구성할 때 보통 사용됩니다. 오늘은 나머지인 security,.txt와 humans.txt에 대해 조금 더 자세히 알아보겠습니다.

.well-known/security.txt

security.txt를 조금 더 살펴보면 이렇습니다.

When security risks in web services are discovered by independent security researchers who understand the severity of the risk, they often lack the channels to disclose them properly. As a result, security issues may be left unreported. security.txt defines a standard to help organizations define the process for security researchers to disclose security vulnerabilities securely.

일반적으로 사이트의 보안 취약점이나 문제가 있는 경우에 공식적으로 제보할 수 있는 contact 주소를 남겨주는 목적으로 작성하며 크게 아래 포맷으로 구성됩니다.

Contact

연락할 수 있는 수단과 주소를 의미합니다. 보통 공식적인 이메일 주소를 기입하며, 버그바운티 등을 운영하는 경우 버그바운티 사이트, 공식 채널이 있는 경우 공식 채널의 링크 등이 들어갑니다.

Contact: mailto:your@mailaddress.com
Contact: https://example.com/your-contact-page

Expires

security.txt의 유효기간을 작성합니다.

Expires: Fri, 10 Oct 2025 10:10 +0900

Encryption

pgp 등을 통해 암호화된 이메일을 사용하는 경우 공개키의 주소를 입력해줍니다.

Encryption: https://example.com/pgp-public.key

Acknowledgments

혹시나 hall-of-fame 등 thanks to 같은 컨셉의 페이지의 주소를 기입합니다.

Acknowledgments: https://example.com/research.html

Preferred-Languages

사용하는 언어를 기입합니다.

Preferred-Languages: en

Canonical

security.txt 파일을 웹단에서 access 할 수 있는 주소를 의미합니다.

Canonical: https://www.example.com/.well-known/security.txt

Policy

정책에 대한 주소를 기입합니다.

Policy: https://example.com/policy

Hiring

채용에 대한 주소를 기입합니다.

Hiring: https://example.com/hiring

security.txt for me

# If you find any security issues on this site, please contact me!
Contact: mailto:hahwul@gmail.com
Contact: https://github.com/hahwul/asset-of-hahwul.com/discussions
Canonical: https://www.hahwul.com/.well-known/security.txt
Preferred-Languages: en, ko

.well-known/humans.txt

이참에 humans.txt도 작성해봅시다. humans.txt는 이름 그대로 이 서비스를 운영하는 사람의 정보를 제공해줍니다. 어차피 제 트위터나 메일등은 이미 어디서나 찾을 수 있는 수준이라.. 간단하게 추가해봤습니다. (정해진 포맷이 있는건 아닌 것 같습니다.)

HAHWUL
Site: https://www.hahwul.com
Twitter: hahwul

물론 humans.txt 에서 예시를 보면 서비스에 대한 정보도 기입하게 되어있으나, 이는 보안적인 관점에선 굳이 불필요한 정보는 안주는게 좋기 때문에 전 생략했습니다.

/* SITE */
Last update: YYYY/MM/DD
Standards: HTML5, CSS3,..
Components: Modernizr, jQuery, etc.
Software: Software used for the development

References