This is unreleased documentation for Admission Controller 1.30-next.

Swift

As stated on the official website:

Swift is a general-purpose programming language that’s approachable for newcomers and powerful for experts. It is fast, modern, safe, and a joy to write.

The swift compiler doesn’t yet have WebAssembly support, however the SwiftWasm project provides a patched compiler with this capability.

The SwiftWasm team is working to merge these changes into the Swift project. In the meantime, you can use the tool chain provided by the SwiftWasm project to build SUSE Security Admission Controller policies.

You don’t need an Apple system to write or run Swift code. Everything can be done also on a Linux machine or on Windows (by using Docker for Windows).

Current State

Policy authors can use the following resources:

There are no severe limitations with Swift, only some minor issues:

  • It’s critical to perform some post-build optimizations before using the policy "in production":

    1. Strip the Wasm module via wasm-strip to reduce its size

    2. Optimize the Wasm module via wasm-opt

The GitHub Action provided by the template repository already takes care of that.

More examples

This GitHub repository branch has a Admission Controller Policy written in Swift.