challenges1 Flashcards
describe what a static website is
static website is a website that consists of only HTML, CSS and javascript files and does not require any server-side processing or database
Describe how the COPY
command is involved in transferring files.
The COPY command in a Dockerfile is used to copy files or directories from the host machine (the machine where the Docker build is being executed) into the Docker image that is being built. This command is essential for including application code, configuration files, scripts, and other necessary assets in your Docker image
List the ports required for web traffic
http = 80
hhtps = 443
Explain how to execute SQL scripts upon a mysql
container initialization.
Create an sql script and place it in the same directory as your docker file
Docker file:
From mysql:latest
Env nysql_root_password=1234
Copy {path to sql script} /docker-entrypoint-initdb.d/
Build the docker image -> docker build -t {name}
Docker run {name}
Describe what a requirements.txt
file is in the context of Python applications and why it is useful
requirements.txt is a text file that typically lists all the Python packages and their versions required for the application to run correctly
Describe the usage of either CMD
or ENTRYPOINT
to define the container’s startup command.
Cmd = specifies the default command to run when a container is launched if no other command is provided at runtime, this can be overridden by providing arguments in docker run command
Entrypoint = sets the primary command that is executed when a container is started, can not be overridden any arguments in docker run command will be appended tot he entrypoint command
Explain how to use pip
to install necessary Python libraries within the container.
first copy the requirements.txt file into your docker container,
You can use the command “RUN pip install -r requirements.txt” to install all the necessary python libraries that are specified within the requirements.txt file
Explain the difference between the -slim and -alpine versions of the python base image and why they are useful for minimizing container size.
-slim = the -slim version of the python base image is based on debian and is stripped down to include only the essential packages needed to run python applications
-alpine = the -alpine version of the python base image is based on alpine linux, a lightweight linux distribution designed for simplicity, security and efficiency
Define what is SAST (Static Application Security Testing) and how it differs from DAST (Dynamic Application Security Testing).
SAST = static application security testing refers to the process of analyzing an applications source code, bytecode, binary code for security vulnerabilities without executing the program (key characteristics: early detection, code analysis, development integration and comprehensive)
DAST = dynamic aplication security testing involves testing an application while it is running to identify vulnerabilities that an attacker could exploit in a live environment (key characteristics: runtime analysis, external testing, vulnerability identification, environment dependent
Difference =
SAST is conducted early in the software development lifecycle -> DAST later in the software development lifecycle,
SAST requires access to the source code,bytecode or binary code -> DAST only requires access to the running application,
SAST provides feedback about potential vulnerabilities before application is deployed -> DAST provides feedback about potential vulnerabilities in the deployed application
Compare and contrast SonarCloud and SonarQube as SAST tools for analyzing code quality and security.
Sonarcloud = sonarcloud is a fully hosted service running on the cloud, requires no installation or maintenance of servers
Sonarqube = sonarcube is self-hosted. Sonarqube is installed on your own servers, giving you control over the environment and data