challenges1 Flashcards

1
Q

describe what a static website is

A

static website is a website that consists of only HTML, CSS and javascript files and does not require any server-side processing or database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe how the COPY command is involved in transferring files.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List the ports required for web traffic

A

http = 80
hhtps = 443

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain how to execute SQL scripts upon a mysql container initialization.

A

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}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe what a requirements.txt file is in the context of Python applications and why it is useful

A

requirements.txt is a text file that typically lists all the Python packages and their versions required for the application to run correctly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the usage of either CMD or ENTRYPOINT to define the container’s startup command.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain how to use pip to install necessary Python libraries within the container.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the difference between the -slim and -alpine versions of the python base image and why they are useful for minimizing container size.

A

-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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define what is SAST (Static Application Security Testing) and how it differs from DAST (Dynamic Application Security Testing).

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Compare and contrast SonarCloud and SonarQube as SAST tools for analyzing code quality and security.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly