Online admissions open for the SEO, web development and networking & cybersecurity courses. Enquire for the next batch.

Security Auditing: Scope, Frameworks, Commands and Reports

5 min read Updated By the SkillNewton team

What is a security audit?

A security audit is a formal, evidence-based check of whether an organisation's systems, processes and controls meet a defined standard, policy or regulation. Auditors compare what should happen with what actually happens, using interviews, document review, configuration checks and log analysis. The output is a report of findings, non-conformities and recommendations.

Audit vs assessment: what is the difference?

The words are often used loosely, but they mean different things. An audit measures compliance against fixed criteria and needs evidence for every conclusion. An assessment, such as a vulnerability assessment, looks for weaknesses and risks without necessarily measuring them against a standard.

AspectSecurity auditSecurity assessment
QuestionDo we meet the requirement?Where are we weak?
CriteriaA standard, policy, contract or lawThreats and known vulnerabilities
EvidenceFormal, sampled and documentedTechnical findings
Who performs itInternal audit or an independent auditorSecurity team or consultants
OutputConformities, non-conformities, observationsPrioritised risks and fixes

Key terms

  • Control: a measure that reduces risk, such as MFA or a change approval process.
  • Non-conformity: a requirement that is not met.
  • Sampling: testing a selection of items, such as 25 user accounts, to draw a conclusion about the whole set.
  • Baseline: the approved secure configuration for a type of system.

Frameworks: ISO/IEC 27001 and the CIS Controls

ISO/IEC 27001 is the international standard for an information security management system (ISMS). The current edition, ISO/IEC 27001:2022, includes Annex A with 93 controls grouped into four themes: organisational, people, physical and technological. Organisations can be certified against it by an accredited certification body after an external audit.

The CIS Critical Security Controls, from the Center for Internet Security, are 18 prioritised groups of technical safeguards, such as asset inventory, data protection, secure configuration, account management and audit log management. Implementation Groups (IG1 to IG3) help smaller organisations start with essential safeguards. CIS also publishes free, detailed CIS Benchmarks for hardening operating systems, cloud platforms and applications.

Other common criteria include SOC 2 reports, PCI DSS for card data and sector rules set by Indian regulators. Pick the criteria before the audit starts; they define what counts as a finding.

Planning the audit: scope and evidence

  1. Define the objective and the criteria, for example "Linux web servers against our hardening standard, based on the CIS Benchmark".
  2. Set the scope: systems, locations, processes, time period and any exclusions.
  3. Agree access: read-only accounts, log exports and the people to interview.
  4. Prepare a checklist that maps each requirement to the evidence you will collect.
  5. Collect evidence through interviews, document review, configuration checks and log samples.
  6. Record each finding with its criterion, the evidence, the risk and a recommendation.
  7. Hold a closing meeting to confirm facts before the final report is issued.

Linux audit commands

These read-only commands collect common evidence on a Linux server. Service and log names vary slightly between distributions; on Red Hat family systems, the SSH unit is sshd rather than ssh.

# Accounts with UID 0 (should be root only)
awk -F: '$3 == 0 {print $1}' /etc/passwd

# Members of admin groups and sudo rules
getent group sudo wheel
sudo grep -rv '^#' /etc/sudoers /etc/sudoers.d/ 2>/dev/null | grep -v ':$'

# Listening services and recent logins
sudo ss -tulpn
last -n 20; sudo lastb -n 20

# Effective SSH settings for root login and password authentication
sudo sshd -T | grep -Ei 'permitrootlogin|passwordauthentication'

# SUID files and world-writable files
sudo find / -xdev -perm -4000 -type f 2>/dev/null
sudo find / -xdev -type f -perm -0002 2>/dev/null

# SSH log entries for the last day, and a full hardening scan with Lynis
sudo journalctl -u ssh --since yesterday
sudo lynis audit system

Permission concepts behind the find checks are explained in Linux file permissions, and more everyday tools are in the Linux commands reference.

Windows audit commands

Run these in a PowerShell window opened with "Run as administrator"; each one only reads settings.

# Local users, last logon and local administrators
Get-LocalUser | Select-Object Name, Enabled, LastLogon, PasswordRequired
Get-LocalGroupMember -Group Administrators

# Password and lockout policy, and the audit policy
net accounts
auditpol /get /category:*

# Firewall profiles and listening ports
Get-NetFirewallProfile | Select-Object Name, Enabled
Get-NetTCPConnection -State Listen | Sort-Object LocalPort

# Last 20 failed logons (event ID 4625) and installed updates
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 20
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 10

Log review and configuration checks

Log review confirms that controls actually operate. Check that logging is switched on, that logs reach a central store, that clocks are synchronised and that logs are kept for the required period; in India, CERT-In directions require 180 days. Then sample the content:

  • Repeated failed logins followed by a success from the same source.
  • Logins at unusual hours or from unexpected countries.
  • New administrator accounts and changes to admin group membership.
  • Audit or security logs that were cleared, such as Windows event ID 1102.
  • Firewall rule and configuration changes without a matching change ticket.

For configuration checks, compare each system with its baseline. Tools such as Lynis, OpenSCAP and CIS-CAT automate this for many controls, but review their results manually before reporting them as findings.

Writing the audit report

A clear audit report states the objective, criteria, scope and period, then summarises the overall result for management. Each finding lists the requirement, what was observed, the evidence reference, the risk rating and a recommended action with an owner and a target date. Follow-up audits check those actions, so keep the evidence files organised by finding number.

Practical exercise: audit one of your own systems

Choose a Linux virtual machine or a Windows PC that you own and audit it against five controls.

  1. Write the criteria: only root has UID 0, SSH root login is disabled, the firewall is on, failed logins are logged and updates were installed within the last 30 days.
  2. Run the matching commands above and save the output with the date and hostname.
  3. Mark each control as met or not met, with the evidence file that proves it.
  4. For every gap, write a one-line risk statement and a recommendation.
  5. Fix one gap, re-run the check and record the new evidence.

You are done when a reviewer could reach the same conclusions from your evidence alone. Hardening and audit labs are part of the Advanced Networking course.

Common mistakes

  • Starting an audit without agreed criteria, so findings become opinions.
  • Accepting a screenshot or verbal assurance where the configuration itself can be checked.
  • Running audit tools with write access or making changes during the audit.
  • Checking that logging is enabled without confirming anyone reviews the logs.
  • Reporting raw tool output without risk ratings or practical recommendations.

Frequently asked questions

How often should security audits be done?

Internal audits are commonly annual, with technical configuration checks more often. Certifications such as ISO/IEC 27001 have their own cycle of surveillance and recertification audits.

Can a small business use the CIS Controls?

Yes. Implementation Group 1 was designed as a basic set of safeguards that smaller organisations can apply with limited staff.

What is the difference between a security audit and a penetration test?

An audit checks compliance with defined criteria using evidence. A penetration test tries to break in to show real impact. Mature programmes use both.

Want to Learn This Properly?

The Advanced Networking & Cybersecurity Mastery (Online) turns guides like this into practised skills, with projects on real websites.

WhatsApp Call Us Now

Free counselling

Send an Enquiry

Tell us which course you are interested in. We reply by email or phone with the next batch and how to enrol.

Protected by reCAPTCHA. Google Privacy and Terms apply.

We reply by email or phone within working hours. No spam.