SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
Surveillance de la Sécurité des Applications Java
avec les Outils du JDK et les Événements JFR
Ana-Maria Mihalceanu
Senior Developer Advocate
Java Platform Group
https://twitter.com/ammbra1508
https://mastodon.social/@ammbra1508
https://github.com/ammbra
“DevOps Tools for Java Developers” guest
author
https://dev.java
4/16/24
Copyright © 2024, Oracle and/or its affiliates |
3
Découvrir comment JDK Flight Recorder, JDK Mission
Control et JFR Security Events peuvent vous aider à
surveiller la sécurité de votre application Java afin que
vous puissiez détecter les risques potentiels pour la
sécurité.
Objectif
4/16/24
Copyright © 2024, Oracle and/or its affiliates |
5
• Pendant l'exécution d'une application Java, JFR peut
collecter les événements qui se produisent dans la JVM.
• Les événements JFR expriment l’état de l’application et
de la JVM sous-jacente.
JDK Flight Recorder (JFR) Événements
Event
ID
Timestamp
Thread
ID
Stack Trace
ID
Event Specific
Payload
Duration
Composants d'événement JFR
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
6
Nom Description Rétroporté
vers
Activé par
défaut
jdk.TLSHandshake Suit de l'activité de négociation TLS. Oracle JDK
11.0.5 et 8u231
Non
jdk.X509Certificate Enregistre les détails des certificats
X.509.
Oracle JDK
11.0.5 et 8u231
Non
jdk.X509Validation Enregistre les détails des certificats
X.509 négociés lors d'une validation
X.509 réussie.
Oracle JDK
11.0.5 et 8u231
Non
jdk.SecurityPropertyModification Enregistre les appels de
Security.setProperty(String key,
String value).
Oracle JDK
11.0.5 et 8u231
Non
jdk.InitialSecurityProperty Donne des informations sur les
propriétés de sécurité initiales du JDK.
Oracle JDK
17.0.7 et
11.0.20
Oui
jdk.SecurityProviderService Enregistre les appels de méthodes du
fournisseur de services.
JDK 17.0.8,
11.0.22 et
8u391
Non
JFR Événements de Sécurité
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
13
Configuration Locale de la Démo
4/16/24
Copyright © 2021, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted
19
Surveillance Continue dans le Cloud
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
20
À l'aide d'un MBeanServerConnection
Surveiller un hôte distant
String host = "com.example";
int port = 7091;
String url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
JMXServiceURL u = new JMXServiceURL(url);
JMXConnector c = JMXConnectorFactory.connect(u);
MBeanServerConnection connection = c.getMBeanServerConnection();
try (RemoteRecordingStream stream = new RemoteRecordingStream(connection)) {
stream.enable("jdk.X509Certificate").withStackTrace();
stream.onEvent("jdk.X509Certificate", System.out::println);,
stream.start();
}
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
21
Diffusez les Événements JFR
en Manière Active
CompositeMeterRegistry metricsRegistry = Metrics.globalRegistry;
try (var es = EventStream.openRepository()) {
es.onEvent("jdk.X509Validation", recordedEvent -> {
Gauge.builder("jdk.X509Validation", recordedEvent,
e -> e.getLong("validationCounter"))
.description("X509 Certificate Validation Counter")
.register(metricsRegistry);
});
es.start();
} catch (IOException e) {
throw new RuntimeException("Couldn't process event", e);
}
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
22
Faire Évoluer la Configuration de la démo
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
23
Jouons et Observons !
4/16/24
Copyright © 2021, Oracle and/or its affiliates |
25
• Monitoring Java Application Security with JDK tools and JFR Events: https://dev.java/learn/security/monitor/
• Stack Walker ep 2 on JFR https://inside.java/2023/05/14/stackwalker-02/
• Continuous monitoring with JDK Flight Recorder: https://www.infoq.com/presentations/monitoring-jdk-jfr/
• Code used during demo: https://github.com/ammbra/tictactoe
• OCI Instance installation: https://www.anamihalceanu.com/post/building-a-cloud-compute-instance-with-
java-concepts
• Compose files in OCI: https://docs.oracle.com/en/learn/podman-compose/index.html#confirm-podman-
compose-is-working
• More articles on Java Management Service: https://inside.java/tag/cloud
• Gunnar Morling’s article on custom JFR events: https://www.morling.dev/blog/rest-api-monitoring-with-
custom-jdk-flight-recorder-events/
Liens Utiles

Contenu connexe

Similaire à Surveillance de la sécurité des applications Java avec les outils du JDK et les événements JFR

Les architectures du Software Defined Storage
Les architectures du Software Defined StorageLes architectures du Software Defined Storage
Les architectures du Software Defined StorageRSD
 
Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1Mohamed Ouederni
 
Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1realtn
 
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...Ludovic ROLAND
 
Sécurité Communications par Daniel Fages 25/07/2012
Sécurité Communications par Daniel Fages 25/07/2012Sécurité Communications par Daniel Fages 25/07/2012
Sécurité Communications par Daniel Fages 25/07/2012Paris Android User Group
 
