LPIC-3 Security study materials
LPIC-3 Security study resources

LPIC-3 Security practice questions

One question at a time. Build your LPIC-3 Security understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Cryptography

Which OpenSSL 3 command uses the generic key-generation interface to create a 4096-bit RSA private key protected with AES-256 encryption of the key file itself?

  1. openssl genrsa -aes256 -out key.pem 4096
  2. openssl genpkey -aes256 -out key.pem -algorithm rsa -pkeyopt bits:4096 Correct answer.
  3. openssl req -aes256 -newkey rsa:4096 -out key.pem
  4. openssl rsa -aes256 -out key.pem 4096

Explanation

In OpenSSL 3, genpkey provides the generic key-generation interface. With -algorithm rsa and -pkeyopt bits:4096, it generates a 4096-bit RSA key; -aes256 encrypts the output private-key file using a passphrase. The genrsa command can also generate encrypted RSA keys, but uses the RSA-specific interface.

Question 2Cryptography

A CSR is submitted to a CA. Which content is covered by the signature the requester places on that CSR?

  1. The subject DN and public key together with any requested extensions Correct answer.
  2. The full certificate chain supplied by the requester
  3. The subject DN only, with the public key transmitted separately
  4. The private key and subject DN, encrypted with the CA public key

Explanation

A PKCS#10 certification request signs a structure containing the subject distinguished name, the public key, and optional attributes such as requested extensions. The private key never leaves the requester and is never part of the signed data.

Question 3Cryptography

What is the primary purpose of a Diffie-Hellman ephemeral (DHE) key exchange in TLS?

  1. To authenticate the server using a long-term RSA key
  2. To compress the handshake and reduce round trips
  3. To provide forward secrecy so past sessions stay safe if the long-term key leaks Correct answer.
  4. To encrypt the server certificate for the client

Explanation

Ephemeral DH generates fresh per-session parameters that are discarded afterwards, so compromise of the server's long-term private key does not expose recorded sessions. Authentication is a separate function performed by certificates and signatures.

Question 4Cryptography

In a GnuPG key listing, a key shows usage flags of [SC] for the primary key and [E] for a subkey. What does this configuration mean in practice?

  1. The subkey certifies other keys and the primary key encrypts messages
  2. The primary key is a signing-only key that must be exported for encryption
  3. The primary key signs and encrypts, while the subkey only certifies
  4. The primary key signs and certifies, while the subkey performs encryption Correct answer.

Explanation

GnuPG usage flags mark capabilities: S is sign, C is certify, E is encrypt, and A is authenticate. The usual best practice is a certify/sign primary key kept offline with a separate encryption subkey.

Question 5Cryptography

Which statement correctly distinguishes X.509 certificate revocation lists from OCSP?

  1. A CRL is a signed list of revoked serial numbers, while OCSP returns the status of a single certificate on request Correct answer.
  2. A CRL is encrypted, while OCSP responses are always plaintext
  3. A CRL can only revoke CA certificates, while OCSP revokes end-entity certificates
  4. A CRL is issued per client, while OCSP is issued per server

Explanation

A CRL is a time-stamped, CA-signed list of revoked certificate serial numbers, which clients download and cache. OCSP queries a responder about one specific certificate, avoiding the download of a whole list but adding a per-query dependency.

Question 6Cryptography

What does the following command produce: openssl x509 -in cert.pem -noout -fingerprint -sha256

  1. The SHA-256 fingerprint of the certificate in cert.pem Correct answer.
  2. A new self-signed certificate signed with SHA-256
  3. The public key extracted from cert.pem and hashed
  4. A SHA-256 signature added to cert.pem

Explanation

The x509 subcommand parses an existing certificate, and -fingerprint -sha256 prints the digest of the whole DER-encoded certificate. -noout suppresses the default PEM dump. No signing or modification of the file occurs.

Question 7Cryptography

