sophos.sophos_firewall.sfos_certificate module – Manage Certificates (System > Certificates)
Note
This module is part of the sophos.sophos_firewall collection (version 2.5.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install sophos.sophos_firewall
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: sophos.sophos_firewall.sfos_certificate
.
New in sophos.sophos_firewall 2.4.0
Synopsis
Creates certificates on Sophos Firewall, including uploaded certificates, self-signed certificates, certificate signing requests, and Let’s Encrypt certificates
Requirements
The below requirements are needed on the host that executes this module.
sophosfirewall-python
Beginning in version 2.0.0, this module requires use of an httpapi connection plugin. See the HTTPAPI example for details.
Parameters
Parameter |
Comments |
---|---|
Select an option for certificate management Choices:
|
|
Certificate file to be uploaded (PEM, DER, CER, P7B, PFX, P12 formats) |
|
Format of Certificate file Choices:
|
|
Value corresponding to the Certificate ID selected |
|
Certificate ID type |
|
Certificate name |
|
Common name comprising of host and domain name |
|
Country code (2-letter ISO code) |
|
Curve name for elliptic curve keys Choices:
|
|
List of DNS Subject Alternative Names (SANs) |
|
Email Address for communication |
|
Interface for Let’s Encrypt challenge |
|
List of IP address Subject Alternative Names (SANs) |
|
Enable Key encryption Choices:
|
|
Key length - number of bits used to construct the key Choices:
|
|
Key type - RSA or elliptic curve Choices:
|
|
Name of the locality |
|
Name of the Certificate |
|
Organization name |
|
Department name |
|
Password for the Certificate used for authentication |
|
Private key file to be uploaded (KEY format) |
|
Secure hash algorithm Choices:
|
|
Use Use Choices:
|
|
State within the country |
|
Date from which the Certificate is valid. Required when action is GenerateSelfSignedCertificate. |
|
Date upto which the Certificate is valid. Required when action is GenerateSelfSignedCertificate. |
Examples
- name: Upload Certificate
sophos.sophos_firewall.sfos_certificate:
name: UPLOADED_CERT
action: UploadCertificate
certificate_file: /path/to/certificate.pem
private_key_file: /path/to/private_key.key
password: certpassword
common_name: example.com
state: present
- name: Generate Self-Signed Certificate
sophos.sophos_firewall.sfos_certificate:
name: SELFSIGNED_CERT
action: GenerateSelfSignedCertificate
common_name: internal.example.com
organization_name: Example Organization
country_name: US
state_province_name: California
locality_name: San Francisco
email_address: admin@example.com
key_type: RSA
key_length: 2048
secure_hash: "SHA - 256"
valid_from: "2024-01-01"
valid_upto: "2025-01-01"
dns_name:
- internal.example.com
- www.internal.example.com
state: present
- name: Generate Certificate Signing Request
sophos.sophos_firewall.sfos_certificate:
name: CSR_CERT
action: GenerateCertificateSigningRequest
common_name: csr.example.com
organization_name: Example Organization
country_name: US
key_type: RSA
key_length: 2048
state: present
- name: Request Let's Encrypt Certificate
sophos.sophos_firewall.sfos_certificate:
name: LETSENCRYPT_CERT
action: RequestLetsEncryptCertificate
common_name: public.example.com
email_address: admin@example.com
hosted_address: 192.168.1.1
dns_name:
- public.example.com
- www.public.example.com
state: present
- name: Remove Certificate
sophos.sophos_firewall.sfos_certificate:
name: CERTIFICATE_TO_REMOVE
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Serialized object containing the API response. Returned: always |
Collection links
Warning
If the firewall is a member of a group in Central, the changes made by Ansible will override the settings of the group. The actual configuration on the firewall may then differ from what is displayed for the same setting in the Central group.