[FR] Capture vidéo avec HTML5
[FR] Capture vidéo avec HTML5[FR] Capture vidéo avec HTML5
[FR] Capture vidéo avec HTML5Thomas Bassetto
 
Orchestrating Docker in production - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp DockerOrchestrating Docker in production - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp DockerThe Incredible Automation Day
 
WebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
WebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbWebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
WebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbHINDGUENDOUZ
 
Soutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonySoutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonyVincent Composieux
 
Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013Xavier NOPRE
 
Ze cloud azure camp - 26 septembre
Ze cloud   azure camp - 26 septembreZe cloud   azure camp - 26 septembre
Ze cloud azure camp - 26 septembreAymeric Weinbach
 
Introduction aux RIA (Rich Internet Applications)
Introduction aux RIA (Rich Internet Applications)Introduction aux RIA (Rich Internet Applications)
Introduction aux RIA (Rich Internet Applications)Tugdual Grall
 
Java ME by Amdane Samb at BarCamp Goree, December 2010
Java ME by Amdane Samb at BarCamp Goree, December 2010Java ME by Amdane Samb at BarCamp Goree, December 2010
Java ME by Amdane Samb at BarCamp Goree, December 2010Christelle Scharff
 
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Mickaël Rémond
 
Presentation Symfony2
Presentation Symfony2Presentation Symfony2
Presentation Symfony2Ahmed ABATAL
 
Alphorm.com Formation SOPHOS XG FIREWALL: Les fondamentaux
Alphorm.com Formation SOPHOS XG FIREWALL: Les fondamentauxAlphorm.com Formation SOPHOS XG FIREWALL: Les fondamentaux
Alphorm.com Formation SOPHOS XG FIREWALL: Les fondamentauxAlphorm
 

Similaire à Surveillance de la sécurité des applications Java avec les outils du JDK et les événements JFR (20)

JavaRMI.pdf
JavaRMI.pdfJavaRMI.pdf
JavaRMI.pdf
 
Les architectures du Software Defined Storage
Les architectures du Software Defined StorageLes architectures du Software Defined Storage
Les architectures du Software Defined Storage
 
Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1
 
Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1Presentation certification 70-536 atelier 1
Presentation certification 70-536 atelier 1
 
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
 
Sécurité Communications par Daniel Fages 25/07/2012
Sécurité Communications par Daniel Fages 25/07/2012Sécurité Communications par Daniel Fages 25/07/2012
Sécurité Communications par Daniel Fages 25/07/2012
 
Chap7_JavaNet.pdf
Chap7_JavaNet.pdfChap7_JavaNet.pdf
Chap7_JavaNet.pdf
 
[FR] Capture vidéo avec HTML5
[FR] Capture vidéo avec HTML5[FR] Capture vidéo avec HTML5
[FR] Capture vidéo avec HTML5
 
Orchestrating Docker in production - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp DockerOrchestrating Docker in production - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp Docker
 
WebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
WebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbWebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
WebServices.pdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
 
Soutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonySoutenance Zend Framework vs Symfony
Soutenance Zend Framework vs Symfony
 
Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013
 
Push Notification
Push Notification Push Notification
Push Notification
 
Ze cloud azure camp - 26 septembre
Ze cloud   azure camp - 26 septembreZe cloud   azure camp - 26 septembre
Ze cloud azure camp - 26 septembre
 
Introduction aux RIA (Rich Internet Applications)
Introduction aux RIA (Rich Internet Applications)Introduction aux RIA (Rich Internet Applications)
Introduction aux RIA (Rich Internet Applications)
 
Java ME by Amdane Samb at BarCamp Goree, December 2010
Java ME by Amdane Samb at BarCamp Goree, December 2010Java ME by Amdane Samb at BarCamp Goree, December 2010
Java ME by Amdane Samb at BarCamp Goree, December 2010
 
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8 Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
Phoenix Presence: Le service temps réel de Phoenix - Paris.ex #8
 
Presentation Symfony2
Presentation Symfony2Presentation Symfony2
Presentation Symfony2
 
Alphorm.com Formation SOPHOS XG FIREWALL: Les fondamentaux
Alphorm.com Formation SOPHOS XG FIREWALL: Les fondamentauxAlphorm.com Formation SOPHOS XG FIREWALL: Les fondamentaux
Alphorm.com Formation SOPHOS XG FIREWALL: Les fondamentaux
 
Rapport tp3 j2ee
Rapport tp3 j2eeRapport tp3 j2ee
Rapport tp3 j2ee
 

Plus de Ana-Maria Mihalceanu

A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfAna-Maria Mihalceanu
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17Ana-Maria Mihalceanu
 
Java 21 Language Features and Beyond
Java 21 Language Features and BeyondJava 21 Language Features and Beyond
Java 21 Language Features and BeyondAna-Maria Mihalceanu
 
From Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsFrom Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsAna-Maria Mihalceanu
 
Java 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of InnovationsJava 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of InnovationsAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox
 A Glance At The Java Performance Toolbox A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfAna-Maria Mihalceanu
 
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfThe Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
The automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsThe automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
DevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsDevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsAna-Maria Mihalceanu
 

