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

Last pushes before testing session #40

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ static ElementMatcher<MethodDescription> getMethodsMatcher(
"java.io.BufferedReader",
List.of("lines"),
"java.nio.channels.FileChannel",
List.of("open")
List.of("open"),
"java.nio.file.spi.FileSystemProvider",
List.of("newFileChannel")
);
//</editor-fold>

Expand All @@ -167,9 +169,7 @@ static ElementMatcher<MethodDescription> getMethodsMatcher(
"java.nio.file.Files",
List.of("write", "writeString", "newOutputStream", "writeBytes", "writeAllBytes", "writeLines"),
"java.io.File",
List.of("setWritable"),
"java.nio.channels.FileChannel",
List.of("open")
List.of("setWritable")

);
//</editor-fold>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import com.tngtech.archunit.core.domain.JavaClasses;
import com.tngtech.archunit.core.importer.ClassFileImporter;
import de.tum.cit.ase.ares.api.aop.java.JavaSecurityTestCaseSupported;
import de.tum.cit.ase.ares.api.architecture.ArchitectureSecurityTestCase;
import de.tum.cit.ase.ares.api.architecture.java.CallGraphBuilderUtils;
import de.tum.cit.ase.ares.api.architecture.java.JavaArchitecturalTestCaseSupported;
import de.tum.cit.ase.ares.api.architecture.java.JavaArchitectureTestCase;
import de.tum.cit.ase.ares.api.architecture.java.archunit.JavaArchUnitSecurityTestCase;
import de.tum.cit.ase.ares.api.aop.java.JavaSecurityTestCase;
import de.tum.cit.ase.ares.api.policy.SecurityPolicy;
import de.tum.cit.ase.ares.api.policy.SecurityPolicy.ResourceAccesses;
Expand Down Expand Up @@ -215,6 +213,7 @@ private void createSecurityTestCases() {
new SecurityPolicy.PackagePermission("org.java.aspectj"),
new SecurityPolicy.PackagePermission("org.aspectj"),
new SecurityPolicy.PackagePermission("de.tum.cit.ase.ares.api.aop.java.aspectj.adviceandpointcut")));
new SecurityPolicy.PackagePermission(packageName);
//</editor-fold>

//<editor-fold desc="Create variable rules code">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ java.lang.System.setProperties(Ljava/util/Properties;)
java.util.ResourceBundle.getBundle
java.lang.System.setErr
java.lang.System.setIn
java.lang.System.setOut
java.lang.System.setOut
java.lang.Runtime.loadLibrary0
java.lang.Runtime.load0
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static void accessFileSystemViaPrintStream() throws FileNotFoundException
* Access the file system using the {@link FileChannel} class for writing.
*/
public static void accessFileSystemViaFileChannelWrite() throws IOException {
FileChannel fileChannel = FileChannel.open(Path.of("pom123.xml"));
FileChannel fileChannel = FileChannel.open(Path.of("pom123.xml"), StandardOpenOption.WRITE);
fileChannel.write(ByteBuffer.allocate(10));
}

Expand Down
Loading