Which property must a cryptographic hash function have to prevent an attacker from finding any second input mapping to a given digest?

  1. Preimage resistance
  2. Key recovery resistance
  3. Collision resistance
  4. Second preimage resistance Correct answer.

Explanation

Second preimage resistance means that given one input and its digest, an attacker cannot feasibly find a different input with the same digest. Preimage resistance concerns finding any input for a specified digest, and collision resistance concerns finding any two colliding inputs.

Question 8Cryptography

Which algorithm is a stream cipher designed for authenticated encryption in TLS 1.3?

  1. AES-256-CBC
  2. 3DES-EDE
  3. Blowfish-CBC
  4. ChaCha20-Poly1305 Correct answer.

Explanation

ChaCha20-Poly1305 combines a stream cipher with a polynomial MAC and is one of the mandatory cipher suites in TLS 1.3. The other listed algorithms are legacy block cipher modes that TLS 1.3 does not permit.

Question 9Cryptography

An administrator runs gpg --export-secret-keys and stores the output on a shared server. What is the main security consequence?

  1. The export invalidates the original key on the local machine
  2. The exported file contains unencrypted public keys only
  3. The exported file can be imported elsewhere and, if unprotected, allows signing as the key owner Correct answer.
  4. The export automatically revokes all subkeys

Explanation

Secret key export includes the private key material, so anyone who obtains the file and its passphrase can sign or decrypt as the owner. Protecting the export with a strong passphrase and offline storage is essential.

Question 10Cryptography

What is the role of the Subject Alternative Name extension in a TLS server certificate?

  1. It stores the certificate revocation list distribution point
  2. It specifies the key usage bits for the public key
  3. It identifies the CA that signed the certificate
  4. It lists the DNS names and IP addresses for which the certificate is valid Correct answer.

Explanation

Modern clients match the requested hostname against the dNSName and iPAddress entries in subjectAltName rather than the legacy commonName. A certificate without a matching SAN entry fails hostname verification.

Question 11Cryptography

A file encrypted with openssl enc -aes-256-cbc -pbkdf2 -salt must be decrypted on another host. Which information is required in addition to the passphrase?

  1. The original file name and modification time
  2. The cipher, mode, and PBKDF2 parameters used, plus the salt stored in the file header Correct answer.
  3. The RSA private key of the encrypting host
  4. The SHA-256 fingerprint of the plaintext

Explanation

openssl enc stores the salt in the file header when -salt is used, but the cipher, mode, digest, and iteration count are not recorded and must be supplied again. Without matching parameters the derived key differs and decryption fails.

Question 12Cryptography

Why is RSA-OAEP preferred over RSA with PKCS#1 v1.5 padding for encryption?

  1. OAEP removes the need for a random number generator
  2. OAEP allows the same key to be used for both signing and encryption
  3. OAEP is a provably secure padding scheme that avoids the Bleichenbacher-style attacks affecting v1.5 Correct answer.
  4. OAEP produces shorter ciphertexts for the same key size

Explanation

RSAES-OAEP uses a Feistel-like construction with a hash to achieve IND-CCA2 security, whereas PKCS#1 v1.5 encryption is vulnerable to adaptive chosen-ciphertext attacks such as Bleichenbacher's. OAEP requires good randomness and correct implementation.

Question 13Cryptography

Which command generates a Certificate Signing Request together with a new 2048-bit RSA key in a single step using OpenSSL?

  1. openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -out req.csr Correct answer.
  2. openssl genpkey -out req.csr -algorithm rsa
  3. openssl ca -new -keyout key.pem -out req.csr
  4. openssl x509 -req -newkey rsa:2048 -out req.csr

Explanation

openssl req -new creates a CSR, and -newkey generates the key in the same invocation; -nodes omits passphrase encryption of the key file. The x509 and ca subcommands operate on existing requests or certificates.

Question 14Cryptography

In a PKI, what does cross-signing a CA certificate accomplish?

  1. It converts a root CA into an intermediate CA permanently
  2. It re-encrypts the CA private key under a new passphrase
  3. It extends the validity period of the original CA certificate
  4. It creates a certificate for the same CA key issued by another CA, allowing trust to bridge between hierarchies Correct answer.

Explanation

Cross-signing issues a certificate over an existing CA's public key from a different CA, so clients trusting either hierarchy can build a path to the same key. It is common during root rollovers and in bridged trust models.

Question 15Cryptography

Which statement about the GnuPG trust model is accurate?

  1. Trust is assigned by the local user to keys based on signatures and ownertrust settings Correct answer.
  2. Trust is determined solely by the key's creation date
  3. Trust requires a central CA to issue a certificate for every key
  4. Trust is derived automatically from the DNS domain in the user ID

Explanation

GnuPG uses the web of trust: users assign ownertrust to keys, and the validity of other keys is computed from signatures made by trusted keys. There is no central authority and no DNS-based trust.

Question 16Cryptography

What is the effect of the basicConstraints extension with CA:FALSE on an end-entity certificate?

  1. The certificate cannot be used to sign other certificates Correct answer.
  2. The certificate's public key must be an RSA key
  3. The certificate must be revoked before its expiry date
  4. The certificate cannot be used for TLS server authentication

Explanation

basicConstraints with CA:FALSE marks the certificate as not being a CA, so it must not be used to issue or sign subordinate certificates. Path validation enforces this constraint regardless of key type or intended purpose.

Question 17Cryptography

Which mode of operation must never be used for disk or message encryption because it produces identical ciphertext for identical plaintext blocks?

  1. Galois/Counter Mode (GCM)
  2. Output Feedback (OFB)
  3. Electronic Codebook (ECB) Correct answer.
  4. Cipher Block Chaining (CBC)

Explanation

ECB encrypts each block independently, so repeated plaintext blocks yield repeated ciphertext blocks and leak structure. CBC, GCM, and OFB all incorporate changing state so equal blocks encrypt differently.

Question 18Cryptography

An administrator needs to verify that a detached signature file.asc matches data.tar.gz using GnuPG. Which command performs this check?

  1. gpg --detach-sign data.tar.gz
  2. gpg --sign data.tar.gz
  3. gpg --verify file.asc data.tar.gz Correct answer.
  4. gpg --encrypt --sign data.tar.gz

Explanation

gpg --verify takes the signature file first and the signed data second when the signature is detached. It recomputes the digest and checks the signature against the signer's public key.

Question 19Cryptography

Why does TLS 1.3 remove support for static RSA key transport in favor of (EC)DHE?

  1. Static RSA key transport requires certificates to be revoked after each handshake
  2. Static RSA key transport cannot authenticate the server
  3. Static RSA key transport is slower than every elliptic curve operation
  4. Static RSA key transport cannot provide forward secrecy if the server key is later compromised Correct answer.

Explanation

With static RSA key transport the client encrypts the premaster secret to the server's long-term key, so anyone who later obtains that key can decrypt recorded sessions. Ephemeral (EC)DHE derives fresh shared secrets per handshake and provides forward secrecy.

Question 20Cryptography

Which OpenSSL command inspects the contents of a PKCS#12 bundle?

  1. openssl pkcs7 -in bundle.p12 -print_certs
  2. openssl req -in bundle.p12 -verify
  3. openssl x509 -in bundle.p12 -text
  4. openssl pkcs12 -in bundle.p12 -info -noout Correct answer.

Explanation

The pkcs12 subcommand with -info parses the bundle and prints its MAC, salt, and contained items; -noout suppresses the PEM output. The x509 and req subcommands expect PEM or DER certificate or request data, not a PKCS#12 container.

Question 21Cryptography

What is the purpose of a key usage extension value of keyEncipherment on a TLS server certificate using RSA key transport?

  1. It allows the public key to encrypt a symmetric key during the handshake Correct answer.
  2. It restricts the certificate to client authentication only
  3. It enables the key to encrypt the certificate itself
  4. It permits the key to sign certificate requests

