Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit events for unhandled exceptions #83101

Closed
zooba opened this issue Nov 26, 2019 · 4 comments
Closed

Audit events for unhandled exceptions #83101

zooba opened this issue Nov 26, 2019 · 4 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes type-feature A feature request or enhancement

Comments

@zooba
Copy link
Member

zooba commented Nov 26, 2019

BPO 38920
Nosy @vstinner, @zooba
PRs
  • bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks are invoked #17392
  • [3.8] bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are invoked (GH-17392) #17393
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2019-12-02.19:10:42.284>
    created_at = <Date 2019-11-26.17:15:28.637>
    labels = ['type-feature', '3.8', '3.9']
    title = 'Audit events for unhandled exceptions'
    updated_at = <Date 2019-12-02.19:10:42.283>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2019-12-02.19:10:42.283>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2019-12-02.19:10:42.284>
    closer = 'steve.dower'
    components = []
    creation = <Date 2019-11-26.17:15:28.637>
    creator = 'steve.dower'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38920
    keywords = ['patch']
    message_count = 3.0
    messages = ['357517', '357530', '357620', '357621']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'steve.dower']
    pr_nums = ['17392', '17393']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue38920'
    versions = ['Python 3.8', 'Python 3.9']

    @zooba
    Copy link
    Member Author

    zooba commented Nov 26, 2019

    We currently have no audit events for unhandled exceptions.

    While these can be recorded by sys.excepthook or sys.unraisablehook in Python code, there is no way to intercept them from C code set up before running Python code. There's also no way to collect information about what hook is running, in the case where Python code may have overridden it (for example, to suppress error reporting when malicious code fails).

    @zooba zooba added 3.8 only security fixes 3.9 only security fixes type-feature A feature request or enhancement labels Nov 26, 2019
    @zooba zooba self-assigned this Nov 26, 2019
    @zooba
    Copy link
    Member Author

    zooba commented Nov 26, 2019

    +Victor in case you'd like to check my changes to the unraisable hook implementation.

    @zooba
    Copy link
    Member Author

    zooba commented Nov 28, 2019

    New changeset bea33f5 by Steve Dower in branch 'master':
    bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks are invoked (GH-17392)
    bea33f5

    @zooba
    Copy link
    Member Author

    zooba commented Nov 28, 2019

    New changeset b74a6f1 by Steve Dower in branch '3.8':
    bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are invoked (GH-17392)
    b74a6f1

    @zooba zooba closed this as completed Dec 2, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant