ISO 27001, 27006, and 27009: The Essential Normative Standards for ISMS

Introduction

ISO 27000 is a family of standards focused on information security management systems (ISMS). Within this series, some standards are normative, meaning they define essential requirements, while others are informative, providing guidelines and recommendations.

Difference Between Normative and Informative Standards

  • Normative standards are mandatory for certification and compliance.
    They establish requirements that organizations must follow to achieve ISO certification.
  • Informative standards provide guidance and best practices but are not required for certification. They help organizations understand and implement security measures effectively.

Among the ISO 27000 series, ISO 27001, ISO 27006, and ISO 27009 are normative, making them crucial for compliance and certification. This blog post will explain each of these in detail and provide an overview of the informative standards in the series.

Normative ISO Standards in the 27000 Series

ISO 27001: The Foundation of ISMS

ISO 27001 is the core standard in the ISO 27000 series, specifying requirements for establishing, implementing, maintaining, and continually improving an ISMS. It provides a risk-based approach to information security, requiring organizations to:

  • Define a risk management process
  • Establish policies and objectives for information security
  • Implement controls from Annex A (which maps to ISO 27002)
  • Monitor, review, and improve the ISMS continually

Organizations that comply with ISO 27001 can achieve certification, demonstrating their commitment to managing information security risks effectively.

ISO 27006: Requirements for Certification Bodies

ISO 27006 sets the requirements for certification bodies that audit and certify organizations for ISO 27001 compliance. It ensures that auditors follow consistent and high-quality assessment methodologies. The key aspects of ISO 27006 include:

  • Accreditation requirements for certification bodies
  • Competency criteria for ISMS auditors
  • Audit process and procedures
  • Reporting and impartiality principles

By adhering to ISO 27006, certification bodies maintain credibility and ensure that ISO 27001 certifications are valid and trustworthy.

ISO 27009: Sector-Specific Adaptations of ISO 27001

ISO 27009 provides guidance on adapting ISO 27001 for specific industries or sectors. It allows the development of sector-specific information security standards while maintaining alignment with the ISO 27001 framework.

This standard is particularly useful for industries with unique regulatory and operational security requirements, such as healthcare, finance, and telecommunications. It ensures that sector-specific standards remain compatible with ISO 27001 while addressing industry-specific risks.

Informative ISO Standards in the 27000 Series

Unlike the normative standards, the following standards provide guidance rather than mandatory requirements:

ISO 27000: Overview and Vocabulary

ISO 27000 defines key terms and concepts used across the ISO 27000 series. It serves as a reference point for understanding information security principles and the structure of ISMS standards.

ISO 27002: Information Security Controls

ISO 27002 provides detailed guidance on implementing the security controls outlined in Annex A of ISO 27001. It covers best practices for:

  • Access control
  • Cryptography
  • Physical security
  • Incident management

Although not a certification standard, ISO 27002 helps organizations strengthen their ISMS controls.

ISO 27003: ISMS Implementation Guidance

ISO 27003 offers guidance on implementing an ISMS based on ISO 27001. It covers:

  • Project planning
  • Risk assessment methodologies
  • ISMS documentation requirements
  • Stakeholder engagement

ISO 27004: ISMS Monitoring and Measurement

ISO 27004 provides guidelines on how to measure and evaluate the effectiveness of an ISMS. It includes:

  • Metrics for assessing security performance
  • Continuous improvement techniques
  • Compliance monitoring strategies

ISO 27005: Risk Management for Information Security

ISO 27005 offers a structured approach to risk management in ISMS, aligning with ISO 27001’s risk-based approach. It guides organizations in:

  • Identifying and assessing security risks
  • Selecting appropriate mitigation strategies
  • Implementing a continuous risk management process

ISO 27007: Guidelines for ISMS Audits

ISO 27007 complements ISO 27006 by providing best practices for conducting ISMS audits. It helps organizations prepare for ISO 27001 certification audits and maintain compliance.

ISO 27008: Security Controls Assessment

ISO 27008 offers guidance on assessing the effectiveness of information security controls. It helps organizations verify whether implemented controls meet their security objectives.

ISO 27010 to ISO 27099: Industry-Specific and Emerging Standards

The ISO 27000 series continues to evolve with additional standards covering:

  • Information security in inter-organizational communication (ISO 27010)
  • Cloud security (ISO 27017, ISO 27018)
  • Privacy management (ISO 27701)
  • Cybersecurity frameworks (ISO 27032)

Conclusion

