Skip to content

Additional PEP578 hooks #81544

Closed
Closed

Description

@zooba
BPO 37363
Nosy @tiran, @zooba, @matrixise, @miss-islington, @gousaiyang
PRs
  • bpo-37363: Add audit events for a range of modules #14301
  • [3.8] bpo-37363: Add audit events for a range of modules (GH-14301) #14345
  • bpo-37363: Add audit events on startup for the run commands #14524
  • [3.8] bpo-37363: Add audit events on startup for the run commands (GH-14524) #14536
  • bpo-37363: Document internal audit events #14663
  • [3.8] bpo-37363: Document internal audit events (GH-14663) #16046
  • bpo-37363: Add audit events to the http.client module #21321
  • 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 = None
    closed_at = None
    created_at = <Date 2019-06-21.15:42:29.023>
    labels = ['type-feature', '3.10']
    title = 'Additional PEP578 hooks'
    updated_at = <Date 2021-04-23.10:21:35.233>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2021-04-23.10:21:35.233>
    actor = 'matrixise'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2019-06-21.15:42:29.023>
    creator = 'steve.dower'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37363
    keywords = ['patch']
    message_count = 15.0
    messages = ['346229', '346301', '346367', '346416', '346418', '346419', '347085', '347088', '347093', '352154', '352156', '352157', '373074', '391675', '391676']
    nosy_count = 5.0
    nosy_names = ['christian.heimes', 'steve.dower', 'matrixise', 'miss-islington', 'gousaiyang']
    pr_nums = ['14301', '14345', '14524', '14536', '14663', '16046', '21321']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37363'
    versions = ['Python 3.10']

    Activity

    1. zooba commented on Jun 21, 2019

      @zooba
      MemberAuthor

      We should also (see whether we should) add audit hooks for the following modules:

      • configparser
      • crypt
      • ensurepip
      • ftplib
      • glob
      • http
      • imaplib
      • nntplib
      • pdb
      • poplib
      • runpy
      • shutil
      • smtpd
      • smtplib
      • socketserver
      • sqlite3
      • telnetlib
      • webbrowser
      • xmlrpc

      All of these seem likely to have interesting events (specifically, they can all be misused in scenarios where the impact would not be obvious without extra information).

    2. zooba commented on Jun 22, 2019

      @zooba
      MemberAuthor

      PR 14301 has at least a few hooks for most of the modules above.

      I think xmlrpc deserves some, but it is not as immediately obvious where to put them as for the other modules. smtpd also still needs looking at.

    3. tiran commented on Jun 24, 2019

      @tiran
      Member

      I'll add hooks to ssl module for wrap_socket and wrap_bio.

    4. zooba commented on Jun 24, 2019

      @zooba
      MemberAuthor

      New changeset 60419a7 by Steve Dower in branch 'master':
      bpo-37363: Add audit events for a range of modules (GH-14301)
      60419a7

    5. miss-islington commented on Jun 24, 2019

      @miss-islington
      Contributor

      New changeset 8763d43 by Miss Islington (bot) in branch '3.8':
      bpo-37363: Add audit events for a range of modules (GH-14301)
      8763d43

    6. zooba commented on Jun 24, 2019

      @zooba
      MemberAuthor

      FWIW, I tried looking into how we can prevent or detect monkeypatching of "sys.audit", and the answer seems to be that we need to define a custom type for the sys module and for sys.__dict__.

      I'm not prepared to do that yet, and IMHO there are enough way to detect someone patching it to nothing (all your logs disappear) or patching it more cleverly (someone ran some pretty complex code to redefine it) and events from native code can't be suppressed either, so I think it's fine.

      But I won't refuse a contribution if someone thinks this is a critical scenario (though I will push hard to make sure the implementation is solid, as I think this is pretty hard to get right).

    7. zooba commented on Jul 1, 2019

      @zooba
      MemberAuthor

      New changeset e226e83 by Steve Dower in branch 'master':
      bpo-37363: Add audit events on startup for the run commands (GH-14524)
      e226e83

    8. miss-islington commented on Jul 1, 2019

      @miss-islington
      Contributor

      New changeset 746992c by Miss Islington (bot) in branch '3.8':
      bpo-37363: Add audit events on startup for the run commands (GH-14524)
      746992c

    9. zooba commented on Jul 1, 2019

      @zooba
      MemberAuthor

      All that's left here right now is some xmlrpc events, unless we can think of any more stdlib modules that should have them?

    10. miss-islington commented on Sep 12, 2019

      @miss-islington
      Contributor

      New changeset ed4b321 by Miss Islington (bot) (Christian Heimes) in branch 'master':
      bpo-37363: Document internal audit events (GH-14663)
      ed4b321

    11. miss-islington commented on Sep 12, 2019

      @miss-islington
      Contributor

      New changeset 2f01cf6 by Miss Islington (bot) in branch '3.8':
      bpo-37363: Document internal audit events (GH-14663)
      2f01cf6

    12. matrixise commented on Sep 12, 2019

      @matrixise
      Member

      @christian, I have merged your PR for the audit events, but I have not closed this issue, I suppose there will be other PRs for this issue.

    13. matrixise commented on Jul 6, 2020

      @matrixise
      Member

      Hi @christian,

      When you have time for my last question.

      Thank you,

    14. matrixise commented on Apr 23, 2021

      @matrixise
      Member

      New changeset 927b841 by Saiyang Gou in branch 'master':
      bpo-37363: Add audit events to the http.client module (GH-21321)
      927b841

    15. matrixise commented on Apr 23, 2021

      @matrixise
      Member

      the http module is covered by the audit events

    16. transferred this issue fromon Apr 10, 2022
    17. erlend-aasland commented on Nov 27, 2022

      @erlend-aasland
      Contributor

      @zooba, can we close this?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions