Skip to main content
Last Updated: November 11, 2025
Target Audience: System Administrators, Backend Developers, DevOps Engineers
This document explains the detailed usage of a specific policy. If you are using Apinizer policy structure for the first time or want to learn the general working principles of policies, we recommend reading the What is Policy? page first.

Return Status Codes

Overview

What is its Purpose?

  • Adding security layer to SOAP target: Meets integration requirements by adding security components compliant with WS-Security standards to messages going to target service.
  • Authentication and authorization enforcement: Includes necessary credentials and digital signature in messages for services requiring UsernameToken or signature verification.
  • Ensuring data integrity and privacy: Protects message integrity and privacy during transmission by controlling encryption and signing order.
  • Compliance and auditability: Facilitates passing compliance checks of service providers with timestamp and Must Understand settings.

Working Principle

  1. Request Arrival: For each HTTP/HTTPS request arriving at the API Gateway, the source IP address of the request is identified.
  2. Policy Check: If the WS Security To Target policy is active, the system checks in the following order:
    • Is a Condition defined? If so, is the condition met?
    • Is the policy active (active=true)?
    • Is a Variable used or is Apinizer default?
  3. Compilation of Security Components: WS-Security entry order (Timestamp, UsernameToken, Encryption, Signature) in policy definition is read; necessary keys, passwords, and algorithms are validated for each selected component and prepared to be added to SOAP envelope.
  4. Decision Making:
    • Match Found: If required fields of all selected components are filled and keystore access is provided, SOAP message is updated and securely routed to target Endpoint.
    • No Match: If missing certificate, user information, or algorithm selection is detected, policy execution is stopped and error response is prepared for request.
  5. Error Handling: Customizable HTTP status code and error message are returned for requests that do not comply with the policy rule.

Features and Capabilities

Basic Features

  • Multiple WS-Security Component Management: Meets target WS-Security requirements by combining Timestamp, UsernameToken, Encryption, and Signature elements in a single policy.
  • Dynamic Operation Order: Matches the order expected by service provider by determining execution order of security components with drag-and-drop.
  • Part-Based Encryption/Signing: Supports part-based encryption and signature definitions by selecting specific element or content parts of SOAP message.
  • Active/Passive Status Control: Easily change the active or passive status of the policy (active/passive toggle). In passive state, the policy is not applied but its configuration is preserved.
  • Condition-Based Application: Determine when the policy will be applied by creating complex conditions with Query Builder (e.g., only for specific endpoints or header values).

Advanced Features

  • Keystore Integration: Provides centralized certificate management by selecting encryption and signature keystores through Apinizer Secret Manager.
  • Algorithm Flexibility: Provides ability to select Symmetric, Key Encryption, Signature, Canonicalization, and Digest algorithms from standard lists.
  • Custom Key Identifiers: Meets special requirements of target services with custom SOAP header fields such as Custom Key Info or Embedded Key Info.
  • Export/Import Feature: Export policy configuration as a ZIP file. Import to different environments (Development, Test, Production). Version control and backup capability.
  • Policy Group and Proxy Group Support: Manage multiple policies within Policy Group. Bulk policy assignment to Proxy Groups. Centralized update and deployment operations.
  • Deploy and Versioning: Deploy policy changes to live environment. See which API Proxies use it (Policy Usage). Proxy Group and Policy Group usage reports.

Usage Scenarios

Configuring Policy Parameters

At this step, users can create a new policy or configure existing policy parameters to define access rules. The defined parameters directly affect how the policy works (e.g., which IPs will be allowed, geographical restrictions, conditional activations, etc.). This way, the policy can be customized according to organization-specific requirements and managed centrally.

Creating a New WS Security To Target Policy

WS Security To Target Policy

Configuration Steps

For the description of Conditions and Error Message Customization panels, you can refer to the Conditions section on the What is Policy? page. For a complete guide on all layers, priority order and scenario examples of the error message configuration system, see the Error Message Configuration Guide page.

Deleting the Policy

For the deletion steps of this policy and the operations to be applied when it is in use, you can refer to the Removing Policy from Flow section on the Policy Management page.

Exporting/Importing the Policy

For the export and import steps of this policy, you can refer to the Export/Import page.

Linking the Policy to API

For the process of how this policy will be linked to APIs, you can refer to the Adding Policy to Flow section on the Policy Management page.

Advanced Features

Best Practices

Things to Do and Best Practices

Security Best Practices

Things to Avoid

Performance Tips

Frequently Asked Questions (FAQ)