Gaming regulations

Loi 05-20: audit your betting or lottery app before it goes live.

Morocco has no gambling regulator that licenses private operators: sports betting is run by MDJS, horse-race betting by SOREC and the national lottery by SGLN, all three listed by the Ministry of Economy and Finance among public establishments and enterprises. As public enterprises, they come under Loi 05-20 on cybersecurity, which asks that any information system offering digital services to third parties be security audited before it goes live and audited regularly, and under the DGSSI's national directive, which asks for security tests during development. Ostorlab scans your app on each release and, when depth matters, pentests it and the APIs behind it.

Free scan of your app from the App Store or Google Play. No login required.

AfricaState operators MDJS, SOREC and SGLN (no gambling regulator)

Action plan

  1. Know which rules apply
  2. Audit before launch
  3. Track the audit cycle
  4. Scan each release
  5. Pick a verification level
  6. Logins, bets and payouts
  7. Data, keys and components
  8. Evidence for auditors
Rules explained
10
Controls mapped
9
Official texts
12

Trusted by game and lottery operators, including

  • Oregon Lottery
  • Scientific Games
  • TPI
  • 4.8/5 on Gartner Peer Insights
  • SOC 2 Type II report (Security)

The Moroccan texts behind a state betting or lottery app

No gambling-specific text sets security rules for betting or lottery apps in Morocco. The duties come from general cybersecurity and data protection law that covers public enterprises, and from the operators' own certifications. The dates below come from the texts and from the operators' own documents.

28 March 1972

National lottery convention

The State and the Caisse de Dépôt et de Gestion sign the convention under which SGLN organises and runs the national lottery, in application of Loi 23-71 on the national lottery (Bulletin officiel of 5 April 1972) and decree n° 2-72-310 on its management and control, as SGLN's terms for eloterie.ma recall (French text).

The Moroccan rules at a glance

Who it applies to
MDJS (sports betting), SOREC (horse-race betting) and SGLN (national lottery, online through eloterie.ma), as public enterprises, and the suppliers who build or run their platforms under contract
Key dates
Loi 05-20 promulgated 25 July 2020; implementing decree n° 2-21-406 of 15 July 2021; cloud decree n° 2-24-921 of 22 October 2024
Focus
A security audit before go-live and regular audits, classification of sensitive systems, secure development and testing, vulnerability management, supplier contracts and player data
Main reference
Loi n° 05-20 relative à la cybersécurité, decree n° 2-21-406 and the DGSSI's Directive Nationale de la Sécurité des Systèmes d'Information (DNSSI)

Moroccan law, applied to a state betting app

For each rule: what the text says, what it means for a betting or lottery app run by MDJS, SOREC or SGLN, how Ostorlab helps, and what stays with the operator, its auditors and the authorities.

Source:Loi n° 05-20 relative à la cybersécurité, articles 1 and 4(opens in a new tab)

Audit the app before it goes live, then regularly

  • What the text says

    Loi 05-20 applies to the information systems of State administrations, local authorities, public establishments and enterprises and other public-law bodies, together called "entités". Each entity must identify the risks to its information systems and take the technical and organisational measures to manage them. Any information system of an entity "offrant des services numériques à des tiers" (offering digital services to third parties) must have a security audit before it is put into operation, and each entity must audit its information systems regularly.

  • What it means for your app

    MDJS and SOREC are on the Ministry of Economy and Finance's list of public establishments and enterprises, and SGLN is listed among the public establishments and enterprises under the State's financial control. An online betting or lottery app and the platform behind it offer a digital service to players, so a new app or platform needs its security audit before launch, and audits after that.

  • How Ostorlab helps

    An AI-agent pentest tests the app and its APIs behind login, on the build you ship, with a working exploit you can replay for each AI-agent finding. Routine scans run on each release in between.

  • What stays with you

    Commissioning the pre-launch and periodic audits, choosing the auditor, and deciding when a system may go live.

Summary of Loi 05-20, decrees n° 2-21-406 and n° 2-24-921, the DGSSI's DNSSI and application verification referential, Loi 09-08 and CNDP guidance, in French, checked on 3 December 2026. Morocco has no gambling regulator licensing private operators, and none of these texts is a gambling regulation: they apply to MDJS, SOREC and SGLN as public enterprises, which is our reading of the texts. This page is not legal advice.

Moroccan rules, control by control

The controls the Moroccan texts point to, how Ostorlab tests them in a betting or lottery app and its APIs, and the evidence you can keep.

  1. How Ostorlab helps

    AI-agent pentest of the app and its APIs, behind login, on the build you ship.

    Evidence you keep

    A working exploit you can replay for each AI-agent finding, and a coverage heatmap

    Agentic Deep Scan

Ostorlab tests controls in the app and its APIs. Classification and declaration of sensitive systems, audits by DGSSI-qualified providers, homologation where a system belongs to a vital infrastructure, the RSSI, incident declaration to the DGSSI, CNDP authorisations and transfer filings, hosting and cloud choices, game, draw and result integrity, and the operators' ISO 27001 and WLA certifications stay with MDJS, SOREC, SGLN, their auditors and the authorities. Texts checked on 3 December 2026. This page is not legal advice.

Moroccan controls to test in a state betting or lottery app

A practical list for security and compliance teams at MDJS, SOREC and SGLN and at the suppliers who build or run their apps, based on Loi 05-20, its decree, the DNSSI, the DGSSI application referential and Loi 09-08.

  1. Know which rules apply

    Confirm with your legal team that your company is an entity under Loi 05-20, how the betting platform is classified, and whether any system has been designated part of a vital infrastructure.

  2. Audit before launch

    Put each new app, major version or platform through its security audit before it goes live, and keep the report.

  3. Track the audit cycle

    For sensitive systems, track the last audit in each domain, including penetration testing and source code audit, so none is more than three years old.

  4. Scan each release

    Run Mobile SAST and DAST on each release as part of the acceptance tests, and retest once fixes ship.

  5. Pick a verification level

    Choose the DGSSI application referential level for the app, usually level 2 or above for an app that moves money, and use its controls in acceptance tests and supplier contracts.

  6. Logins, bets and payouts

    Verify on the server that login, account recovery, deposits, bets and withdrawals require the right authentication, and that one account cannot reach another's data or balance.

  7. Data, keys and components

    Check storage, caches, logs and transport for personal data, the app package for keys and credentials, and each release's SBOM for outdated components.

  8. Evidence for auditors

    Keep scan results, exploit evidence and retest results with each release, ready for the qualified auditor, the annual DNSSI review and supplier reviews.

A suggested list, not a template from the DGSSI, the CNDP or the operators. Texts checked on 3 December 2026. This is not legal advice.

Sources

The official texts this page is based on, checked on 3 December 2026.

FAQ

Frequently asked questions

Straight answers on coverage, setup, and how results reach your team.

Can't find your answer? Book a demo or contact us.

Test your betting or lottery app before and between Moroccan audits

Start with a free scan of your app from the store, or book a demo to run logged-in tests of your app and APIs with our team.