ISO 27001, ISO 27006, and ISO 27009 are the key normative standards that define requirements for ISMS implementation, certification, and sector-specific adaptations. The rest of the ISO 27000 series provides informative guidance, helping organizations understand, implement, and improve their ISMS. Understanding these distinctions ensures organizations can effectively navigate compliance, certification, and best practices for information security management.

By following these standards, businesses can strengthen their cybersecurity posture, protect sensitive data, and demonstrate their commitment to information security best practices.

Getting Started with Wazuh: Setting Up Your Lab Environment for XDR and SIEM”

In today’s cybersecurity landscape, having a robust and flexible security information and event management (SIEM) system is crucial.
Wazuh, an open-source security platform, offers comprehensive solutions for threat detection, integrity monitoring, incident response, and compliance.

Wazuh has an interesting history. In 2015, the Wazuh team decided to fork OSSEC, an open-source host-based Intrusion Detection System (IDS), to expand its core functionalities with additional features, enhancements, and a user-friendly interface.
Wazuh has grown significantly since its inception. It is now a comprehensive, open-source security platform that provides unified XDR (Extended Detection and Response) and SIEM (Security Information and Event Management) capabilities. The platform is designed to monitor infrastructures, detect threats, respond to incidents, and ensure regulatory compliance.

This blog will guide you through setting up Wazuh in a lab environment, focusing on its basic capabilities in Extended Detection and Response (XDR) and SIEM.
Whether you’re a cybersecurity professional or an enthusiast, this step-by-step guide will help to get started with Wazuh to secure your systems effectively.
We start with the defaults to make the lab-setup not more complex as necessary.

My Lab-env is as follows:

Host IP OS
Wazuh-Server 10.50.100.76 Ubuntu 24 LTS
Wazuh-Agent 10.50.100.110 RHEL 9
Wazuh-Agent 10.50.100.111 RHEL 9
Wazuh-Agent 10.50.100.201 Windows

Basic setup of Wazuh-Server

with root rights execute curl -sO https://packages.wazuh.com/4.10/wazuh-install.sh && sudo bash ./wazuh-install.sh -a

Example output:

Please note the autogenerated User/Password to get later access to the Dashboard.

Linux: Basic setup of Wazuh-Agent

with root rights execute:

run the Agent installer (10.50.100.76 = Wazuh-Server)

example output:

Start the Wazuh-Agent and check the status:

example output:

Windows: Basic setup of Wazuh-Agent

Download the Agent-Installer and execute the command with admin-rights:

example-output:

Access the Dashboard

open a Browser and access: https://10.50.100.76
Don’t be surprised that the connection is interested, we use the default certs.

We see the default Dashboard:

Wazuh is shipped with default rules.
In a productive environment the real work would start now:
Create/adapt rules that are suitable for the required purposes and environment.
We will start with fixing the first (easy) vulnerability finding.

Fix a chrony-finding/vulnerability

Lets pick an RHEL-Agent and check the details of the chrony-finding:

  1. Navigate to Configuration Assesment
  2. Select an Agent
  3. Agent ID 02 looks as a good candidate
  4. filter the findings for chrony
  5. click on the failed check
  6. read carefully the finding and check the settings on the Agent to get it fixed

get the chrony finding fixed

The crony process is not executed by user chrony, let’s get it fixed:

To force a new assessment a restart of the Wazuh-agent is necessary.

Go back to the Dashboard/finding-screen and check again the chrony-finding:

Chrony looks good now, just another 82 findings to fix

In one of the next sessions I will go into the details of Wazuh, it is a great product.

SSH Security Made Easy: An Introduction to ssh-audit

ssh-audit is a powerful tool designed to help you assess the security of your SSH servers (and clients!). It provides detailed information about the server’s configuration, supported algorithms, and potential vulnerabilities. In this guide, I’ll walk you through the steps to install ssh-audit and run your first security tests. Secure SSH configuration made easy.

Installation on Linux

  1. Clone the Repository: Open your terminal and clone the ssh-audit repository from GitHub:
    git clone https://github.com/jtesta/ssh-audit.git
  2. Navigate to the Directory: Change to the ssh-audit directory:
    cd ssh-audit
  3. Install Dependencies: Ensure you have Python installed on your system. If not, install it using your package manager. For example, on Ubuntu:
    sudo apt-get install python3

Installation on macOS

To install ssh-audit , run:
brew install ssh-audit
(You have already Brew installed, right ?)

Please check the ssh-audit url for many other setup options (Docker,Windows,etc.)

Test the SSH-Server against vulnerabilities

execute ssh-audit <hostname>
Replace <hostname> with the IP address or domain name of the SSH server you want to audit.

Example of Ubuntu’s 24.04 LTS default SSHD setup:

(if you add the -l warn switch you just get the vulnerabilities presented)