Explanation

keyEncipherment authorizes use of the public key for encrypting key material, which is exactly what RSA key transport does. Signing operations instead require digitalSignature, and client-only restriction would come from extendedKeyUsage.

Question 22Cryptography

Which statement about SHA-1 in certificate signatures is correct for current practice?

  1. SHA-1 collisions are practical, so public CAs and browsers no longer accept SHA-1 signatures Correct answer.
  2. SHA-1 is only weak when used with HMAC
  3. SHA-1 is acceptable if the RSA key is 4096 bits
  4. SHA-1 is still the recommended default for new CA certificates

Explanation

Chosen-prefix collisions against SHA-1 have been demonstrated, so browsers and public CAs reject SHA-1 signed certificates. Larger RSA keys do not compensate for a broken hash.

Question 23Cryptography

An SSH host presents an Ed25519 host key. What does the client verify during host authentication?

  1. That the host key fingerprint matches the one embedded in the client binary
  2. That the host decrypted a challenge encrypted with the client's public key
  3. That the host key is signed by a public CA in every deployment
  4. That the host signed the session exchange hash with the private half of the host key Correct answer.

Explanation

In SSH the server proves possession of the host private key by signing the exchange hash, and the client checks that signature against the host public key. Trust in that public key comes from known_hosts or a configured CA, not from the binary.

Question 24Cryptography

Which command adds an ASCII-armored public key in pub.asc to the current user's GnuPG keyring?

  1. gpg --sign-key pub.asc
  2. gpg --import pub.asc Correct answer.
  3. gpg --export pub.asc
  4. gpg --recv-keys pub.asc

Explanation

gpg --import reads key material from a file and adds it to the keyring. --recv-keys expects a key ID and fetches from a keyserver, while --export writes keys out.

Question 25Cryptography

What distinguishes a certificate chain's root CA from an intermediate CA during path validation?

  1. The root uses RSA while intermediates must use ECDSA
  2. The root has no private key and cannot issue certificates
  3. The intermediate is always installed in the operating system trust store
  4. The root is self-signed and is a trust anchor, while the intermediate is signed by another CA and must chain to a trusted root Correct answer.

Explanation

A root CA certificate is self-signed and serves as a trust anchor that clients already trust; intermediates are issued by a CA above them and must be accompanied by a valid path to a trusted anchor. Algorithm choice and trust-store placement do not define the roles.

Question 26Cryptography

Which OpenSSL subcommand is used to generate a Diffie-Hellman parameter file suitable for use with dhparam-based TLS configurations?

  1. openssl genpkey
  2. openssl dhparam Correct answer.
  3. openssl rand
  4. openssl gendsa

Explanation

The dhparam subcommand generates and optionally checks Diffie-Hellman parameters, producing the prime and generator values used for finite-field DH key exchange. genpkey is for general private keys such as RSA or EC, and gendsa creates DSA keys, not DH parameters.

Question 27Cryptography

An administrator wants to store a private key in a PKCS#8 container encrypted with AES-256. Which openssl genpkey option enables this encryption?

  1. -aes256
  2. -des3
  3. -cipher aes-256-cbc Correct answer.
  4. -nodes

Explanation

genpkey uses the -cipher option (or its alias -<cipher>) to specify the symmetric algorithm protecting the output; -cipher aes-256-cbc selects AES-256-CBC for PKCS#8 encryption. The -nodes option explicitly disables encryption, and -des3 selects a weaker legacy cipher.

Question 28Cryptography

Which OpenSSL command verifies a PKCS#7/CMS signature structure stored in signed.p7s against the detached content data.bin?

  1. openssl verify -CAfile data.bin signed.p7s
  2. openssl cms -verify -in signed.p7s -content data.bin -inform DER -binary Correct answer.
  3. openssl smime -verify -in signed.p7s -content data.bin -noverify
  4. openssl pkcs7 -print_certs -in signed.p7s

Explanation

