ISO 27001 Control A.8.4: Access to Source Code
For a software company, source code is the crown jewels. For almost any other organization, it is still the thing that decides how your systems behave, from the website to the internal automation scripts. If someone can read it, they may find weaknesses or copy your intellectual property. If someone can change it, they can plant a backdoor that ships to every customer. A.8.4 sets the expectation that you manage who can do either. It is the fourth of 34 technological controls in our walk through Annex A.
The control is wider than it first looks. It covers development tools and software libraries as well as the code itself, which reflects how modern attacks work. Compromising a build pipeline or a widely used library can be far more rewarding for an attacker than breaking into a single production server.
What the control requires
Annex A control 8.4 of ISO 27001:2022 states that read and write access to source code, development tools and software libraries shall be appropriately managed.
The key elements:
- Source code - the code your organization writes or holds, including infrastructure as code, scripts, configuration and, where relevant, code of third parties
- Development tools and software libraries - editors, build and deployment systems, package registries, dependencies and the settings that drive them
- Read and write access - who can see the code and who can change it, which are different questions with different risks
- Appropriately managed - governed by rules, approvals and records proportionate to the sensitivity of the code
A.8.4 is a preventive control. Annex A states the control; ISO 27002 gives guidance, including that access should be granted according to need, that code should be held in a controlled repository, that write access should be limited, that changes should be logged and audit trails kept, and that source code held in program libraries should be managed in line with established procedures. The guidance also suggests that access to source code can differ for read and write, and that where code is published or open source, controls focus on integrity and change authorization rather than on secrecy.
How to implement control of access to source code
Put everything in a managed repository
Start by gathering code into properly managed version control systems, not laptops, chat attachments or shared drives. Include infrastructure definitions, deployment scripts, and configuration, since these often have as much influence as application code. Use organization-level accounts for hosting platforms and require single sign-on where available, so that access ends when employment does. If contractors or external developers contribute, give them access through their own identified accounts and limit it to the repositories they need. This builds on the principles of access control and information access restriction.
Separate read from write and limit both
Not everyone who needs to read code needs to change it. A few practical defaults make a large difference:
- Private repositories by default, with a deliberate decision before anything is made public
- Team-based permissions rather than individual grants, with the minimum role needed
- Protected main branches, so that changes require review and cannot be pushed directly
- Required reviews by a second person, which supports segregation of duties
- Restricted administrator rights on the repository platform, following privileged access rights
- Careful handling of secrets, with scanning for credentials committed by accident and a rule that keys never live in code
For the most sensitive components, such as payment logic, cryptography or security tooling, narrow access further and consider additional approvals for changes.
Protect development tools and libraries
The build chain deserves the same care as the code. Restrict who can edit pipeline definitions, since a changed pipeline can alter what gets built and deployed. Protect build servers and runners as production-grade assets, keep their credentials narrow and short-lived, and separate duties so that the person who writes a change is not the only one who can approve and release it. For libraries and dependencies, use trusted package sources, pin versions, review new additions, and watch for known vulnerabilities. Private package registries and internal libraries need access rules too: who can publish, who can consume, and how you notice an unexpected release. These ideas connect to supply chain controls such as managing information security in the ICT supply chain and, where development is contracted out, to later controls on secure development that we cover in the series.
Log, review and plan for departures
Keep audit trails of who accessed or changed code, and who changed repository settings. Review membership of repositories and organizations on a regular schedule, and remove accounts that no longer need access. When someone leaves, make repository access part of your offboarding checklist, including personal access tokens and deploy keys they created. Where code contains licensed or proprietary material, remember obligations covered by intellectual property rights, and be careful with copies on personal devices or in public code-sharing sites. Developers sometimes paste code into online tools for help; make your expectations clear in your acceptable use of information and other associated assets rules, including for AI assistants, and check the terms of any tool before sensitive code goes into it.
If you are a small team, you do not need an elaborate program to get most of the benefit. Three habits go a long way: no direct pushes to the main branch, a second pair of eyes on every change, and a quarterly look at who belongs to the organization on your code hosting platform. Add secret scanning and a short offboarding checklist and you have covered the failure modes we see most often. As the team grows, layer in finer-grained roles, signed commits or releases where they add value, and stricter handling of the components that carry the most risk.
Do not forget code that lives outside the main product, such as data science notebooks, automation scripts, infrastructure templates and one-off tools written by operations staff. These rarely get the same scrutiny, yet they frequently hold credentials and touch production systems. Bringing them into the same repositories and rules is usually quick and pays off immediately.
Related controls and clauses
A.5.15 connection. Access control gives the general rules that repository permissions put into effect.
A.5.32 connection. Intellectual property rights explains why code, and the licences attached to libraries, need care.
A.5.21 connection. Managing information security in the ICT supply chain is relevant to third-party libraries and tools.
A.5.3 connection. Segregation of duties underlies mandatory code review and separate approval of releases.
A.8.2 connection. Privileged access rights covers repository and pipeline administrators.
A.8.3 connection. Information access restriction is the general control that this one applies to the specific case of code.
Forward reference. Secure development life cycle (A.8.25), secure coding (A.8.28), outsourced development (A.8.30) and change management (A.8.32) deal with how code is written and released. We cover them later in the series.
What auditors check
Where code lives. Auditors ask which repositories exist and whether code outside them, such as on personal machines, is controlled.
Who has access. They request a list of users and roles for key repositories, and compare it with current staff and contractors.
Write protections. Expect questions about branch protection, mandatory reviews, and who can bypass them.
Pipeline and tool access. Auditors may ask who can edit build definitions and deployment credentials.
Secrets handling. They look for evidence that credentials are kept out of code and that accidental exposure would be detected.
Review and offboarding. Access reviews and examples of removed leavers show the control is maintained.
Common mistakes to avoid
Everyone is an owner. Giving all developers administrator rights on the repository platform removes the safeguards the platform offers.
Public by accident. A private project made public, or a fork on a personal account, can expose proprietary code and secrets.
Secrets in code. Keys committed to history remain retrievable long after they are deleted from the latest version.
Unprotected pipelines. A build system anyone can edit is a route to production that bypasses review.
Ignoring dependencies. Pulling libraries blindly invites supply chain compromise.
Forgotten tokens. Personal access tokens and deploy keys outlive employment unless you hunt for them.
How 27kay can help
We help engineering teams protect their code and build chain without slowing delivery. As part of ISO 27001 implementation, we help you set repository and pipeline permissions, define review rules that fit your workflow, handle secrets and dependencies sensibly, and prepare the evidence auditors ask for. For the full picture, see our ISO 27001 knowledge hub.
If a former contractor tried to push a change to your main branch today, what would stop them? Get in touch - we will help you make sure the answer is a good one.