rules repository

A-0720 Always enable Page Access Protection.

Severity Error Check + SQL-based Test Free

Reason

Page Access Protection makes it impossible for users to tamper session values by modifying them in the URL thanks to embedded checksums.

Make sure it is set to argumentsMustHaveChecksum. The values noArgumentsSupported and noUrlAccess are valid as well.

Example

Non-Compliant Example

page 1 (
    // ...
    security {
        pageAccessProtection: unrestricted
    }
)
Issues
LineColumnMessage
431pageAccessProtection should be set to a different value than unrestricted.

Compliant Solution - ★★★★★

page 1 (
    // ...
    security {
        // other good values: `noArgumentsSupported`, `noUrlAccess`
        pageAccessProtection: argumentsMustHaveChecksum
    }
)

Tests

Test SQL query

select aa.workspace || '.' || aa.alias || '.' || ap.page_id as identifier,
       'pageAccessProtection should be set to argumentsMustHaveChecksum in app ' 
       || aa.alias || ' in page ' || ap.page_id || ' of ' || aa.workspace || '.' as message
  from apex_application_pages ap
  join apex_applications aa
    on ap.application_id = aa.application_id
       and ap.workspace = aa.workspace
 where lower(page_access_protection) = 'unrestricted'
   and aa.workspace in (#ApexWorkspaces#)
   and (json_value(json_array(#ApexAppIds#), '$[0]') is null
        or json_exists(json_array(#ApexAppIds#), '$[*]?(@ == $id)' passing to_char(aa.application_id) as "id"))

Test results

IdentifierMessageMigration
WORKSPACE.CUSTOMERS.1pageAccessProtection should be set to argumentsMustHaveChecksum in page 1 of app CUSTOMERS in WORKSPACE.-

Parameters

Use parameters to customize the rule to your needs.

ParameterDescriptionDefault Value
ApexAppIdsComma-separated list of APEX application IDs to check. If empty, all applications of the workspaces are checked.,
ApexWorkspacesComma-separated List of APEX workspaces owning APEX applications to check.dblinter, dbl_gui

References