Make sure your server uses the https protocol

이 제품은 선택한 Datadog 사이트에서 지원되지 않습니다. ().
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Metadata

ID: typescript-express/https-protocol-missing

Language: TypeScript

Severity: Notice

Category: Security

CWE: 693

Description

Your server should use the HTTPS protocol to receive connections. You may do this by placing an HTTPS reverse proxy in front of your HTTP server, or by using https.createServer() instead of http.createServer().

Per Express documentation:

If your app deals with or transmits sensitive data, use Transport Layer Security (TLS) to secure the connection and the data. This technology encrypts data before it is sent from the client to the server, thus preventing some common (and easy) hacks.

Non-Compliant Code Examples

import http from 'http';
import express, { Express } from 'express';

const app: Express = express();

var httpServer = http.createServer(app)
httpServer.listen(8080);

Compliant Code Examples

import https from 'https';
import fs from 'fs';
import express, { Express } from 'express';

const app: Express = express();

var options = {
  key: fs.readFileSync('path/to/the/key.pem'),
  cert: fs.readFileSync('path/to/the/cert.cert')
};

var httpsServer = https.createServer(options, app)
httpsServer.listen(443);
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

원활한 통합. Datadog Code Security 사용해 보기