Implementing DevOps Solutions and Practices Using Cisco Platforms (DEVOPS) — Question 59
A DevOps engineer must build a Docker image to containerize an application. Then the image must be pushed to a repository on Docker Hub in a CI/CD pipeline using GitHub Actions.
Which approach securely encrypts the Docker Hub access token as an environment variable within the CI/CD pipeline?
Answer options
- A. Store the access token with GitHub environment variables
- B. Store the access token with GitHub encrypted secrets
- C. Store the access token in an environment file in the repository
- D. Hard code the access token in the repository with Base64 encoding
Correct answer: B
Explanation
The correct answer is B because GitHub encrypted secrets provide a secure way to store sensitive information like access tokens, ensuring they are not exposed in logs or the repository. Options A and C are less secure as they may allow exposure of the token, while option D is also insecure since Base64 encoding does not encrypt the data, making it easily decodable.