Interpreting the Results: ssh-audit will provide a detailed report of the server’s configuration, including supported key exchange algorithms, encryption ciphers, and MAC algorithms. Look for any warnings or recommendations to improve your server’s security.

Remediation

After running ssh-audit and identifying potential vulnerabilities or weak configurations in your SSH server, it’s important to take steps to remediate these issues. Below are examples of how to apply them:

Example for Ubuntu 24.04.1 LTS:

(Note: This is just an example. The example eliminates vulnerabilities for the SSH-daemon, but it can well be that this snippet does not fit for your setup. Handle with care)

This snippet creates a configuration file (51-ssh-harden_202412.conf) in directory /etc/ssh/sshd_config.d/ with the specified settings to enhance the security of your SSH server.

(SSHD restart required)

Example for RHEL 9.4

(Note: This is just an example. This example eliminates vulnerabilities for the SSH-daemon, but it can well be that this snippet does not fit for your setup. Handle with care)

(SSHD restart required)

Proof the remediation

run ssh-audit again!

Example-output after remediation:

How can I test if my SSH-Client is not vulnerable ?

If you run ssh-audit with the switch -c it creates an ssh-service on port 2222 and audits every connection attempt:

output after the login-attempt (ssh 127.0.0.1 -p 2222)

Make your SSH-communication more secure, if not the SSH-Service opens an attack surface for uninvited visitors.
Secure SSH configuration is Key!

Consider other additional security-steps like:
Secure your SSH communication with certificates
Lab setup: Secure your SSH communication with certificates
Fail2Ban: ban hosts that cause multiple authentication errors

..
.

Lab setup: Secure your SSH communication with certificates

When you Ssh the first time to a host the screen shows something like:

Be honest: Do you just accept the shown Fingerprint of the remote host or do you really doublecheck the presented fingerprint before you accept ?

My guess: Most of the time the presented fingerprint gets accepted without any additional check.

This procedure is called TOFU (Trust On First Use).
TOFU assumes that the first time you connect to a server, the server’s key is trustworthy. However, this can leave you vulnerable to man-in-the-middle attacks if an attacker intercepts the initial connection. The attacker grabs your user/password credentials and can get access.

Here are some implementations who are using TOFU:

Android Enterprise Networks: Android supports TOFU for enterprise networks by allowing devices to trust an enterprise network by installing the root CA used by the server and setting its domain name in a saved network.

Signal: In Signal, endpoints initially trust the identifier blindly and display non-blocking warnings when it changes. Users can verify the identifier by scanning a QR code or exchanging a Safety Number, which then changes the nature of identifier change warnings from non-blocking to blocking.

WhatsApp: WhatsApp clients initially trust the identifier blindly and, by default, do not display warnings when the identifier changes. Users can enable non-blocking warnings by accessing the key fingerprint (called Security Code) and verifying it.

XMPP Client Conversations: This client uses Blind Trust Before Verification, where all identifiers are blindly trusted until the user authenticates endpoints by scanning a QR code. Once verified, the client displays a shield symbol for authenticated messages.

By using certificates for SSH authentication, you can eliminate the risks associated with TOFU. Key approval (and distribution) is no more necessary with certificate-based Ssh.

Certificates provide a more robust and secure method of verifying identities, ensuring that both the client and server can trust each other without relying on the initial Ssh-connection’s integrity.

This lab-setup is based on the open-source version of Smallstep, a powerful tool that simplifies the process of managing and issuing certificates.
Want to test cert-based ssh without smallstep ? go ahead, here are some getting started urls:
https://goteleport.com/blog/how-to-configure-ssh-certificate-based-authentication/
https://blog.habets.se/2011/07/OpenSSH-certificates.html
https://www.sweharris.org/post/2016-10-30-ssh-certs/

Before we dive into the lab, let’s first take a look at some key pros and cons related to this topic.

Advantages when using certificate-based ssh:

  • Enhanced Security: Certificates provide a higher level of security compared to traditional SSH keys. They are issued by a trusted Certificate Authority (CA), which ensures that both the client and server are who they claim to be.
  • Elimination of TOFU Risks: By using certificates, you eliminate the Trust On First Use (TOFU) risks associated with traditional SSH key exchanges. This reduces the chances of man-in-the-middle attacks during the initial connection.
  • Simplified Key Management: Certificates simplify the management of SSH keys. They can be easily issued, renewed, and revoked by the CA, making it easier to manage credentials in large environments.
  • Scalability: Certificate-based authentication scales well in large environments. Automated tools can be used to handle the issuance, renewal, and revocation of certificates, making it easier to manage a large number of users and systems.
  • Improved Compliance: Using certificates can help meet regulatory and compliance requirements for secure communications. This provides an added layer of assurance for your organization.
  • Revocation Capability: If a certificate is compromised, it can be revoked by the CA, rendering it invalid. This provides a way to quickly respond to security incidents and prevent unauthorized access.
  • Expiration and Renewal: Certificates have a defined validity period, which means they need to be renewed periodically. This ensures that outdated or potentially compromised credentials are regularly updated.

