<?xml version='1.0' encoding='utf-8'?>
<oval-def:oval_definitions xmlns:ind="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:unix="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5#linux linux-definitions-schema.xsd">
  <oval-def:generator>
    <oval:product_name>OVALFileLinker from SCAP Security Guide</oval:product_name>
    <oval:product_version>ssg: [0, 1, 80], python: 3.10.12</oval:product_version>
    <oval:schema_version>5.11.2</oval:schema_version>
    <oval:timestamp>2025-11-23T12:44:14</oval:timestamp>
  </oval-def:generator>
  <oval-def:definitions>
    <oval-def:definition id="oval:ssg-accounts_password_last_change_is_in_past:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>Ensure all users last password change date is in the past</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="accounts_password_last_change_is_in_past" source="ssg" />
        <oval-def:description>All passwords last change date is in the past.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria operator="OR">
        <oval-def:criterion comment="All passwords last change date is in the past" test_ref="oval:ssg-test_accounts_password_last_change_is_in_past:tst:1" />
        <oval-def:criterion comment="There is no password defined in /etc/shadow" test_ref="oval:ssg-test_accounts_password_last_change_is_in_past_no_pass:tst:1" />
      </oval-def:criteria>
    </oval-def:definition>
  </oval-def:definitions>
  <oval-def:tests>
    <ind:variable_test id="oval:ssg-test_accounts_password_last_change_is_in_past:tst:1" version="1" check="all" comment="Check if the password last chage time is less than or equal today." check_existence="all_exist" state_operator="AND">
      <ind:object object_ref="oval:ssg-object_accounts_password_last_change_is_in_past_time_diff:obj:1" />
      <ind:state state_ref="oval:ssg-state_accounts_password_last_change_is_in_past_time_diff:ste:1" />
    </ind:variable_test>
    <unix:shadow_test id="oval:ssg-test_accounts_password_last_change_is_in_past_no_pass:tst:1" version="1" check="all" comment="Check the inexistence of users with a password defined" check_existence="none_exist" state_operator="AND">
      <unix:object object_ref="oval:ssg-object_accounts_password_last_change_is_in_past:obj:1" />
    </unix:shadow_test>
  </oval-def:tests>
  <oval-def:objects>
    <unix:shadow_object id="oval:ssg-object_accounts_password_last_change_is_in_past:obj:1" version="1">
      <unix:username operation="pattern match">.*</unix:username>
      <oval-def:filter action="exclude">oval:ssg-state_accounts_password_all_chage_past_has_no_password:ste:1</oval-def:filter>
    </unix:shadow_object>
    <ind:variable_object id="oval:ssg-object_accounts_password_last_change_is_in_past_time_diff:obj:1" version="1">
      <ind:var_ref>oval:ssg-var_accounts_password_last_change_is_in_past_time_diff:var:1</ind:var_ref>
    </ind:variable_object>
  </oval-def:objects>
  <oval-def:states>
    <unix:shadow_state id="oval:ssg-state_accounts_password_all_chage_past_has_no_password:ste:1" version="1" operator="AND">
      <unix:password operation="pattern match">^(!|!!|!\*|\*|!locked)$</unix:password>
    </unix:shadow_state>
    <ind:variable_state id="oval:ssg-state_accounts_password_last_change_is_in_past_time_diff:ste:1" version="2" operator="AND">
      <ind:value datatype="int" operation="less than or equal" var_check="all" var_ref="oval:ssg-var_accounts_password_last_change_is_in_past_current_epoch:var:1" />
    </ind:variable_state>
  </oval-def:states>
  <oval-def:variables>
    <oval-def:local_variable id="oval:ssg-var_accounts_password_last_change_is_in_past_time_in_secs:var:1" version="1" datatype="int" comment="last change field of shadow entry in seconds">
      <oval-def:arithmetic arithmetic_operation="multiply">
        <oval-def:object_component object_ref="oval:ssg-object_accounts_password_last_change_is_in_past:obj:1" item_field="chg_lst" />
        <oval-def:literal_component datatype="int">86400</oval-def:literal_component>
      </oval-def:arithmetic>
    </oval-def:local_variable>
    <oval-def:local_variable id="oval:ssg-var_accounts_password_last_change_is_in_past_time_diff:var:1" version="1" datatype="int" comment="time difference between the last change field of shadow entry and the current time">
      <oval-def:time_difference format_2="seconds_since_epoch">
        <oval-def:variable_component var_ref="oval:ssg-var_accounts_password_last_change_is_in_past_time_in_secs:var:1" />
      </oval-def:time_difference>
    </oval-def:local_variable>
    <oval-def:local_variable id="oval:ssg-var_accounts_password_last_change_is_in_past_current_epoch:var:1" version="1" datatype="int" comment="the current time in seconds since epoch">
      <oval-def:time_difference format_2="seconds_since_epoch">
        <oval-def:literal_component datatype="int">0</oval-def:literal_component>
      </oval-def:time_difference>
    </oval-def:local_variable>
  </oval-def:variables>
</oval-def:oval_definitions>