Skip to content

WS-Security and XML signature wrapping ​

Symptoms of WS-Security checks on SOAP messages (certificates, signatures, timestamps, replay and XML signature wrapping) and of the WS-Security keys used to decrypt and sign.

Every signed message is refused with api.wssec.cert ​

  • Cause: the signer's certificate is not in trusted_certs and does not chain to one; or it expired; or the partner sends only a key identifier for a certificate you did not list; or the chain is longer than 5 certificates.
  • Check: the event's value shows the certificate's subject and issuer and the reason. Compare with openssl x509 -noout -subject -issuer -dates -in certs/partner-ca.pem.
  • Fix: add the issuing CA, or the partner's certificate, to trusted_certs as a PEM file of the version. Revocation lists are not fetched, so remove a revoked certificate yourself.

api.wssec.signature: "the digest of #... does not match" ​

  • Cause: the element was changed after signing, by the client, by an intermediary that re-indents the XML, or by an attack. Also seen when a partner signs and then encrypts, and decrypt is off (the digest is over the plaintext).
  • Check: the event names the Reference and the element path. Is the message encrypted (an EncryptedData in the Body)?
  • Fix: turn on decrypt with the right key, or have the client stop reformatting the message after signing.

api.wssec.algorithm ​

  • Cause: a signature method not in algorithms; a SHA-1 digest or signature; a transform other than exclusive canonicalization or the enveloped signature (XPath, XSLT); inclusive canonicalization; RSA 1.5 key transport; or an RSA key under 2048 bits.
  • Check: the event value is the algorithm URI.
  • Fix: ask the partner for RSA-SHA256 (or ECDSA) with exclusive canonicalization and SHA-256 digests, and add the method to algorithms if it is one of the offered values. SHA-1 and DSA cannot be allowed.

api.wssec.timestamp on messages that look fresh ​

  • Cause: the clocks differ by more than max_clock_skew, or the partner sends long-lived timestamps and the message is older than max_age.
  • Check: the event shows the created and expires values; compare them with the node's time (timedatectl).
  • Fix: synchronize the clocks (NTP) on both sides. Raise max_clock_skew or max_age only if the partner cannot.

api.wssec.replay on legitimate retries ​

  • Cause: the client resends the identical signed message after a timeout. Each signed message is accepted once within replay_window.
  • Fix: have the client sign again (with a new timestamp) on retry. The record is kept per node, so after a failover a message seen only on the other node is not known.

api.xsw.* refusals ​

  • Cause: a wrapping attack, or a toolkit that places signed elements unusually: a second Body or Security header, a reused Id value, a signed element inside a wrapper or a ds:Object, or extra elements next to a signed operation element.
  • Check: the event names the element path and where it was expected.
  • Fix: for a toolkit layout that you reviewed and know to be safe, set wrapping: false for that application only. The signed-part coverage still checks that the Body the application reads is signed.

Storing a WS-Security key or certificate is refused ​

  • Symptom: the Keys or Certificates card, or waap api wssec key set or cert set, answers 422 or 403.
  • Cause: 403: only administrators store or remove keys. 422: the file is not a PEM private key (the message never repeats it), a decryption key is not RSA, the name has characters other than letters, digits, dot, underscore and dash, or a certificate upload holds a private key or no certificate. 409 on removing a key: the running configuration uses it.
  • Check: the message; waap api wssec keys -app NAME (the "in use" column).
  • Fix: upload the right file as an administrator. To remove a key, first change decrypt_key or sign_key, or turn the feature off, and apply.

Overview warning api.key_missing ("the policy names ... key ... but it is not stored on this node") ​

  • Symptom: a "problem" warning on the application in the overview and the warnings list.
  • Cause: the running policy turns on ws_security.decrypt or sign_responses, or has a play_integrity verifier, but the key it names (by key name, or both Play keys by verifier name) is not in this node's key store: it was never uploaded, was removed, or is not yet synced to a standby. The policy still applies, so this is a warning, not a refusal. Messages that need the key fail, and the failure policy decides.
  • Check: waap api wssec keys -app NAME and waap api attest keys -app NAME. The warning text names the setting, kind and name.
  • Fix: upload the key under exactly that name and kind (the warning carries the command), or turn the setting off and apply. The warning clears on the next overview refresh.

"decrypt key ... is not on this node" (inspection error) ​

  • Cause: decrypt is on, but the key named in decrypt_key (kind wssec-decrypt) was not uploaded, was removed, or is not a PEM private key; or the key ring has not synced to this node yet.
  • Check: the application's WS-Security key list (name, kind, fingerprint); the inspection error count of the ws_security module.
  • Fix: upload the key under that name and kind. Until then the failure policy decides: fail-open passes the encrypted message to the upstream.

api.wssec.decrypt: "the key could not be decrypted" ​

  • Cause: the message was encrypted for another certificate, or the uploaded key does not belong to the certificate that partners use.
  • Fix: give partners the certificate that matches the uploaded key. Events never carry key material or plaintext.

Answers are not signed ​

  • Cause: the answer is not XML (by Content-Type), is not a SOAP envelope, is over the response body limit, or sign_key is missing on the node (an inspection error).
  • Check: the transaction's trace shows "body: answer signed" when the answer was signed.
  • Fix: raise policy.response.max_body, upload the wssec-sign key, or check the answer's content type.