Disadvantages when using certificate-based ssh:

  • Initial Setup Time: The initial setup of a certificate authority (CA) and the issuance of certificates can be time-consuming. This includes configuring the CA, generating certificates, and distributing them to clients and servers.
  • Complexity: Setting up and managing a certificate-based SSH infrastructure can be more complex compared to traditional key-based authentication. It requires a good understanding of Public Key Infrastructure (PKI) and certificate management.
  • Compatibility: Not all systems and applications may support certificate-based SSH authentication out of the box. Additional configuration or software may be required to enable this feature.
  • Maintenance: Regular maintenance is required to keep the certificate infrastructure secure. This includes renewing certificates before they expire, revoking compromised certificates, and ensuring the CA remains secure.
  • Dependency on CA: The security of the entire system relies on the integrity and security of the CA. If the CA is compromised, the entire certificate-based authentication system can be at risk.

OK. Ready to go ?

This is the lab setup:

Hostname Mac-address IP-address
step 00:0c:29:fd:94:15 10.50.100.110
clientstep1 00:0c:29:3d:c8:a5 10.50.100.111
clientstep2 00:0c:29:41:a1:5c 10.50.100.112
rogueclient 00:0c:af:ee:af:fe
# install needed packages
wget https://dl.smallstep.com/cli/docs-cli-install/latest/step-cli_amd64.rpm
rpm -i step-cli_amd64.rpm
wget https://dl.smallstep.com/certificates/docs-ca-install/latest/step-ca_amd64.rpm
sudo rpm -i step-ca_amd64.rpm

#check version(s)
[root@step step]# step version
Smallstep CLI/0.27.2 (linux/amd64)
Release Date: 2024-07-18T18:15:09Z

[root@step step]# step-ca version
Smallstep CA/0.27.2 (linux/amd64)
Release Date: 2024-07-18T21:29:11Z
[root@step step]#

#setup step ca
[root@step step]# step ca init -ssh
Use the arrow keys to navigate: ↓ ↑ → ←
? What deployment type would you like to configure?:
  ▸ Standalone - step-ca instance you run yourself
    Linked - standalone, plus cloud configuration, reporting & alerting
    Hosted - fully-managed step-ca cloud instance run for you by smallstep