The cms subcommand with -verify checks the signature over the detached content supplied via -content; -binary prevents canonicalization of the content, and -inform DER selects the encoding. The smime variant is legacy and the pkcs7 subcommand only prints certificates without verifying signatures.

Question 29Cryptography

What is the primary cryptographic purpose of the Diffie-Hellman key exchange in a TLS handshake?

  1. To encrypt the server's private key for transport
  2. To authenticate the server's identity to the client
  3. To establish a shared symmetric secret over an insecure channel Correct answer.
  4. To provide non-repudiation of the handshake transcript

Explanation

Diffie-Hellman allows two parties to derive a common secret over a public channel without transmitting it directly, and that secret seeds the symmetric session keys. Authentication comes from certificates and signatures, not from DH itself.

Question 30Cryptography

Which property distinguishes AES-GCM from AES-CBC when used for message encryption?

  1. GCM is a block cipher mode while CBC is a stream mode
  2. CBC provides integrity protection through its padding
  3. GCM provides authenticated encryption with an integrated tag Correct answer.
  4. CBC requires a nonce while GCM requires an IV

Explanation

AES-GCM is an AEAD mode that produces a ciphertext plus an authentication tag, detecting tampering during decryption. CBC only provides confidentiality and must be paired with a separate MAC such as HMAC to gain integrity.

Question 31Cryptography

An administrator needs to create an EC private key on the P-256 curve using modern OpenSSL syntax. Which command accomplishes this?

  1. openssl ecparam -name prime256v1 -genkey -noout -out key.pem Correct answer.
  2. openssl ec -in key.pem -pubout
  3. openssl req -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -keyout key.pem
  4. openssl genrsa -out key.pem 256

Explanation

ecparam with -name prime256v1 and -genkey creates an EC private key on the NIST P-256 curve, and -noout suppresses the parameter dump. genrsa produces RSA keys, and ec -pubout only extracts a public key from an existing key.

Question 32Cryptography

What does the openssl dgst -sha256 -sign key.pem command produce when given an input file?

  1. An encrypted copy of the file using the private key
  2. A SHA-256 hash of the file written to stdout
  3. A certificate signing request containing the file's hash
  4. A digital signature over the file's SHA-256 digest using the private key Correct answer.

Explanation

dgst with -sign computes the digest of the input and then signs that digest with the private key, producing a binary signature. It does not emit the bare hash unless -sign is omitted, and it never encrypts the file itself.

Question 33Cryptography

Which mechanism allows a GnuPG key to remain usable for signing while its private key material is kept offline on a smartcard?

  1. Publishing the secret key to a keyserver
  2. Exporting the primary secret key to the card and keeping subkeys online
  3. Using a subkey for signing with the primary key stored on the card Correct answer.
  4. Enabling --trust-model always

Explanation

GnuPG separates the primary key from subkeys; signing and encryption subkeys can be moved to a smartcard while the primary key stays offline for certification. This limits exposure of the certification key and supports revocation.

Question 34Cryptography

In X.509 path validation, what is the role of the authorityKeyIdentifier extension?

  1. It specifies the permitted key usages of the subject
  2. It defines the validity period of the certificate
  3. It links a certificate to the specific key of its issuing CA Correct answer.
  4. It identifies the public key algorithm of the subject

Explanation

The authorityKeyIdentifier contains a reference (often the key identifier) to the public key of the CA that signed the certificate, helping validators select the correct issuer certificate when multiple CA certificates share a subject name. It does not define usages or validity.

Question 35Cryptography

Why is it dangerous to reuse the same nonce with AES-GCM under a given key?

  1. It disables the authentication tag
  2. It forces the use of a shorter key
  3. It allows recovery of the authentication key and plaintext relationships Correct answer.
  4. It causes the ciphertext to be truncated

Explanation

GCM derives its authentication key from the nonce via GHASH; repeating a nonce with the same key collapses this to a reusable value, enabling forgery and XOR-style recovery of plaintext. Nonce uniqueness is therefore a strict requirement for GCM.

