AlmaLinux 9.8
Overview
AlmaLinux is a community-owned enterprise Linux distribution, produced by the AlmaLinux OS Foundation to be binary compatible with Red Hat Enterprise Linux. Version 9.8, codename Olive Jaguar, is a point release in the RHEL 9 family and runs the 5.14 kernel.
This guide covers deploying and configuring AlmaLinux 9.8 on Microsoft Azure, using SecureAnyCloud's preconfigured virtual machine image from the Azure Marketplace.
What you get:
- AlmaLinux 9.8, binary compatible with RHEL 9
- Every available update in the 9.8 stream applied at build time
- Automatic updates armed and enabled, so the machine keeps patching itself
- Azure Linux Agent (waagent) and cloud-init for Azure integration
- Chronyd for NTP time synchronisation
- SELinux in enforcing mode
- BaseOS, AppStream and Extras repositories enabled, so your update path is intact
- No swap on the operating system disk
- Gen2 Hyper-V virtual machine support
- 24/7 SecureAnyCloud support
Platform: Microsoft Azure (Gen2 Hyper-V). Default user: azureuser.
Which AlmaLinux 9 image should I choose?
SecureAnyCloud publishes AlmaLinux 9 in two shapes, and they are deliberately different products. Pick the one that matches how your organisation procures an operating system.
AlmaLinux 9.8 (this image) AlmaLinux 9
Named for The 9.8 point release The 9 major release
Built from 9.8 specifically, asserted at build time Whichever AlmaLinux 9 point release is current when it is rebuilt
Suits Change control and validated configuration matrices that name an exact minor version Teams who simply want current AlmaLinux 9
Choose this image when your build sheet, compliance baseline or vendor support matrix names 9.8 and you need the image you procured to say so. The build refuses to run against any other point release, so a machine launched from this listing reports release 9.8 and nothing else.
Two points are worth stating plainly:
- At the time of publication, 9.8 is also the newest AlmaLinux 9 point release. RHEL-family security backports roll into the latest minor stream, so today this image carries materially the same current software as the rolling AlmaLinux 9 image. The distinction becomes visible when AlmaLinux ships 9.9. The AlmaLinux 9 image moves on, and this one continues to identify as the 9.8 build.
- This is a pin on what you procured, not a freeze on what you run. The image keeps the standard BaseOS, AppStream and Extras repositories, so your own
dnf updaterolls the machine forward within AlmaLinux 9 in the normal way. If you need to hold a fleet at 9.8, see Step 6, and read the warning there first.
Security posture
This image ships with no known credential. There is no default password and no baked-in SSH key:
- The root account password is locked, so no one can log in as root with a password.
- No account on the image has a usable password at all.
PasswordAuthenticationis disabled in the SSH daemon, so every login is by key.PermitRootLoginis set towithout-password, so root cannot be reached with a password. No root key ships in the image, so in practice root has no remote login until you create one deliberately.- SSH host keys are removed before capture and regenerated on each machine at first boot, so no two machines you launch share a host identity.
/etc/machine-idis cleared before capture and regenerated per machine.- The only key that works is the public key you supply when you create the virtual machine. Azure injects it into
azureuserat first boot. - SELinux is left in enforcing mode, the AlmaLinux default.
Prerequisites
Before you deploy this image, make sure you have:
- An active Microsoft Azure subscription
- Access to the Azure Portal or Azure CLI
- An SSH key pair for Linux VM access
- Familiarity with Azure VM management
Recommended VM size: Standard_B2s (2 vCPU, 4 GB RAM) or larger.
Deploy the Virtual Machine
Option A: Azure Portal
- Open the Azure Marketplace and search for "AlmaLinux 9.8 SecureAnyCloud".
- Select the image and choose Create.
- Configure the basics:
- Subscription: select your Azure subscription.
- Resource Group: create a new one or select an existing one.
- Virtual Machine Name: enter a name for your VM.
- Region: select your preferred Azure region.
- Size:
Standard_B2sis recommended.
- Under Administrator Account, select SSH public key and enter your key.
- Under Inbound Port Rules, allow SSH (port 22).
- Choose Review + Create, then choose Create.
Option B: Azure CLI
Run these commands on your own workstation. Substitute your resource group, VM name and preferred region:
az vm image terms accept --urn sac1647283583153:almalinux-9-8:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-almalinux-9-8-vm \
--image sac1647283583153:almalinux-9-8:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku StandardConnect via SSH
Run these commands on your own workstation, not on the VM. Find the public IP, then connect:
az vm show --resource-group myResourceGroup --name my-almalinux-9-8-vm --show-details --query publicIps -o tsv ssh azureuser@<vm-ip>There is no password to enter. If SSH asks for one, the key your client is offering is not the key you supplied at create time.
Confirm the release
First, check that the machine runs the point release you procured:
cat /etc/almalinux-releaseAlmaLinux release 9.8 (Olive Jaguar)The os-release fields carry the same information in a machine-readable form, which is what configuration management tools read:
grep -E '^(NAME|VERSION|ID|VERSION_ID|PLATFORM_ID)=' /etc/os-releaseNAME="AlmaLinux" VERSION="9.8 (Olive Jaguar)" ID="almalinux" VERSION_ID="9.8" PLATFORM_ID="platform:el9"VERSION_ID is 9.8, not 9. Inventory and compliance tools key on this field, and it is the reason this listing exists as a separate product.
The distribution itself asserts the RHEL compatibility lineage:
cat /etc/redhat-releaseAlmaLinux release 9.8 (Olive Jaguar)Then check the kernel:
uname -srmLinux 5.14.0-687.36.1.el9_8.x86_64 x86_64Check the patch level and automatic updates
Every update available in the 9.8 stream was applied when this image was built. The dnf check-update command exits 100 when updates are pending and 0 when none are:
dnf -q check-update >/dev/null 2>&1; echo "exit=$?"exit=0Check that no reboot is pending either:
dnf needs-restarting -rNo core libraries or services have been updated since boot-up. Reboot should not be necessary.Your update path is intact. List the enabled repositories. There are three:
dnf repolist --enabledrepo id repo name appstream AlmaLinux 9 - AppStream baseos AlmaLinux 9 - BaseOS extras AlmaLinux 9 - ExtrasCRB (CodeReady Builder) ships configured but disabled, which is the AlmaLinux default. Enable CRB only if you build software that needs its development headers:
sudo dnf config-manager --set-enabled crbAutomatic updates
Unlike a stock AlmaLinux cloud image, this machine keeps patching itself. The dnf-automatic package is installed and its timer is enabled, so the machine applies updates on its own schedule:
systemctl is-enabled dnf-automatic.timerenabledsystemctl cat dnf-automatic.timer | grep -E 'OnCalendar|RandomizedDelaySec'OnCalendar=*-*-* 6:00 RandomizedDelaySec=60mThe policy applies all available updates, not only those tagged as security errata. It never reboots automatically, so a kernel update waits for a window you choose instead of restarting a production machine without warning:
grep -E '^(apply_updates|upgrade_type|download_updates|reboot)' /etc/dnf/automatic.confupgrade_type = default download_updates = yes apply_updates = yes reboot = neverupgrade_type is deliberately default rather than security. On an image whose errata metadata is not always populated, a security-only policy can silently resolve to applying nothing. The default setting is the one that actually keeps the machine current.
Because reboot = never, check periodically whether a restart is owed after a kernel update, using the needs-restarting -r command above. To opt out entirely, run sudo systemctl disable --now dnf-automatic.timer.
Verify the security posture
Confirm that SELinux is enforcing:
getenforceEnforcingConfirm that the root account is locked. LK in the second field means locked:
passwd -S rootroot LK 2009-12-22 -1 -1 -1 -1 (Alternate authentication scheme in use.)Confirm that no account on the machine has a usable password. This command prints nothing on a clean image:
sudo awk -F: '($2 !~ /^[!*]/) && ($2 != "") {print $1}' /etc/shadowRead the SSH daemon's effective policy instead of the config file, because the running daemon is what a client actually meets:
sudo sshd -T | grep -E '^(permitrootlogin|passwordauthentication|pubkeyauthentication) 'permitrootlogin without-password pubkeyauthentication yes passwordauthentication noThe image has no swap on the operating system disk. Azure manages swap on the ephemeral resource disk if you want it, and a swap file baked into a Marketplace image is not permitted. This command prints nothing:
swapon --showConfirm what is listening. On a freshly launched machine, sshd on port 22 is your remote access. The base OS also runs rpcbind on port 111 and chronyd bound to the loopback address for time synchronisation:
ss -tulnH | awk '{print $1, $5}' | sort -utcp 0.0.0.0:111 tcp 0.0.0.0:22 tcp [::]:111 tcp [::]:22 udp 0.0.0.0:111 udp 127.0.0.1:323 udp [::1]:323 udp [::]:111The Azure Network Security Group (NSG) controls inbound traffic. Only the ports you explicitly open in the NSG are reachable from outside the VM, regardless of what is bound locally.
If you do not use RPC-based services and want to close port 111 on the host as well, run sudo systemctl disable --now rpcbind.socket rpcbind.service.
Holding a machine at 9.8
By default this machine behaves like any other AlmaLinux 9 system. sudo dnf update moves it forward within the AlmaLinux 9 series, including across future point releases. This is the right behaviour for most workloads, and it is how you receive security fixes.
If your change control requires a fleet to stay on the 9.8 package set, use AlmaLinux's mechanism, the releasever variable:
echo "9.8" | sudo tee /etc/dnf/vars/releaseverRead this before you pin. AlmaLinux serves a pinned minor release from its vault, and a vault is only populated once that release has been superseded. At the time of writing, 9.8 is the current release, so pinning today would point dnf at a vault location that may not exist yet.
More importantly, once a vault is frozen it stops receiving new security backports. Pinning trades security currency for version stability. Pin only if a compliance obligation requires it, revisit the decision on a schedule, and never pin a machine that is exposed to the internet without compensating controls.
For most people the right choice is to leave the repositories alone and let the automatic updates run. Use this listing for what it is: a guarantee about the release you procured.
Verify Azure integration
The Azure Linux Agent handles provisioning, extensions and the portal's serial console. Check the agent and the related packages:
systemctl is-active waagent rpm -q WALinuxAgent cloud-init chronyactive WALinuxAgent-2.14.0.1-4.el9.noarch cloud-init-24.4-8.el9_8.1.alma.1.noarch chrony-4.8-1.el9.x86_64Cloud-init should report done, which means provisioning finished cleanly:
cloud-init statusstatus: doneThe kernel puts a console on ttyS0. This makes boot diagnostics and the portal's serial console work when you cannot reach the machine over SSH:
grep -o 'console=ttyS0[^ ]*' /proc/cmdlineTime synchronisation runs through chronyd against the Azure host clock. Check the time sources:
chronyc -n sources | head -4MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== #* PHC0 2 3 377 8 -5662ns[-8956ns] +/- 3607nsAzure attaches an ephemeral resource disk, which waagent formats and mounts at /mnt. The disk is fast and local, but it is erased whenever the machine is deallocated or moved. Use it for scratch data and caches, never for data you need to keep:
df -h / /mntFilesystem Size Used Avail Use% Mounted on /dev/sda4 29G 1.4G 28G 5% / /dev/sdb1 7.8G 28K 7.4G 1% /mntNetworking and the firewall
The Azure Network Security Group controls inbound and outbound traffic. It is the first place, and usually the only place, where you need to open a port.
This image is a minimal build, so firewalld is not installed:
rpm -q firewalld || echo "(firewalld absent - the Azure NSG is your only firewall)"package firewalld is not installed (firewalld absent - the Azure NSG is your only firewall)This is deliberate. With no host firewall in the way, your NSG rules take effect exactly as written, with no second layer to keep in sync. Confirm what is listening before you open anything:
ss -tlnpIf your policy also requires a host firewall, install and enable it yourself:
sudo dnf install -y firewalld
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-port=443/tcp sudo firewall-cmd --reloadOnce firewalld is running, a port must be open in both the Azure NSG and firewalld before traffic reaches your service.
Install software
AppStream carries the application packages. Search it, then install what you need:
dnf search nginxInstall a package and enable it in the usual way. For example, run sudo dnf install -y nginx, then sudo systemctl enable --now nginx.
To add another administrator, create the account with sudo adduser <name>. Add it to the wheel group with sudo usermod -aG wheel <name>. Then copy your public key into /home/<name>/.ssh/authorized_keys, with mode 600 on the file and mode 700 on the .ssh directory, both owned by that user.
The image ships with no human accounts at all, so azureuser is the only login until you add one. List the group members:
getent group wheelCommon use cases
- An enterprise Linux base for application servers where the exact minor release is part of a validated configuration
- A RHEL-compatible platform for workloads certified against RHEL 9, without a subscription
- A standard operating system baseline for fleets managed by Ansible, Puppet or Salt
- A build and test host for software that must be verified against a named RHEL 9 point release
Troubleshooting
Cannot connect via SSH
Check that the Network Security Group allows inbound TCP 22 from your address. Confirm that the machine is running. Make sure your client offers the private key that matches the public key you supplied at create time. Password authentication is disabled, so a password prompt means key negotiation already failed.
Check the power state of the VM:
az vm show --resource-group myResourceGroup --name my-almalinux-9-8-vm --show-details --query powerState -o tsvAzure agent not running
Check the agent status and its recent log:
systemctl status waagent --no-pager sudo journalctl -u waagent -n 50 --no-pagerIf waagent is stopped, the extensions and portal features that depend on it stop working. Restart it with sudo systemctl restart waagent.
Package manager issues
Clear the metadata cache and rebuild it:
sudo dnf clean all
sudo dnf makecacheIf a repository is unreachable, confirm that the machine has outbound HTTPS and that DNS resolves. AlmaLinux's mirror system is reached over both.
A service is blocked and the logs mention SELinux
SELinux is enforcing, which is the secure default and should stay that way. Look at the denial instead of disabling SELinux:
sudo ausearch -m AVC -ts recent 2>/dev/null || echo "no recent AVC denials"Most denials on a fresh machine come from software installed into a non-standard path. Relabel with sudo restorecon -Rv /path before you consider any policy change.
Important notes
AlmaLinux is free and open source software. A single licence does not cover it. The distribution is a collection of free and open source licences across its package set, predominantly GPL, with LGPL, BSD, MIT, Apache and others. No subscription, entitlement or licence key is required, and no per-seat cost applies.
AlmaLinux is a trademark of the AlmaLinux OS Foundation. SecureAnyCloud is not affiliated with or endorsed by the AlmaLinux OS Foundation, and uses the name only to identify the distribution this image contains.
AlmaLinux 9 follows the RHEL 9 lifecycle, with support running into 2032. Check the AlmaLinux release notes for the dates that apply to your deployment.
Support
For assistance with this image, contact SecureAnyCloud support:
- Website: secureanycloud.com
- Product catalogue: secureanycloud.com/products
- User guides: secureanycloud.com/guides
- SLA: 24-hour response guaranteed
Deploy on Azure
Launch AlmaLinux 9.8 on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
AlmaLinux 9 is a free, community-built enterprise Linux distribution that is binary compatible with Red Hat Enterprise Linux 9 and maintained until 2032. This guide covers launching and verifying the SecureAnyCloud AlmaLinux 9.8 AMI on Amazon EC2.
The image is one version of the SecureAnyCloud AlmaLinux listing on AWS Marketplace. You pick it as the software version when you subscribe and launch. Every release and variant in the listing is described at /guides/almalinux-aws/.
This is the standard AlmaLinux 9.8 version of the listing: the full AlmaLinux 9.8 for EC2 package set, with nothing trimmed. What you get:
- The standard server package set, with current AWS tools. Everything the AlmaLinux 9.8 EC2 image ships stays installed. This includes the
tunedtuning daemon (running thevirtual-guestprofile) and the GeoLite2 location databases that the Minimal version of this listing removes (Step 4). The out-of-date AWS tools the base image carried outside any repository (an old CloudWatch agent and a bundled AWS CLI) are removed, and the Systems Manager agent is brought to its current release. - CIS Level 1 Server remediation. The image is remediated with the OpenSCAP CIS Level 1 Server profile from SCAP Security Guide 0.1.82 (AlmaLinux's own signed
scap-security-guidepackage), then rebooted and evaluated. On this build 255 of 256 scored rules pass (99.6%). Six rules are waived because they cannot work on an EC2 image, each with its reason. The HTML report, the machine-readable results, the waiver list and a summary ship in/usr/share/doc/sac/. - EC2 defaults that keep you in control. Key-only SSH as
ec2-user, root locked, no password on any account, SELinux enforcing and IMDSv2 required. A host firewall (firewalld) allows SSH in and everything out. The current AWS Systems Manager agent is installed, and time comes from the Amazon Time Sync Service. - Fully patched at build time, with
dnf-automaticapplying security updates on your instance.
What is on the image: AlmaLinux 9.8 (the RHEL 9-compatible 5.14 kernel), cloud-init, OpenSSH, firewalld, chrony, tuned, SELinux (targeted policy, enforcing), the AWS Systems Manager agent, auditd, rsyslog, AIDE file integrity checking, dnf-automatic, OpenSCAP and the pinned SCAP Security Guide content used for the evaluation.
Default user: ec2-user. Architecture: x86_64. Boot mode: legacy BIOS. Root volume: 10 GiB gp3, XFS (grows to the size you choose at launch).
Standard or another AlmaLinux 9 version? Choose this standard version if you want the image as AlmaLinux ships it, with tuned applying its virtual-guest tuning. Choose AlmaLinux 9 Minimal if you want the smallest package set and do not need tuned or the GeoLite2 databases. It carries the same CIS Level 1 Server hardening.
Choose AlmaLinux 9 LVM if your benchmark needs separate volumes for /tmp, /var, /var/log and the other CIS mount points. AlmaLinux 9 STIG and AlmaLinux 9 Essential Eight are remediated with other profiles. See the listing hub.
These images are remediated with an OpenSCAP profile and ship their own evaluation report. They are not CIS Hardened Images, and CIS has not reviewed or certified them.
Connecting to your instance
Version SSH user Root device
AlmaLinux 9.8 ec2-user /dev/sda1 (10 GiB gp3)
Security posture
- No known credential. There is no default password and no baked-in SSH key. The only key that works is the EC2 key pair you choose at launch, which cloud-init installs for
ec2-useron first boot. - Key-only SSH.
PasswordAuthentication no,PermitRootLogin no, keyboard-interactive off. The root account has no password and is locked. EC2 Instance Connect, which adds a second way to push SSH keys, is not installed. - Per-instance identity. SSH host keys and the machine ID are generated fresh on every instance, so no two instances share a host key.
- IMDSv2 required. The AMI is registered with
ImdsSupport v2.0, so instances launched from it refuse token-less (IMDSv1) metadata requests by default. - SELinux enforcing with the targeted policy, as AlmaLinux ships it.
- Host firewall. The
publiczone in firewalld allows only SSH and the DHCPv6 client inbound, and allows all outbound traffic. The SSM agent, metadata service, DNS, time and package updates keep working. - Only SSH listens on the network. Nothing else on the image listens on any address.
Prerequisites
- An AWS account and permission to launch EC2 instances
- An EC2 key pair in the Region you launch in
- A security group that allows TCP 22 from your own address (not from the whole internet)
Recommended instance type: m5.large. The image runs on any current x86_64 instance type.
Launch the instance
Option A: AWS Marketplace console
- Open the SecureAnyCloud AlmaLinux listing on AWS Marketplace, choose View purchase options, then choose Subscribe. One subscription covers every version in the listing.
- When the subscription is active, choose Launch your software.
- Choose One-click launch from AWS Marketplace, or Launch from EC2 Console for full control. In Version, choose AlmaLinux 9.8 - YYYY-MM-DD (the date is when the version was added), then select your Region.
- Instance type:
m5.largeis recommended, and any current x86_64 type works. The software charge is $0.04 per vCPU per hour. - Key pair: choose your EC2 key pair. It is the only way in. RSA and ED25519 keys both work.
- Security group: allow inbound TCP 22 from your own IP address or network only.
- Storage: the root volume is 10 GiB gp3 by default. Choose a larger size if you need one. cloud-init grows the root partition and filesystem to fill it on first boot.
- Metadata: leave the defaults, because the image already requires IMDSv2. Then choose Launch.
Option B: AWS CLI
Run this command on your own workstation. Replace the AMI ID with the one shown for your Region on the Marketplace launch page. Replace the key pair, security group and subnet with your own. The root device of this AMI is /dev/sda1:
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type m5.large \
--key-name my-key-pair \
--security-group-ids sg-0123456789abcdef0 \
--subnet-id subnet-0123456789abcdef0 \
--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=20,VolumeType=gp3}' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=almalinux-9-8}]'You do not need --metadata-options, because the AMI already requires IMDSv2.
Connect via SSH
From your workstation, connect as ec2-user with the key pair you chose:
ssh -i ~/.ssh/my-key-pair.pem ec2-user@<public-ip>There is no password to enter. If SSH asks for one, or says Too many authentication failures, see Troubleshooting below.
You can also connect without opening port 22 at all, through AWS Systems Manager Session Manager. This requires an instance profile that allows Systems Manager. The agent is installed and running on this image.
Confirm the release
Print the release files and the kernel version:
cat /etc/almalinux-release grep -E '^(NAME|VERSION|ID|VERSION_ID|PLATFORM_ID|PRETTY_NAME)=' /etc/os-release uname -srmExpected output:
AlmaLinux release 9.8 (Olive Jaguar) NAME="AlmaLinux" VERSION="9.8 (Olive Jaguar)" ID="almalinux" VERSION_ID="9.8" PLATFORM_ID="platform:el9" PRETTY_NAME="AlmaLinux 9.8 (Olive Jaguar)" Linux 5.14.0-687.59.1.el9_8.x86_64 x86_64The image is AlmaLinux 9.8 as built. Its repositories are the AlmaLinux 9 release stream ($releasever is 9), which the AlmaLinux mirror list serves from the 9.8 tree today.
AlmaLinux publishes updates only for the newest minor release. When AlmaLinux 9.9 ships, the instance moves to it through normal dnf updates, as every AlmaLinux 9 system does. Your kernel version may be newer if updates have installed since this image was built.
The standard package set
This version keeps the AlmaLinux 9.8 EC2 package set whole. The packages that the Minimal version removes are installed here, and tuned is running. Check the package count, the packages and the service:
rpm -qa | wc -l rpm -q tuned geolite2-city geolite2-country systemctl is-active tuned tuned-adm activeExpected output (the package versions change over time):
482 tuned-2.27.0-2.el9_8.noarch geolite2-city-20191217-6.el9.noarch geolite2-country-20191217-6.el9.noarch active Current active profile: virtual-guest- tuned is the system tuning daemon. Its
virtual-guestprofile, the onetuned-adm recommendpicks on EC2, sets memory writeback and swappiness, disk readahead and CPU performance settings for a guest on a hypervisor. To use another profile, list the profiles withtuned-adm list(tuned also ships anawsprofile). Then switch with, for example,sudo tuned-adm profile throughput-performance. - geolite2-city and geolite2-country are IP geolocation databases that some tools can use.
- The
sossupport-report collector is not part of the AlmaLinux 9 EC2 base image. If a support engineer asks for a report, install it withsudo dnf -y install sosand runsudo sos report.
What the Minimal version drops. AlmaLinux 9 Minimal removes tuned, geolite2-city and geolite2-country, along with the packages that exist only for them. It lists the removals in /usr/share/doc/sac/minimal-manifest.txt on its own image. A new Minimal instance has 465 packages against 482 here.
Everything else is the same in both versions. The AlmaLinux 9.8 EC2 base image is already small, so neither version has wireless or sound firmware, Cockpit or Plymouth installed. Both carry the same hardening, compliance tooling and AWS agents. The package count on your instance moves by a few as kernels and updates install.
Read the compliance evidence
The evaluation that the build ran after its reboot ships on the image. Read the files and the summary:
ls -lh /usr/share/doc/sac/ python3 -c "import json; s=json.load(open('/usr/share/doc/sac/cis-l1-summary.json')); print('profile: ', s['profileLabel'], '(SCAP Security Guide', s['ssgVersion'] + ')'); print('scored rules: ', s['scored'], ' pass:', s['pass'], ' fail:', s['fail'], ' rate:', str(s['ratePct']) + '%'); print('waived: ', s['waived'], ' not applicable:', s['notapplicable']); print('evaluated at: ', s['evaluatedAt'])"Expected output:
total 39M -rw-r--r--. 1 root root 36M Oct 20 02:55 cis-l1-arf.xml -rw-r--r--. 1 root root 2.3M Oct 20 02:55 cis-l1-report.html -rw-r--r--. 1 root root 1.2K Oct 20 02:55 cis-l1-summary.json -rw-r--r--. 1 root root 1.7K Oct 20 02:55 cis-l1-tailoring.xml -rw-r--r--. 1 root root 2.3K Oct 20 02:55 cis-l1-waivers.txt -rw-r--r--. 1 root root 1.6K Oct 20 02:51 scap-security-guide-LICENSE.txt profile: CIS Level 1 Server (SCAP Security Guide 0.1.82) scored rules: 256 pass: 255 fail: 1 rate: 99.6% waived: 6 not applicable: 33 evaluated at: 2026-10-20T02:55:29Zcis-l1-report.htmlis the full OpenSCAP report, rule by rule. Copy it to your workstation and open it in a browser.cis-l1-arf.xmlis the same evaluation in the machine-readable ARF format, for compliance tooling.cis-l1-tailoring.xmlis the exact tailoring used, so you can re-run the same evaluation (Step 6).- The pass rate is pass / (pass + fail + error + unknown). Rules that are not applicable to this machine, not selected, or waived are not counted.
To copy the report to your workstation, run this command on the workstation:
scp -i ~/.ssh/my-key-pair.pem ec2-user@<public-ip>:/usr/share/doc/sac/cis-l1-report.html .The six waived rules
List the waived rules and their groups:
grep -v '^#' /usr/share/doc/sac/cis-l1-waivers.txt | cut -f1,2Expected output:
partition_for_tmp [single-volume-partitions] grub2_password [serial-console-and-boot] ensure_root_password_configured [serial-console-and-boot] accounts_maximum_age_login_defs [key-only-account-aging] account_disable_post_pw_expiration [key-only-account-aging] sshd_limit_user_access [ssh-access-list]The third column of the same file gives the full reason for each. In short:
- Separate /tmp partition: this version boots from one EBS root volume. The LVM versions of this listing provide separate volumes for /tmp, /var, /var/log, /var/log/audit, /var/tmp and /home.
- Boot loader and root passwords: a GRUB or root password would have to be baked into the image, giving every instance the same secret. Root stays locked with no password. Set your own if you need serial console access (see Step 11).
- Password ageing defaults: the accounts cloud-init creates are key-only. An ageing limit would expire them and lock the SSH key out. Accounts that do have a password are still aged.
- SSH AllowUsers/AllowGroups: a list fixed at build time would refuse accounts you create later. Your security group restricts who can reach port 22.
The one rule that does not pass
Print the failing rule:
python3 -c "import json; [print(r) for r in json.load(open('/usr/share/doc/sac/cis-l1-summary.json'))['failingRules']]"Expected output:
ensure_journald_and_rsyslog_not_active_togetherThe benchmark wants one logging system, not both. AlmaLinux runs journald and rsyslog together by default. journald keeps the structured system journal (persistent, in /var/log/journal). rsyslog writes the traditional text logs (/var/log/messages, /var/log/secure, /var/log/cron) that many log shippers and audit procedures read.
The image keeps both so that neither kind of tooling loses its logs. If you standardise on one, for example the journal only, run sudo systemctl disable --now rsyslog on your instance and re-run Step 6.
Re-run the evaluation yourself
Repeat the evaluation at any time with the same content and tailoring. It takes under a minute:
sudo oscap xccdf eval \
--tailoring-file /usr/share/doc/sac/cis-l1-tailoring.xml \
--profile xccdf_co.sac_profile_cis-l1_ec2_single \
--results /tmp/cis-check-results.xml --report /tmp/cis-check-report.html \
/usr/share/xml/scap/ssg/content/ssg-almalinux9-ds.xml > /tmp/cis-check.log 2>&1 echo "oscap exit code: $? (2 = at least one rule did not pass)"
sudo python3 -c "import re,collections; c=collections.Counter(re.findall(r'<result>(\w+)</result>', open('/tmp/cis-check-results.xml').read())); s=sum(c[k] for k in ('pass','fail','error','unknown')); print(dict(sorted(c.items()))); print('pass rate: %.1f%%' % (100.0*c['pass']/s))"Expected output:
oscap exit code: 2 (2 = at least one rule did not pass) {'fail': 1, 'notapplicable': 33, 'notselected': 1251, 'pass': 255} pass rate: 99.6%Your own report is at /tmp/cis-check-report.html. As you install software and change settings, re-run the evaluation to see how your changes affect the result.
Confirm IMDSv2 is required
Request instance metadata without a token, then with one:
curl -s -o /dev/null -w 'IMDSv1 request without a token: HTTP %{http_code}\n' http://169.254.169.254/latest/meta-data/instance-id
TOKEN=$(curl -s -X PUT -H 'X-aws-ec2-metadata-token-ttl-seconds: 60' http://169.254.169.254/latest/api/token)
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" -w '\n' http://169.254.169.254/latest/meta-data/placement/regionExpected output (your Region may differ):
IMDSv1 request without a token: HTTP 401 us-east-1A request without a session token is refused with HTTP 401, and the same request with a token works. Scripts and SDKs on the instance must use IMDSv2. Every current AWS SDK and the AWS CLI do this automatically.
The host firewall and listening ports
Check the firewall state and the listening sockets:
sudo firewall-cmd --state sudo firewall-cmd --list-all sudo ss -tlnpExpected output:
running public (active) target: default icmp-block-inversion: no interfaces: eth0 sources: services: dhcpv6-client ssh ports: protocols: forward: yes masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=816,fd=7)) LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=816,fd=8))- Only
sshdlistens, on port 22. Nothing else on the image opens a TCP port. - The
publiczone allowssshanddhcpv6-client. The DHCPv6 client receives replies for the instance's IPv6 DHCP client, which is how an instance in an IPv6-enabled subnet gets its address. The AlmaLinux defaultcockpitservice is removed from the zone, and Cockpit is not installed. - The loopback interface sits in firewalld's
trustedzone. Rules drop any traffic that claims a loopback source from anywhere else (a CIS requirement).
Opening a port for your own service takes two steps. Allow the port in the instance's security group, and allow it in firewalld. For example, for a web server on 443, run this on the instance:
sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reloadIf a port is open in the security group but not in firewalld, or the other way round, the traffic does not arrive.
Time sync and the Systems Manager agent
Check both services and the time sources:
systemctl is-active chronyd amazon-ssm-agent chronyc -n sourcesExpected output (the pool servers and timings vary):
active active MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^- 129.250.35.250 2 6 17 17 -760us[ -860us] +/- 62ms ^- 23.150.41.122 2 6 33 18 -754us[ -854us] +/- 23ms ^- 198.178.138.195 2 6 17 19 +3195us[+3095us] +/- 38ms ^- 67.215.249.229 2 6 35 18 +1087us[ +987us] +/- 18ms ^* 169.254.169.123 3 4 37 4 +1125us[+1026us] +/- 1519usThe ^* marks the source chrony is using: 169.254.169.123, the Amazon Time Sync Service. It is reachable from every instance without internet access, so time stays correct in a private subnet too. The public AlmaLinux pool servers are fallbacks.
The AWS Systems Manager agent is installed from Amazon's own package at its current release (3.3.5390.0 on this build). It is not in the AlmaLinux repositories, so dnf does not update it. Systems Manager can keep it current for you, through the AWS-UpdateSSMAgent document or the Auto update SSM Agent setting in Fleet Manager.
Patch level and automatic updates
The image is fully patched at build time. Check what is pending now:
sudo dnf -q check-update --refresh echo "dnf check-update exit code: $? (0 = nothing to update, 100 = updates available)" grep -E '^(upgrade_type|apply_updates)' /etc/dnf/automatic.conf systemctl is-enabled dnf-automatic.timer uname -rExpected output on an instance launched soon after the image was built (later launches list the updates released since, with exit code 100):
dnf check-update exit code: 0 (0 = nothing to update, 100 = updates available) upgrade_type = security apply_updates = yes enabled 5.14.0-687.59.1.el9_8.x86_64dnf-automatic runs daily (06:00, with a random delay of up to an hour) and installs security updates automatically. To update everything immediately, run:
sudo dnf -y upgradeReboot if a new kernel was installed:
sudo systemctl rebootSecurity settings on the instance
Check SELinux, the root account and the effective SSH policy:
getenforce
sudo passwd -S root
sudo sshd -T | grep -E '^(permitrootlogin|passwordauthentication|pubkeyauthentication|maxauthtries|clientaliveinterval|banner) ' cat /etc/issue.netExpected output:
Enforcing root LK 2023-11-16 0 99999 7 -1 (Password locked.) maxauthtries 4 clientaliveinterval 300 permitrootlogin no pubkeyauthentication yes passwordauthentication no banner /etc/issue.net Authorized users only. All activity may be monitored and reported.Enforcingmeans SELinux is on and enforcing the targeted policy. Keep it on. If your own software is denied, checksudo ausearch -m avc -ts recentinstead of disabling SELinux.LKand(Password locked.)mean the root account is locked.maxauthtries 4andclientaliveinterval 300come from the CIS profile. SSH allows four authentication attempts per connection and checks idle sessions every five minutes.- The banner text is shown before login.
EC2 Serial Console and recovery. No account on this image has a password, so the serial console cannot log in until you set one. If you want serial console access, set a password for your own user on your running instance. The password is yours and is not on the image:
sudo passwd ec2-userDisk size, swap and file integrity
Check the root filesystem, the first-boot partition growth, swap and the AIDE schedule:
df -hT /
sudo grep -E 'cc_growpart.*(resized|NOCHANGE)' /var/log/cloud-init.log | tail -1 swapon --noheadings --show | wc -l sudo grep -h aide /etc/crontabExpected output with the default 10 GiB root volume (on a larger volume, Size is larger and the cloud-init line says resized):
Filesystem Type Size Used Avail Use% Mounted on /dev/nvme0n1p4 xfs 9.3G 1.6G 7.8G 17% / 2026-10-20 03:16:39,900 - cc_growpart.py[DEBUG]: '/' NOCHANGE: no change necessary (/dev/nvme0n1, 4) 0 05 4 * * * root /usr/sbin/aide --check- Disk layout. The instance boots with legacy BIOS. The root filesystem is XFS on partition 4 of the root volume.
/boot(XFS) and a small/boot/efipartition sit beside it. - Disk growth. cloud-init grows the root partition and filesystem to the volume size on first boot. To grow later, increase the EBS volume size in the console or with
aws ec2 modify-volume. Then runsudo growpart /dev/nvme0n1 4 && sudo xfs_growfs /(or reboot). - Swap. The image has no swap. Add a swap file yourself if your workload needs one.
- AIDE. The file integrity database is built from the image's own files, and the CIS profile schedules
aide --checkdaily at 04:05 from/etc/crontab.
Install software and add users
The instance uses the standard AlmaLinux 9 repositories (BaseOS, AppStream and Extras). Check that a package such as nginx is available:
sudo dnf -q list --available nginxExpected output (the version changes over time):
Available Packages nginx.x86_64 2:1.20.1-28.el9_8.6.alma.1 appstreamInstall and start software in the usual way. For example, run sudo dnf -y install nginx, then sudo systemctl enable --now nginx. Open its port in the security group and firewalld (Step 8).
AppStream also carries newer streams of some software as modules. For nginx, sudo dnf module list nginx shows 1.22, 1.24 and 1.26. Development headers and some build tools live in the CRB repository, which is present but disabled. Enable it with sudo dnf config-manager --set-enabled crb.
The AWS CLI is not on the image. Install the current version from AWS (the AWS CLI install guide) if you need it.
To add another administrator, create the account, add it to the wheel group and give it an SSH key:
sudo useradd -m -G wheel alice
sudo install -d -m 700 -o alice -g alice /home/alice/.ssh echo "ssh-ed25519 AAAA... alice@laptop" | sudo tee /home/alice/.ssh/authorized_keys
sudo chown alice:alice /home/alice/.ssh/authorized_keys && sudo chmod 600 /home/alice/.ssh/authorized_keys
sudo restorecon -R /home/alice/.sshBecause SSH is key-only, a new account needs its key in authorized_keys. The restorecon command gives the file the SELinux label that sshd expects.
The new account has no password, so sudo cannot authenticate it until you give it one with sudo passwd alice. SSH stays key-only, and sudo uses the password. Only ec2-user, created by cloud-init, has password-free sudo.
Common use cases
- A base for workloads that must show CIS Level 1 alignment on an enterprise Linux 9, with the evaluation report already on the machine
- Software certified or packaged for RHEL 9-compatible systems, with SELinux enforcing from the first boot
- General-purpose servers and container hosts that want AlmaLinux's own tuning (tuned) on a base supported until 2032
- Fleets managed through Systems Manager, with IMDSv2 required from the first boot
- A starting point for your own golden image: add your software, re-run Step 6, and keep the report with your build
Troubleshooting
SSH says "Too many authentication failures"
The SSH server allows four authentication attempts per connection. If your SSH agent holds several keys, it can use all four attempts before it offers the right one. Tell SSH to offer only the key you name:
ssh -o IdentitiesOnly=yes -i ~/.ssh/my-key-pair.pem ec2-user@<public-ip>Cannot connect via SSH
- Check that the instance is running and has passed its status checks.
- Check that the security group allows TCP 22 from your current public address.
- Use the user name
ec2-userand the key pair chosen at launch. Password login is disabled, so a wrong key never falls back to a password prompt. - If you changed firewalld, make sure the
sshservice is still allowed. Session Manager (Step 2) still works if SSH is blocked, provided the instance has a Systems Manager instance profile.
My service is running but not reachable
Allow the port in both the security group and firewalld (Step 8). sudo firewall-cmd --list-all shows the firewalld rules. sudo ss -tlnp shows whether the service listens on all addresses or only on loopback.
If the service runs on a non-standard port, SELinux may also need to allow it. Install the SELinux management tools with sudo dnf -y install policycoreutils-python-utils. Then, for a web server on 8080, for example, run sudo semanage port -a -t http_port_t -p tcp 8080.
A tool that uses instance metadata fails
The image requires IMDSv2. Old scripts that call http://169.254.169.254/ without a token get HTTP 401. Update them to request a token first (Step 7), or use the AWS CLI or a current SDK.
Package manager issues
Refresh the metadata first:
sudo dnf -q makecache --refresh && echo "repository metadata refreshed"If the repositories are unreachable, check that the instance has outbound internet access (a public IP or a NAT gateway) and that DNS resolves:
getent hosts repo.almalinux.orgImportant notes
AlmaLinux is free and open source software. It is a distribution of thousands of packages, each under its own licence (GPL, LGPL, MIT, BSD, Apache 2.0 and others). rpm -qi <package> shows each package's licence. No subscription or licence key is needed to run this image.
The compliance tooling is OpenSCAP (LGPL 2.1 or later) and SCAP Security Guide content (BSD 3-Clause, licence text in /usr/share/doc/sac/scap-security-guide-LICENSE.txt).
The AlmaLinux OS Foundation maintains AlmaLinux 9 until 2032. This version tracks the AlmaLinux 9 release stream, so new minor releases (9.9 and on) arrive as ordinary updates.
The CIS Level 1 Server profile used here is the OpenSCAP profile published in SCAP Security Guide. These images are not CIS Hardened Images and are not certified by the Center for Internet Security. A pass rate measures this image as built. Your own changes affect it, which is why you can re-run the evaluation (Step 6).
AlmaLinux is a trademark of the AlmaLinux OS Foundation. Red Hat Enterprise Linux is a trademark of Red Hat, Inc. CIS is a trademark of the Center for Internet Security. These names are used only to identify the software, its compatibility and the profile. SecureAnyCloud is not affiliated with or endorsed by the AlmaLinux OS Foundation, Red Hat or the Center for Internet Security.
Support
For help with this image, contact SecureAnyCloud support:
- Website: secureanycloud.com
- User guides: secureanycloud.com/guides
- AlmaLinux on AWS hub: secureanycloud.com/guides/almalinux-aws
Deploy on AWS
Launch AlmaLinux 9.8 on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com