✔ Deployment Type: Standalone
What would you like to name your new PKI?
✔ (e.g. Smallstep): step
What DNS names or IP addresses will clients use to reach your CA?
✔ (e.g. ca.example.com[,10.1.2.3,etc.]): step,10.50.100.110
What IP and port will your new CA bind to? (:443 will bind to 0.0.0.0:443)
✔ (e.g. :443 or 127.0.0.1:443): :443█
What would you like to name the CA's first provisioner?
✔ (e.g. you@smallstep.com): ugu5ma@step
Choose a password for your CA keys and first provisioner.
✔ [leave empty and we'll generate one]:

Generating root certificate... done!
Generating intermediate certificate... done!
Generating user and host SSH certificate signing keys... done!

✔ Root certificate: /root/.step/certs/root_ca.crt
✔ Root private key: /root/.step/secrets/root_ca_key
✔ Root fingerprint: fb31925c37a688d0821420eb25e5f1e6c03ca0c7d51e48516b14bdc13ff5ccdd
✔ Intermediate certificate: /root/.step/certs/intermediate_ca.crt
✔ Intermediate private key: /root/.step/secrets/intermediate_ca_key
✔ SSH user public key: /root/.step/certs/ssh_user_ca_key.pub
✔ SSH user private key: /root/.step/secrets/ssh_user_ca_key
✔ SSH host public key: /root/.step/certs/ssh_host_ca_key.pub
✔ SSH host private key: /root/.step/secrets/ssh_host_ca_key
✔ Database folder: /root/.step/db
✔ Templates folder: /root/.step/templates
✔ Default configuration: /root/.step/config/defaults.json
✔ Certificate Authority configuration: /root/.step/config/ca.json

Your PKI is ready to go. To generate certificates for individual services see 'step help ca'.

FEEDBACK 😍 🍻
  The step utility is not instrumented for usage statistics. It does not phone
  home. But your feedback is extremely valuable. Any information you can provide
  regarding how you’re using `step` helps. Please send us a sentence or two,
  good or bad at feedback@smallstep.com or join GitHub Discussions
  https://github.com/smallstep/certificates/discussions and our Discord
  https://u.step.sm/discord.
[root@step step]#

#run your ssh-ca
[root@step step]# step-ca $(step path)/config/ca.json
badger 2024/09/06 10:50:53 INFO: All 1 tables opened in 1ms
badger 2024/09/06 10:50:53 INFO: Replaying file id: 0 at offset: 7306
badger 2024/09/06 10:50:53 INFO: Replay took: 9.758µs
Please enter the password to decrypt /root/.step/secrets/intermediate_ca_key:
Please enter the password to decrypt /root/.step/secrets/ssh_host_ca_key:
Please enter the password to decrypt /root/.step/secrets/ssh_user_ca_key:
2024/09/06 10:51:00 Building new tls configuration using step-ca x509 Signer Interface
2024/09/06 10:51:00 Starting Smallstep CA/0.27.2 (linux/amd64)
2024/09/06 10:51:00 Documentation: https://u.step.sm/docs/ca
2024/09/06 10:51:00 Community Discord: https://u.step.sm/discord
2024/09/06 10:51:00 Config file: /root/.step/config/ca.json
2024/09/06 10:51:00 The primary server URL is https://step:443
2024/09/06 10:51:00 Root certificates are available at https://step:443/roots.pem
2024/09/06 10:51:00 Additional configured hostnames: 10.50.100.110
2024/09/06 10:51:00 X.509 Root Fingerprint: fb31925c37a688d0821420eb25e5f1e6c03ca0c7d51e48516b14bdc13ff5ccdd
2024/09/06 10:51:00 SSH Host CA Key: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKliAvQoL0eRNGMXMUFSSOBzo8fjzsnb1ztakctwFJUnsgzSCCWhXDky5B59CQcw/m8fb/0DDWv0Vyw7YYRkLJM=
2024/09/06 10:51:00 SSH User CA Key: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAWRNNWJj9uhoM5PZ4rkQP0yzeW9F2+73UqCmQSAdDcukUzHmMlVet5yDpbOqfkjAVwokW68cS9OfzEXetd41y0=
2024/09/06 10:51:00 Serving HTTPS on 10.50.100.110:443 ...
  • we need later the shown fingerprint, this is a good time to copy the string (fb319….cdd).
  • Setup clientstep1 as ssh-daemon who only accept ssh-certificates of our new ssh ca:
wget https://dl.smallstep.com/cli/docs-cli-install/latest/step-cli_amd64.rpm
rpm -i step-cli_amd64.rpm
[root@clientstep1 ugu5ma]# step version
Smallstep CLI/0.27.2 (linux/amd64)
Release Date: 2024-07-18T18:15:09Z
[root@clientstep1 ugu5ma]#

*** To configure step to access your CA from a new host, run step ca bootstrap --ca-url [CA URL] --fingerprint [CA fingerprint] :
[root@clientstep1 ugu5ma]# step ca bootstrap --ca-url https://10.50.100.110:443 --fingerprint fb31925c37a688d0821420eb25e5f1e6c03ca0c7d51e48516b14bdc13ff5ccdd
The root certificate has been saved in /root/.step/certs/root_ca.crt.
The authority configuration has been saved in /root/.step/config/defaults.json.
#### trust your SSH user CA 
[root@clientstep1 ugu5ma]# step ssh config --roots > /path/to/ssh_user_key.pub
bash: /path/to/ssh_user_key.pub: No such file or directory
[root@clientstep1 ugu5ma]# step certificate install $(step path)/certs/root_ca.crt
Certificate /root/.step/certs/root_ca.crt has been installed.
X.509v3 Root CA Certificate (ECDSA P-256) [Serial: 1777...5197]
  Subject:     step Root CA
  Issuer:      step Root CA
  Valid from:  2024-09-06T08:40:14Z
          to:  2034-09-04T08:40:14Z
#### let's sign a host-certificate for:
##### principal1      = clientstep1
##### principal2      = clientstep1.fritz.box
##### certificate-id  = ubuarmlts 
[root@clientstep1 ugu5ma]# sudo -E step ssh certificate ubuarmlts /etc/ssh/ssh_host_ecdsa_key.pub --host --sign --principal clientstep1  --principal clientstep1.fritz.box
Use the arrow keys to navigate: ↓ ↑ → ←
What provisioner key do you want to use?
  ▸ ugu5ma@step (JWK) [kid: DFYsQuqHCCpjx2uXeDYiZEI0V8aH2tAcK54qGPyHbzA]
    sshpop (SSHPOP)
Please enter the password to decrypt the provisioner key:
✔ CA: https://10.50.100.110:443
✔ Certificate: /etc/ssh/ssh_host_ecdsa_key-cert.pub
#### 
#### run the following command and add the following to your SSHD configuration (vi /etc/ssh/sshd_config)
####
[root@clientstep1 ssh]# step ssh config --roots > /etc/ssh/ssh_user_key.pub
#### add the following to SSHD config(vi /etc/ssh/sshd_config)
# This is our host private key and certificate:
HostKey /etc/ssh/ssh_host_ecdsa_key
HostCertificate /etc/ssh/ssh_host_ecdsa_key-cert.pub
*** Configure SSH clients to trust your host CA
** To view the host key, run: step ssh config --host --roots

  • Setup clientstep2 as cert-based ssh-client
#
#>>>bootstrap the host as shown on stepclient1<<<
#
#Let's create an SSH user certificate for user ugu5ma
[ugu5ma@clientstep2 ~]$ cd /home/ugu5ma/.ssh
[ugu5ma@clientstep2 ~]$ step ssh certificate ugu5ma@step id_ecdsa
Use the arrow keys to navigate: ↓ ↑ → ←
What provisioner key do you want to use?
  ▸ ugu5ma@step (JWK) [kid: DFYsQuqHCCpjx2uXeDYiZEI0V8aH2tAcK54qGPyHbzA]
    sshpop (SSHPOP)
✔ Provisioner: ugu5ma@step (JWK) [kid: DFYsQuqHCCpjx2uXeDYiZEI0V8aH2tAcK54qGPyHbzA]
Please enter the password to decrypt the provisioner key:
✔ CA: https://10.50.100.110:443
Please enter the password to encrypt the private key: █
✔ Private Key: id_ecdsa
✔ Public Key: id_ecdsa.pub
✔ Certificate: id_ecdsa-cert.pub

### Trust your ssh-CA, run command:
[ugu5ma@clientstep2 .ssh]$ step ssh config --host --roots
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKliAvQoL0eRNGMXMUFSSOBzo8fjzsnb1ztakctwFJUnsgzSCCWhXDky5B59CQcw/m8fb/0DDWv0Vyw7YYRkLJM=

### add the output to .ssh/known_hosts (vi /home/ugu5ma/.ssh/known_hosts)
@cert-authority * ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKliAvQoL0eRNGMXMUFSSOBzo8fjzsnb1ztakctwFJUnsgzSCCWhXDky5B59CQcw/m8fb/0DDWv0Vyw7YYRkLJM=

### verify

[ugu5ma@clientstep2 .ssh]$ cat /home/ugu5ma/.ssh/known_hosts
@cert-authority * ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKliAvQoL0eRNGMXMUFSSOBzo8fjzsnb1ztakctwFJUnsgzSCCWhXDky5B59CQcw/m8fb/0DDWv0Vyw7YYRkLJM=
  • next we try to connect from clientstep2 to clientstep1:
### let's ssh to clientstep1 and verify the communication:

[ugu5ma@clientstep2 .ssh]$ ssh ugu5ma@clientstep1 -vv
OpenSSH_8.7p1, OpenSSL 3.0.7 1 Nov 2022
#
# uninteresting output deleted...
#
debug2: resolving "clientstep1.fritz.box" port 22
debug1: Connecting to clientstep1.fritz.box [10.50.100.111] port 22.
debug1: Connection established.
debug1: Local version string SSH-2.0-OpenSSH_8.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.7
debug1: compat_banner: match: OpenSSH_8.7 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to clientstep1.fritz.box:22 as 'ugu5ma'
debug1: Server host certificate: ecdsa-sha2-nistp256-cert-v01@openssh.com SHA256:5OW2e/VviIjRptZ9L5exCm6xW3jwUI2BEM9Zx8MAb0A, serial 5287235044766806569 ID "ubuarmlts" CA ecdsa-sha2-nistp256 SHA256:jC3GukYmJNtdbqDF0J17DiFU98TW2/TlFNyQ2XG58PE valid from 2024-09-06T11:11:00 to 2024-10-06T11:12:00
debug2: Server host certificate hostname: clientstep1
debug2: Server host certificate hostname: clientstep1.fritz.box
debug1: Host 'clientstep1.fritz.box' is known and matches the ECDSA-CERT host certificate.
debug1: Found CA key in /home/ugu5ma/.ssh/known_hosts:1
debug1: Will attempt key: /home/ugu5ma/.ssh/id_ecdsa ECDSA-CERT SHA256:wBhbhAOlVpUXCKsuuAvN8+LV6ZLZuMpsv7GPySw3874 agent
debug2: pubkey_prepare: done
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Server accepts key: /home/ugu5ma/.ssh/id_ecdsa ECDSA-CERT SHA256:wBhbhAOlVpUXCKsuuAvN8+LV6ZLZuMpsv7GPySw3874 agent
debug2: sign_and_send_pubkey: using private key "/home/ugu5ma/.ssh/id_ecdsa" from agent for certificate
Authenticated to clientstep1 ([10.50.100.111]:22) using "publickey".
[ugu5ma@clientstep1 ~]$
  • Looks good! No TOFU as well 🙂
  • Lets try as next an ssh attempt from rogueclient without certificates:
ugu5ma@rogueclient:ssh ugu5ma@10.50.100.111 -vv
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host certificate: ecdsa-sha2-nistp256-cert-v01@openssh.com SHA256:5OW2e/VviIjRptZ9L5exCm6xW3jwUI2BEM9Zx8MAb0A, serial 5287235044766806569 ID "ubuarmlts" CA ecdsa-sha2-nistp256 SHA256:jC3GukYmJNtdbqDF0J17DiFU98TW2/TlFNyQ2XG58PE valid from 2024-09-06T11:11:00 to 2024-10-06T11:12:00
debug2: Server host certificate hostname: clientstep1
debug2: Server host certificate hostname: clientstep1.fritz.box
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ugu5ma/.ssh/id_rsa
debug1: Trying private key: /home/ugu5ma/.ssh/id_ecdsa
debug1: Trying private key: /home/ugu5ma/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/ugu5ma/.ssh/id_ed25519
debug1: Trying private key: /home/ugu5ma/.ssh/id_ed25519_sk
debug1: Trying private key: /home/ugu5ma/.ssh/id_xmss
debug1: Trying private key: /home/ugu5ma/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
ugu5ma@10.50.100.111: Permission denied (publickey).

any ssh-attempt from rogueclient is denied because the client is not equipped with a valid ssh-certificate (best practice setting of “PasswordAuthentication no” and “PubkeyAuthentication yes“in sshd_config on clientstep1 must be enabled to avoid circumventing the security framework. ).

Is the shown setup suitable for productive use ? NO!
Smallstep has a nice overview what topics needs to be considered before going live.

This page is just for setting up a small dev-lab to get handy with ssh-certificates.
As always, take backups and redundant console-access before changing anything 🙂

Troubleshooting-commands

###check ssh host-certificate on clientstep1
[root@clientstep1 ssh]# cat /etc/ssh/ssh_host_ecdsa_key-cert.pub | step ssh inspect
-:
        Type: ecdsa-sha2-nistp256-cert-v01@openssh.com host certificate
        Public key: ECDSA-CERT SHA256:5OW2e/VviIjRptZ9L5exCm6xW3jwUI2BEM9Zx8MAb0A
        Signing CA: ECDSA SHA256:jC3GukYmJNtdbqDF0J17DiFU98TW2/TlFNyQ2XG58PE (using ecdsa-sha2-nistp256)
        Key ID: "ubuarmlts"
        Serial: 5287235044766806569
        Valid: from 2024-09-06T11:11:00 to 2024-10-06T11:12:00
        Principals:
                clientstep1
                clientstep1.fritz.box
        Critical Options: (none)
        Extensions: (none)
        Signature:
                00:00:00:20:33:ac:f7:8e:4d:4c:60:26:5f:5e:83:18:
                a0:ef:25:3c:4f:49:3d:56:1d:c8:96:b0:3e:63:ee:1d:
                c5:27:8b:5e:00:00:00:21:00:d5:07:b2:13:ea:07:2d:
                57:4c:95:15:aa:5f:0c:95:71:f5:ec:11:86:a7:d9:f3:
                95:b3:12:d6:2a:15:39:03:07
[root@clientstep1 ssh]#

###check ssh user-certificate on clientstep2
[ugu5ma@clientstep2 .ssh]$ cat /home/ugu5ma/.ssh/id_ecdsa-cert.pub | step ssh inspect
-:
        Type: ecdsa-sha2-nistp256-cert-v01@openssh.com user certificate
        Public key: ECDSA-CERT SHA256:wBhbhAOlVpUXCKsuuAvN8+LV6ZLZuMpsv7GPySw3874
        Signing CA: ECDSA SHA256:H+rgQ6gIM10MCNti1+tJs7H3nUCzrPQ3P5nCH2BqTJ8 (using ecdsa-sha2-nistp256)
        Key ID: "ugu5ma@step"
        Serial: 4249190036314894073
        Valid: from 2024-09-06T11:33:43 to 2024-09-07T03:34:43
        Principals:
                ugu5ma
                ugu5ma@step
        Critical Options: (none)
        Extensions:
                permit-port-forwarding
                permit-pty
                permit-user-rc
                permit-X11-forwarding
                permit-agent-forwarding
        Signature:
                00:00:00:21:00:99:07:e1:37:9f:2c:99:28:e1:b3:65:
                e9:8b:a6:4f:f0:d1:93:66:1f:f1:2d:fe:fa:21:ad:55:
                15:8b:54:69:fd:00:00:00:20:25:69:6b:00:99:e1:6a:
                6d:b4:04:af:02:9b:18:ae:0a:85:84:b8:fa:c1:f5:1c:
                d8:82:cc:f1:e9:07:81:90:38
[ugu5ma@clientstep2 .ssh]$

You see the lifetime of the user-certificate ? It is valid for 16 hours.
You can tweak the cert-lifetime during the creation with the parameter not-before and not-after, example:

# This certificate will be valid starting 10 minutes from now, until 10 days from now:
[ugu5ma@clientstep2 .ssh]$ step ssh certificate ugu5ma@step id_ecdsa --not-before=10m --not-after=240h
###check 
[ugu5ma@clientstep2 .ssh]$ cat /home/ugu5ma/.ssh/id_ecdsa-cert.pub | step ssh inspect
-:
        Type: ecdsa-sha2-nistp256-cert-v01@openssh.com user certificate
        Public key: ECDSA-CERT SHA256:GOvbmiBstPbiiov0kNF4fApyjeSUhdnvm2xS5QolBFg
        Signing CA: ECDSA SHA256:H+rgQ6gIM10MCNti1+tJs7H3nUCzrPQ3P5nCH2BqTJ8 (using ecdsa-sha2-nistp256)
        Key ID: "ugu5ma@step"
        Serial: 1320427072549296678
        Valid: from 2024-09-06T14:20:58 to 2024-09-16T14:10:58
        Principals:
                ugu5ma
                ugu5ma@step
        Critical Options: (none)

The maxUserSSHCertDuration is per default set to 24hours. If you want to extent the User-cert lifetime you have to adjust this parameter (vi $(step path)/config/ca.json)

"authority": {
		"provisioners": [
			{
				"type": "JWK",
				"name": "ugu5ma@step",
				"key": {
					"use": "sig",
					"kty": "EC",
					"kid": "DFYsQuqHCCpjx2uXeDYiZEI0V8aH2tAcK54qGPyHbzA",
					"crv": "P-256",
					"alg": "ES256",
					"x": "2rF1jfj1sdsSD2yCNLZgDzixPCGVKPP40TJHVHtlpdc",
					"y": "_b5YAseg2MzHHOW1it3l0ueJxm0Wm7j-9h5JWk9ROg8"
				},
				"encryptedKey": "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjdHkiOiJqd2sranNvbiIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjYwMDAwMCwicDJzIjoialBOcE53ellPM3RsODcwdUVRMjBMdyJ9.ss7QL4e38LDTsgyjrVLH6lNrcPlNBgCuFfQmx2ei_vkN_sMge-stQg.K5alPL_-AOKnyU2i.WN-58v-uDkeAw7kKpZVEFpScBq3eaGnMn6D6E3ARhI6Xy1w3EQgfz6oCbCHd1DidwSmy1I7bhX7hquvjVkznZuJZYb4FcF8ZJjcPDuh6-_DkHDUR8QBy3qbvkPJNKl1sO-TabgxW3og_L1PIbyeH66f5bPmTfICtJ5RCAevGNma6-vmJGga9hkd6Fmyvr2TToMqKx5pHYHCgUuNwpnfpk7PzyKAPp9Gx9VtykuJ3ikQVil9nMZmNPdy2CY9ZdOyb64NmIwolNmgl8vrdRSXu-HJxzVptttf5G6vn6MvUJnjXBJbf0GabNEsGqTBjm-qA2vWcfg0AlXYwiUDsb3o.dMb9vHds1gxo-_K8rLhkFw",
				"claims": {
					"enableSSHCA": true,
                                        "minTLSCertDuration": "5m",
                                        "maxTLSCertDuration": "480h",
                                        "defaultTLSCertDuration": "24h",
					"minHostSSHCertDuration": "5m",
                                        "maxHostSSHCertDuration": "1680h",
                                        "defaultHostSSHCertDuration": "720h",
                                        "minUserSSHCertDuration": "5m",
                                        "maxUserSSHCertDuration": "480h",
                                        "defaultUserSSHCertDuration": "16h"
}

Have fun!