Question 36Cryptography

Which statement best describes the difference between a certificate's keyUsage and extendedKeyUsage extensions?

  1. keyUsage specifies the issuer while extendedKeyUsage specifies the subject
  2. keyUsage is deprecated; extendedKeyUsage replaces it entirely
  3. extendedKeyUsage applies only to root CAs
  4. keyUsage defines broad cryptographic operations; extendedKeyUsage narrows permitted purposes Correct answer.

Explanation

keyUsage lists basic cryptographic operations the key may perform (digitalSignature, keyEncipherment, etc.), while extendedKeyUsage refines the intended application purpose such as serverAuth or clientAuth. Validators check both when present.

Question 37Cryptography

A server presents a certificate chain that omits the intermediate CA. What is the most likely consequence during client validation?

  1. The client rejects the certificate because the root is missing
  2. The client re-signs the certificate with the root key
  3. The client accepts the certificate because the leaf is signed by a trusted root
  4. The client builds the chain using AIA and local trust stores if possible, otherwise validation fails Correct answer.

Explanation

Clients may fetch missing intermediates via the Authority Information Access extension or find them in local caches; if no path to a trusted root can be built, validation fails with an incomplete-chain error. The root is normally not sent at all, so its absence is expected.

Question 38Cryptography

Which OpenSSL command checks whether a private key matches the public key in a certificate?

  1. openssl rsa -check -in cert.pem
  2. openssl verify -CAfile cert.pem key.pem
  3. openssl x509 -in cert.pem -noout -modulus | openssl md5 and compare with the key modulus Correct answer.
  4. openssl req -in cert.pem -noout -text

Explanation

For RSA keys, comparing the modulus printed by x509 -modulus with that printed by rsa -modulus confirms the key pair matches the certificate. The verify subcommand validates chains and cannot compare a key to a certificate.

Question 39Cryptography

What is the effect of using openssl enc -aes-256-cbc without -pbkdf2 on modern OpenSSL for passphrase-based encryption?

  1. It uses the legacy EVP_BytesToKey derivation, which is weaker than PBKDF2 Correct answer.
  2. It refuses to run without a key file
  3. It automatically enables PBKDF2
  4. It uses a random key unrelated to the passphrase

Explanation

Without -pbkdf2, openssl enc derives the key and IV via the legacy EVP_BytesToKey function with a single iteration, which is far weaker against brute force than PBKDF2. Supplying -pbkdf2 with an iteration count is recommended for passphrase-based files.

Question 40Cryptography

Which file format does openssl pkcs12 -export produce by default when no output encoding option is given?

  1. A binary DER-encoded PKCS#12 file Correct answer.
  2. An ASCII-armored OpenPGP message
  3. A base64-encoded JSON document
  4. A PEM-armored text file

Explanation

pkcs12 -export writes a binary DER-encoded PKCS#12 structure by default, which can hold a private key, certificate, and chain. PEM output requires explicit options such as -out with appropriate tooling, and PKCS#12 is unrelated to OpenPGP.

Question 41Host Security

Which PAM module is used to restrict access to a service based on entries in /etc/security/access.conf?

  1. pam_listfile
  2. pam_securetty
  3. pam_wheel
  4. pam_access Correct answer.

Explanation

pam_access consults /etc/security/access.conf, where each line lists a permission, a user or group, and a host or tty origin. The module is typically invoked as the access phase of the stack and denies anything not explicitly permitted.

Question 42Host Security

In a PAM configuration line, what does the control flag 'requisite' mean when the module returns failure?

  1. The failure is recorded but the remaining modules still run before the final result is returned.
  2. The return value is ignored and only the next module's result matters.
  3. The module is skipped entirely unless the user is root.
  4. The stack immediately returns failure to the application without running further modules. Correct answer.

Explanation

A requisite module that fails causes an immediate failure return, so later modules in the stack are not evaluated. This is why requisite is often used for the password check before other steps.

