From derby-dev-return-119336-archive-asf-public=cust-asf.ponee.io@db.apache.org Wed Nov 7 15:43:57 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A65D5180649 for ; Wed, 7 Nov 2018 15:43:56 +0100 (CET) Received: (qmail 55538 invoked by uid 500); 7 Nov 2018 14:43:50 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 55525 invoked by uid 99); 7 Nov 2018 14:43:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2018 14:43:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4127218E2B3 for ; Wed, 7 Nov 2018 14:43:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4YYCyB7y3tap for ; Wed, 7 Nov 2018 14:43:49 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 70A9A62362 for ; Wed, 7 Nov 2018 14:37:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 61701E263A for ; Wed, 7 Nov 2018 14:37:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0AE2E266A8 for ; Wed, 7 Nov 2018 14:37:01 +0000 (UTC) Date: Wed, 7 Nov 2018 14:37:01 +0000 (UTC) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DERBY-3547) Create a utility that generates a security policy file for Derby's tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-3547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas resolved DERBY-3547. ---------------------------------- Resolution: Fixed Fix Version/s: 10.15.0.0 I am done working on this issue. Resolving. > Create a utility that generates a security policy file for Derby's tests > ------------------------------------------------------------------------ > > Key: DERBY-3547 > URL: https://issues.apache.org/jira/browse/DERBY-3547 > Project: Derby > Issue Type: Improvement > Components: Test > Reporter: Daniel John Debrunner > Assignee: Rick Hillegas > Priority: Minor > Fix For: 10.15.0.0 > > Attachments: SecurityPolicyVTI.java, derby-3547-01-ab-policyGenerator.diff, derby-3547-02-aa-remainingTestPolicies.diff, derby-3547-03-aa-removeTemplatePolicy.diff > > > With the number of current test policy files it is becoming a pain to remember to modify all of them when needed to add a new permission. > In addition with JMX, SystemPermission (and DatabasePermission) support, testing of fine-grained permissions will become unmanagable if a new policy file is needed for every combination. > I suggest a java utility that can be used in a test decorator to create a set of permissions that can then be modified before creating a real policy file and pointing the security manager to it. I imagine an api like: > TestPolicy() - constructor creates a set of permissions that corresponds to the current derby_tests.policy (or similar) > The object supports a number of code bases, corresponding to the current jars, e.g. > derby, derbynet, derbytools,derbyclient,ant,emma, junit, > removeCodebase(String code) - remove all the permissions for a given code base. Allows specific testing, e.g. with just client tests don't have permissions for any other jars. > removePermission(String code, Permission permission) - remove a single permission from a code base - allows negative testing, what happens if this permission is not available. > addPermission(String code, Permission permission) - add a permission into the code base > writePolicyFile(PrintStream out) - write the policy file out > This would also stop the need for derby_tests.policy to have a jar and classes section with duplicated information, TestPolicy would just create the grant code blocks with the correct code location. > TestPolicy could obviously be expanded as new needs appear, eg. Principal testing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)