Application Security Flashcards

1
Q

Create a generic secret containing key-value pairs from literal values typed on the command
line:

A

$ oc create secret generic secret_name –from-literal key1=secret –from-literal key2=secret2

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

Create a generic secret called test-secret with the credentials for user1/password and connection information to access a MySQL
database.

A

$ oc create secret generic mysql –from-literal user=user1 –from-literal password=password –from-literal database=test_secrets –from-literal hostname=mysql

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

Command to expose the service named mysql with hostname mysql.apps.ocp.example.com so it can be accessed from outside the cluster

A

$ oc expose service mysql –hostname mysql.apps.ocp4.example.com

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

From the command line, create a passthrough route called myroute with the service myroute2, port 8443 and hostname myroute-default.app-crc.testing. Once created, use curl to test by host:

A

$ oc create route passthrough myroute –service myroute2 –port 8443 –hostname=myroute-default.app-crc.testing

$ curl https://myroute-default.app-crc.testing

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

How is service account exporter-sa associated with Security Context Constraint (scc) node-exporter?

A

As a cluster-admin:
$ oc create sa exportersa
$ oc adm policy add-scc-to-user node-exporter -z exporter-sa

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