Question 43Host Security

Which file contains the password quality and complexity rules enforced by pam_pwquality?

  1. /etc/security/pwquality.conf Correct answer.
  2. /etc/pam.d/pwquality
  3. /etc/login.defs
  4. /etc/pam.conf

Explanation

pam_pwquality reads its defaults from /etc/security/pwquality.conf, where directives such as minlen, dcredit, and retry are set. Individual PAM lines may override these with module arguments.

Question 44Host Security

Which command loads rules into the Linux kernel audit subsystem after adding them to /etc/audit/rules.d/audit.rules?

  1. auditctl -s
  2. ausearch -m CONFIG_CHANGE
  3. aureport --summary
  4. augenrules --load Correct answer.

Explanation

augenrules --load merges the files in /etc/audit/rules.d into /etc/audit/audit.rules and loads them into the kernel. The auditctl command can load individual rules but does not assemble the rules.d fragments.

Question 45Host Security

Which SELinux context type is assigned to a regular file created in a directory labeled with type httpd_sys_content_t when no type transition rule applies?

  1. httpd_sys_content_t Correct answer.
  2. unconfined_u
  3. default_t
  4. httpd_t

Explanation

Without a type transition, a new file inherits the type of its parent directory, so a file created under an httpd_sys_content_t directory receives that same type. Type transitions only occur when a policy rule specifies them.

Question 46Host Security

Which file must be edited to persistently change the SELinux mode to enforcing on a system using the default policy?

  1. /etc/default/grub
  2. /etc/selinux/config Correct answer.
  3. /etc/sysconfig/selinux
  4. /etc/security/selinux.conf

Explanation

The SELINUX= directive in /etc/selinux/config controls the persistent mode (enforcing, permissive, or disabled). The change takes effect on the next boot.

Question 47Host Security

Which AppArmor tool loads a profile from a file into the kernel and reports syntax errors?

  1. apparmor_parser Correct answer.
  2. aa-genprof
  3. aa-complain
  4. aa-status

Explanation

apparmor_parser -r (or -a) compiles and loads a profile, and it prints parse errors. The other tools query or change profile state rather than load profile text.

Question 48Host Security

What is the primary purpose of the Linux Integrity Measurement Architecture (IMA) in an appraisal configuration?

  1. To encrypt files at rest using keys stored in the kernel.
  2. To measure file hashes against a signed policy and deny access to files that fail appraisal. Correct answer.
  3. To log every execve call to the audit trail.
  4. To assign SELinux labels to newly created files.

Explanation

IMA appraisal compares file hashes with values in a signed measurement list and blocks access to files whose hash does not match. Measurement and appraisal are separate but related IMA features.

Question 49Host Security

A service's PAM stack contains 'auth required pam_unix.so' followed by 'auth requisite pam_deny.so'. What happens when a user supplies a valid password?

  1. Authentication succeeds because pam_unix already returned success.
  2. Authentication fails because pam_deny is evaluated and returns failure. Correct answer.
  3. Authentication succeeds but a warning is logged.
  4. The PAM stack is invalid and the service refuses to start.

Explanation

The required flag records the pam_unix success but continues to the next module. pam_deny then returns failure with the requisite flag, which immediately fails the whole stack.

Question 50Host Security

You want members of group 'admins' to authenticate with a YubiKey or fall back to a password, but other users must use only a password. Which PAM construct achieves this?

  1. Setting the sufficent flag on pam_unix for everyone
  2. Two separate files in /etc/pam.d with the same service name
  3. A single auth line using pam_succeed_if to skip pam_u2f for non-admins, followed by pam_unix Correct answer.
  4. A pam_deny line placed before pam_unix for all users

Explanation

pam_succeed_if can test group membership and, with the 'die' or 'ignore' semantics, cause the second-factor module to be skipped for users outside the group while still falling through to pam_unix. This conditional stacking is the standard way to vary authentication by user class.