nerdexam
Cisco

300-910 · Question #27

Which method is a safe way to provide a username/password combination to an application running as a service in a Docker container?

The correct answer is D. Docker secrets. The question asks for the most secure method to supply sensitive credentials, such as a username and password, to an application running within a Docker container.

Security

Question

Which method is a safe way to provide a username/password combination to an application running as a service in a Docker container?

Options

  • Aencode the value with base64 in a secure DNS CTEXT entry
  • Bas an environment variable in the Dockerfile
  • CDocker environment variable
  • DDocker secrets

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    3% (1)
  • D
    93% (27)

Why each option

The question asks for the most secure method to supply sensitive credentials, such as a username and password, to an application running within a Docker container.

Aencode the value with base64 in a secure DNS CTEXT entry

Encoding values in DNS CTEXT entries is not a standard, secure, or scalable method for storing application credentials.

Bas an environment variable in the Dockerfile

Storing environment variables directly in a Dockerfile makes them visible in the image history and can expose them during image inspection, making this an insecure practice.

CDocker environment variable

Docker environment variables, even passed via 'docker run -e', are less secure than Docker Secrets because they can be easily inspected using 'docker inspect' and may be stored in shell history or logs.

DDocker secretsCorrect

Docker Secrets is the recommended and safest way to manage sensitive data like passwords, API keys, or certificates for Docker Swarm services or standalone containers. Secrets are stored securely, encrypted in transit and at rest, and only mounted into the container's filesystem as an in-memory file at runtime, avoiding exposure in environment variables or image layers.

Concept tested: Docker secret management

Source: https://docs.docker.com/engine/swarm/secrets/

Topics

#Docker secrets#Container security#Secrets management#Credential handling

Community Discussion

No community discussion yet for this question.

Full 300-910 Practice