def security_rules_list(security_group, resource_group, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    List security rules within a network security group.

    :param security_group: The network security group to query.

    :param resource_group: The resource group name assigned to the
        network security group.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.security_rules_list testnsg testgroup

    '''
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        secrules = netconn.security_rules.list(
            network_security_group_name=security_group,
            resource_group_name=resource_group
        )
        result = __utils__['azurearm.paged_object_to_list'](secrules)
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result