Plus de Ana-Maria Mihalceanu (20)

A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
 
Java 21 Language Features and Beyond
Java 21 Language Features and BeyondJava 21 Language Features and Beyond
Java 21 Language Features and Beyond
 
From Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsFrom Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security Enhancements
 
Java 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of InnovationsJava 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of Innovations
 
A Glance At The Java Performance Toolbox
 A Glance At The Java Performance Toolbox A Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdf
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdf
 
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfThe Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
 
Exploring Quarkus on JDK 17
Exploring Quarkus on JDK 17Exploring Quarkus on JDK 17
Exploring Quarkus on JDK 17
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
The automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsThe automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm charts
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
DevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsDevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applications
 

Surveillance de la sécurité des applications Java avec les outils du JDK et les événements JFR

  • 1. Surveillance de la Sécurité des Applications Java avec les Outils du JDK et les Événements JFR Ana-Maria Mihalceanu Senior Developer Advocate Java Platform Group
  • 3. 4/16/24 Copyright © 2024, Oracle and/or its affiliates | 3 Découvrir comment JDK Flight Recorder, JDK Mission Control et JFR Security Events peuvent vous aider à surveiller la sécurité de votre application Java afin que vous puissiez détecter les risques potentiels pour la sécurité. Objectif
  • 4. 4/16/24 Copyright © 2024, Oracle and/or its affiliates | 5 • Pendant l'exécution d'une application Java, JFR peut collecter les événements qui se produisent dans la JVM. • Les événements JFR expriment l’état de l’application et de la JVM sous-jacente. JDK Flight Recorder (JFR) Événements Event ID Timestamp Thread ID Stack Trace ID Event Specific Payload Duration Composants d'événement JFR
  • 5. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 6 Nom Description Rétroporté vers Activé par défaut jdk.TLSHandshake Suit de l'activité de négociation TLS. Oracle JDK 11.0.5 et 8u231 Non jdk.X509Certificate Enregistre les détails des certificats X.509. Oracle JDK 11.0.5 et 8u231 Non jdk.X509Validation Enregistre les détails des certificats X.509 négociés lors d'une validation X.509 réussie. Oracle JDK 11.0.5 et 8u231 Non jdk.SecurityPropertyModification Enregistre les appels de Security.setProperty(String key, String value). Oracle JDK 11.0.5 et 8u231 Non jdk.InitialSecurityProperty Donne des informations sur les propriétés de sécurité initiales du JDK. Oracle JDK 17.0.7 et 11.0.20 Oui jdk.SecurityProviderService Enregistre les appels de méthodes du fournisseur de services. JDK 17.0.8, 11.0.22 et 8u391 Non JFR Événements de Sécurité
  • 6. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 13 Configuration Locale de la Démo
  • 7. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted 19 Surveillance Continue dans le Cloud
  • 8. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 20 À l'aide d'un MBeanServerConnection Surveiller un hôte distant String host = "com.example"; int port = 7091; String url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi"; JMXServiceURL u = new JMXServiceURL(url); JMXConnector c = JMXConnectorFactory.connect(u); MBeanServerConnection connection = c.getMBeanServerConnection(); try (RemoteRecordingStream stream = new RemoteRecordingStream(connection)) { stream.enable("jdk.X509Certificate").withStackTrace(); stream.onEvent("jdk.X509Certificate", System.out::println);, stream.start(); }
  • 9. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 21 Diffusez les Événements JFR en Manière Active CompositeMeterRegistry metricsRegistry = Metrics.globalRegistry; try (var es = EventStream.openRepository()) { es.onEvent("jdk.X509Validation", recordedEvent -> { Gauge.builder("jdk.X509Validation", recordedEvent, e -> e.getLong("validationCounter")) .description("X509 Certificate Validation Counter") .register(metricsRegistry); }); es.start(); } catch (IOException e) { throw new RuntimeException("Couldn't process event", e); }
  • 10. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 22 Faire Évoluer la Configuration de la démo
  • 11. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 23 Jouons et Observons !
  • 12. 4/16/24 Copyright © 2021, Oracle and/or its affiliates | 25 • Monitoring Java Application Security with JDK tools and JFR Events: https://dev.java/learn/security/monitor/ • Stack Walker ep 2 on JFR https://inside.java/2023/05/14/stackwalker-02/ • Continuous monitoring with JDK Flight Recorder: https://www.infoq.com/presentations/monitoring-jdk-jfr/ • Code used during demo: https://github.com/ammbra/tictactoe • OCI Instance installation: https://www.anamihalceanu.com/post/building-a-cloud-compute-instance-with- java-concepts • Compose files in OCI: https://docs.oracle.com/en/learn/podman-compose/index.html#confirm-podman- compose-is-working • More articles on Java Management Service: https://inside.java/tag/cloud • Gunnar Morling’s article on custom JFR events: https://www.morling.dev/blog/rest-api-monitoring-with- custom-jdk-flight-recorder-events/ Liens Utiles